SageJFox
Posts : 64 Join date : 2008-03-30 Age : 30 Location : Goodbye, Blazed Games...
Character sheet RPG: 10
| Subject: Simple NPC Movement Sun Mar 30, 2008 12:59 pm | |
| Well, I started this board so I might as well make the first topic. I've noticed that a lot of people can't seem to get this. I don't know why. Anyway, to get this movement, you really only need one piece of code. Step, Step - Code:
-
{ if(place_snapped(argument0,argument1))speed=0; if(place_snapped(argument0,argument1) && floor(random(argument3))==0)motion_set(choose(0,90,180,270),argument2); } argument0 is the xsnap argument1 is the ysnap argument2 is the speed (should divide into the x and y snap) argument3 is the chance that the movement will happen I've tested it on different grids sizes, and it works on all of them. However, I haven't found a way to get directions 45, 135, 225, or 315 yet (they don't align for some reason). I hope it's useful. ~Sage J. Fox | |
|
Bob-1100k
Posts : 63 Join date : 2008-03-29 Age : 29 Location : SA, Australia
| Subject: Re: Simple NPC Movement Wed Apr 02, 2008 5:29 am | |
| It's good but I found one little thing: when it stops it starts moving again because it's on a the grid. Do you understand what I'm getting at? | |
|
santa22
Posts : 70 Join date : 2008-03-29 Age : 34 Location : unabletosaywhere
| Subject: answer Wed Apr 02, 2008 3:36 pm | |
| you could put a alarm on it so it has a second to stand. | |
|
SageJFox
Posts : 64 Join date : 2008-03-30 Age : 30 Location : Goodbye, Blazed Games...
Character sheet RPG: 10
| Subject: Re: Simple NPC Movement Wed Apr 02, 2008 5:57 pm | |
| What are you setting argument3 to? It sets the chance that it will happen, so the lower it is, the more often it will move random. 45 goes good. | |
|
Bob-1100k
Posts : 63 Join date : 2008-03-29 Age : 29 Location : SA, Australia
| Subject: Re: Simple NPC Movement Wed Apr 02, 2008 11:43 pm | |
| It works well now though : D maybe it didn't work beecause I put the speed so high. | |
|
brett
Posts : 42 Join date : 2008-04-01 Location : his house :P
| Subject: cool Thu Apr 03, 2008 3:12 pm | |
| very helpful.thanks(maybe now jon will think better of me) | |
|
Jon Admin
Posts : 106 Join date : 2008-03-23
Character sheet RPG: 10
| Subject: Re: Simple NPC Movement Fri Apr 04, 2008 1:16 pm | |
| - brett wrote:
- very helpful.thanks(maybe now jon will think better of me)
Maybe . | |
|
Sponsored content
| Subject: Re: Simple NPC Movement | |
| |
|