Page 1 of 1

I'm a newb at script

PostPosted: Sat Jun 21, 2008 6:23 am
by Donutslayer
I've used other programs, but when it comes to game editor I'm a newb, I would like to know some script editor commands like gravity, all I know in the script editor is how to move left and right. I need to know how to make a command wait until the first part happens (y = y + 5 wait 1 second y = y - 5) doesn't work


please help

Re: I'm a newb at script

PostPosted: Sat Jun 21, 2008 10:52 am
by asmodeus
You can get some information about the Game-Edito scripting here.

Re: I'm a newb at script

PostPosted: Sat Jun 21, 2008 3:42 pm
by Freddy
Oh, do you want to know how to jump, and then fall back down?
That's simple, here's what ya do: Go to keydown (choose the key you want/make sure you set the reapeat to disable) -> add action, script editor:

yvelocity = yvelocity - 8;

We now have the ability to jump.
Then add an event -> draw actor ->script editor:

yvelocity = yvelocity + .8;

We now have gravity to pull us back down.
All that is left to do is add ground. Make another actor called ground. Give it an animation, maybe just a line made from ms paint. When you are done, go to the "jumping" actor. Add an event -> collision -> physical response, On: any side, Of Actor: ground, Repeat this event while actor is colliding: yes -> edit action, leave everything as is EXCEPT the first number under Final Velocity Multiplyer. Change that number to zero. Click OK, immediate action. Go to game-mode, and try it out.
I hope I answered your question. :D

Re: I'm a newb at script

PostPosted: Sun Jun 22, 2008 12:32 am
by Donutslayer
thanks, I think I've figured it out, but can't you really just put y = y - 8 instead of yvelocity

Re: I'm a newb at script

PostPosted: Sun Jun 22, 2008 12:35 am
by DST
in fact, you can just put y+=8; instead of either of those.

However, if you're making gravity, you'd probably want to use yvelocity, since you go faster and faster as you fall.

Re: I'm a newb at script

PostPosted: Sun Jun 22, 2008 10:11 pm
by Donutslayer
thanks for all the help but I mostly want to know how to make something wait

WAIT ONE SECOND
then
explode animation 1
WAIT ONE SECOND HOW DO I MAKE SOMETHING WAIT!!!!!!!!!!!!!!!!!!!!!!!
then
change animation {explode animation 2}

Re: I'm a newb at script

PostPosted: Sun Jun 22, 2008 10:27 pm
by DST
use a timer!

Re: I'm a newb at script

PostPosted: Sun Jun 22, 2008 10:37 pm
by Freddy
Lol, OK:

1. Go to the actor, add event "draw actor" -> create timer. Click on the "timer" button, and select ''new timer". Name the timer, give it a time (it's in milliseconds, so make sure that you do 2000 for 2 seconds). Click OK.
2. Add the event called "timer" located at the bottom of the events list. Click the timer button, and select your timer. Add action -> change animation. Choose your explosion animation, click add -> immediate action.
3. Add event -> animation finish, (the explosion animation) -> change animation, (to whatever your next animation is)
You're done! :D

Re: I'm a newb at script

PostPosted: Sun Jun 22, 2008 11:11 pm
by Donutslayer
THANK YOU, DST, FREDDY, AND ASMODUES









THANK-YOU!!!!!!!!!!!!!!11