![]() |
Custom NPC
Alright I need someone fairly good at scripting. I am trying to learn and I need a kinda mini tutorial here. Can someone take me through a short step by step process for scripting things like animals, baddies or anything with custom sprites. I kinda know something about u gotta make variables that deal with how many hearts and speed and such but thats about it. If someone is willing to help I would gladly appreciate it.
|
1 Attachment(s)
just for an example lets use this...
|
Quote:
|
im trying to learn for free so showimg i guess
|
*setcharani GANINAME,; - Sets a NPCs Gani
*setani GANINAME,; -Sets players Gani |
Mrmicro did you read his message??
Quote:
|
Re: Custom NPC
Quote:
this.hearts=heartcount; this.speed=speed; (normal speed is about 0.2 or 0.3, can't remember which one). Then, you'd need to do an if (created){} stuff, which sets the variables, and the image and junk. You'd use showimg, for showing it. Then, you'd need to use a changeimgvis index,3; (3 is the same level as the player on the board). Then you'd need changeimgpart index,x,y,width,height; (x and y are the starting x/y of the current sprite, and width and height are how many pixels to display following the starting x/y). That's all jumbled together, I know, so if you have problems understanding it (I have a lot of trouble understanding some of the things I write sometimes), let me know, and I'll spend a little more time on this sort of thing. Or just ask someone else. Either one works. |
Re: Re: Custom NPC
Quote:
|
Hmm... it might work that way, but I haven't seen anything like that. Say each sprite was a square that was 50*50 pixels each.
To get the first image you'd use something like NPC Code: That would show the first sprite, the still dog from behind. Now, say you wanted the image of the dog sitting down while facing toward the player. You'd just do something like: NPC Code: That would take the image and edit the part that's showing, giving you the dog sitting down. The actual dimensions are a little different that a 200*300 pixel image, but that's the general idea. Hope that helped. |
I think there is some kinda formula that people use that changes the sprites
|
Yeah, your probably right. But I don't know what it is... sorry.
|
If I take it out of one of the NPC's on Babylon think you could figure it out?
|
Quote:
|
found it!
if (this.dir==3) setgifpart b_greenbird.png,192,this.sprite*32,64,32; its the last part of that... |
Quote:
|
actually what i suggest is a simple code that is like x=dir*50 and than it places the cursor there, its very useful, does anyone know where i could get some idea of what all the drawingheights for changeimgvis are? cause i am in the dark on that one thing.
|
"npcprogramming.doc" in graal folder
|
Quote:
1- below player 2- same level as player 3- above player 4- on the screen and I heard that 5-10 draw overtop of 4, on the screen. I never read anything about that though... |
what is this? I saw it in one of Xaviars scripts its like dirgo = {-1,0,1,2,3} blah blah or something. I also saw it in a tutorial by Ace
|
bogo_dog.png...lol
lol npcserver.doc in the your mom folder. |
Quote:
wtfs you dont make any sense stop it! |
what would have to be added to a baddy to make it work for many players? I have had bad experiences with the bats and stuff on babylon and if 2 or more people come in they freeze
|
// NPC made by Lord Helmut
//widthofsprites=91 //heightofsprites=105 if(created){ this.xpos=x; this.ypos=y; this.hearts=20; this.speed=1; this.dir=0; this.sprite=0; setimgpart #f,91*2,0,91,105; } if(playersays(hi)){ timeout=.05; } if (timeout){ if (this.xpos>playerx){this.xpos-=this.speed}; if (this.ypos<playery){this.ypos+=this.speed}; if (this.xpos<playerx){this.xpos+=this.speed}; if (this.ypos>playery){this.ypos-=this.speed}; timeout=.05; } I did this so far but the character wont move =( |
please help?
|
add this in your timeout sequence:
NPC Code: and you for the setimg part try this: (based off your second post's image; NPC Code: and when that dog gets moving, it's super fast... NPC Code: G'luck mate, Gohan |
Quote:
|
| All times are GMT +2. The time now is 09:21 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.