Help - Search - Members - Calendar
Full Version: Help with a couple of scripts
RPG RPG Revolution Forums > Game Engines > RPG Maker 2000 / 2003 > General Game Engines Discussion
orcywoo6
I am making a little zombie application in game maker at the moment, I have some scripts but they arent working how I would like them to.

CODE
if random(20) < 1
direction += 90;
if random(20) < 1
direction -= 90;
if random(20) < 1
speed = 0;
if random(20) < 1
speed = 1;

Thats my random movement script, I was wondering if there was a way to make it smoother, because at the moment they turn way too fast, they literally flash to the next direction, and they change direction far too often.

I was also wondering how I can stop the zombies and humans overlapping each other, I have found a simple method but it makes them spaz all over the place and start shaking so if there was an alternative or a suggestion I would be happy happy.gif

Thanks in advance, i'm still learning.
darkyoshi
Sorry about the late reply, anyway...

You need to use a timer. An easy way is to use GM's built in timers, "alarms".

You can put that code you have in an alarm event and at the end do something like:
CODE
alarm[0]=30  //30=1 second
You will need to start it by using it in the create event as well.

________________________________________

You could also make your own timer.
CODE
changeTime+=1
if changeTime=30
{
  //put your code here
  changeTime=0
}

There's a bajillion ways to slow it down, these are just a few.
Oaken
Well, if you are trying to make a random, slow moving zombie you could just go to the event screen for them and look under the Autonomous movement box to the left. Then under type select random... Finally you could then go to Speed and set it as
Speed 2: X4 slower
and
Freq: Highest

I know this really wasnt what you are looking for... Im just no good with scripts and I wanted to help! tongue.gif
darkyoshi
Wrong program Oaken, you're thinking rpg maker.
We've already got it solved it seems anyway. tongue.gif
orcywoo6
Thanks very much thumbsup.gif

I will try it out once I get a chance to and post results smile.gif
Oaken
0.0 Oops! XD my mistake! I should have read the post better! Well, im glad that it worked out for you anyways!
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2013 Invision Power Services, Inc.