Page 1 of 1

I am going to kill myself...

PostPosted: Wed Jan 14, 2009 4:10 pm
by BloodRedDragon
.....if this dosen't work. :cry: I have four key down events for a tank in my game. Each key down event triggers a script editor action and each key is as follows:

Code: Select all
 For the tank:

(Key Down/up/Script Editor/ At least one key is pressed, repeat)
y=y-5;
ChangeAnimation ("Event Actor", "bluetank", FORWARD);
angle = 90;

(Key Down/down/Script Editor/At least one key is pressed, repeat)
y=y+5;
ChangeAnimation("Event Actor", "bluetank down", FORWARD);
angle = 270;

(Key Down/left/Script Editor/At least one key is pressed, repeat)
x=x-5;
ChangeAnimation("Event Actor", "bluetank left", FORWARD);
angle = 180;

(Key Down/right/Script Editor/At least one key is pressed, repeat)
x=x+5;
ChangeAnimation("Event Actor", "bluetank right", FORWARD);
angle = 0;

When the tank fires, it creates a cannonball actor.
For the cannonball that the tank fires:
(Create actor/Script editor)
angle = creator.angle;
directional_velocity = 10;


When I press any key on its own, it moves in the right direction but only fires across the screen in one direction, travelling right. It should fire in all four directions! And, to make matters worse, when I press two keys at the same time, THE TANK FLIES AROUND THE SCREEN AND I CANNOT STOP IT FROM MOVING, AS IF IT HAS VELOCITY!

Please help or I will jump of a cliff! :twisted: :twisted: :twisted: :twisted: :twisted: :evil:

Re: I am going to kill myself...

PostPosted: Wed Jan 14, 2009 8:36 pm
by DST
Well, the script should have worked...don't understand what went wrong.

BUT....I have an easy fix!

Create an Actor Variable, integer, and name it myangle.
on tank, key down, change 'angle=n' to 'myangle=n';

and on bullet startup, change angle to creator.myangle;

Here is a quick demo of that. I couldn't get any 'flying around the place' action on it, perhaps you could elaborate on what's happening there?

One thing i do know....multiple keypresses are heavily dependant upon your keyboard. If you have other keyboards around, trying hooking one of those up and test it with that.

I got rid of my comfy ergonomic keyboard in favor of this battered old dell model; the dell model allows me to press 6 keys at once without any problems, which makes it ideal for gaming. (the other one couldn't even handle down + right at the same time)

Re: I am going to kill myself...

PostPosted: Thu Jan 15, 2009 3:47 pm
by BloodRedDragon
Thnks VM DST! People could benefit from someone like you in this forum! :mrgreen:

I'll post this game 2 U whenever it's finished.

Re: I am going to kill myself...

PostPosted: Thu Jan 15, 2009 6:28 pm
by Kalladdolf
DST... you just saved a life... [insert roll-eye-smiley here]

Re: I am going to kill myself...

PostPosted: Fri Jan 16, 2009 10:15 pm
by BloodRedDragon
DST... you just saved a life...


I wasnt really going 2 kill myself, i was just a bit miffed cos i haven't finished any of my games, i have no points becuase I cant help anyone and I get errors way too often :?