how do i make a NPC move forward and move back?
i tried
setcharani ("walk",NULL) ;
aaand it doesnt walk but does the animation
Printable View
how do i make a NPC move forward and move back?
i tried
setcharani ("walk",NULL) ;
aaand it doesnt walk but does the animation
temp.a = this.x
temp.b = this.y
Incrementing this.x makes it go horizontally sideways
Incrementing this.y makes it go vertically upwards / downwards
Put it in a loop that increments the x / y value.
Don't forget to put the gani in the loop as well.
For style points,make sure the npc is facing the right direction.
How do people understand that language????????
It's easy.
In real life, to say tell somebody to change their body you say "change your body" but in Graal, you say "this.body = "body_nicholas.png" ;
I don't really recommend help from others, but ask when you need to.
What I recommend is to become a admin on a Dev. Server on PW and Press F9 or type /NPC and then press on the NPC's and examine them, add a new NPC and script it. You will remember it.
And trav, thank you. I haven't been able to check it out because my laptop screen is black but turns on eh..
So, does scripting take more of the Java side or C++ side? I want to learn but I want to learn one programming language at a time.
It depends where you want them to walk, I use
function onCreated(){
for(NULL;temp.n<=20;temp.n=temp.n+0.2){
this.x=temp.n;
sleep(0.1);
}
}
Depending on where you place it. if n is greater or equal to 20 then it will move down .2 spaces until n is greater then 20. So 20 would be the x position so if it is more then 20 steps to the right from where it starts, it will stop moving. this.x is the npc's x position on the level. you can replace it with this.y to make it move vertical