I am going to kill myself...

Non-platform specific questions.

I am going to kill myself...

Postby BloodRedDragon » Wed Jan 14, 2009 4:10 pm

.....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:
Current projects:
Techno-Tank Arena: on hold
Techno-Tank SuperPortal (working title): 0.1%
Bowels of Galaxies: 35% (was a bit too optimistic)
User avatar
BloodRedDragon
 
Posts: 123
Joined: Tue Jan 29, 2008 10:07 pm
Location: The Underworld
Score: 5 Give a positive score

Re: I am going to kill myself...

Postby DST » Wed Jan 14, 2009 8:36 pm

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)
Attachments
tankfire.zip
(1.15 KiB) Downloaded 87 times
It's easier to be clever than it is to be kind.
http://www.lostsynapse.com
http://www.dstgames.com
User avatar
DST
 
Posts: 1117
Joined: Sun Apr 15, 2007 5:36 pm
Location: 20 minutes into the future
Score: 151 Give a positive score

Re: I am going to kill myself...

Postby BloodRedDragon » Thu Jan 15, 2009 3:47 pm

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.
Current projects:
Techno-Tank Arena: on hold
Techno-Tank SuperPortal (working title): 0.1%
Bowels of Galaxies: 35% (was a bit too optimistic)
User avatar
BloodRedDragon
 
Posts: 123
Joined: Tue Jan 29, 2008 10:07 pm
Location: The Underworld
Score: 5 Give a positive score

Re: I am going to kill myself...

Postby Kalladdolf » Thu Jan 15, 2009 6:28 pm

DST... you just saved a life... [insert roll-eye-smiley here]
User avatar
Kalladdolf
 
Posts: 2427
Joined: Sat Sep 08, 2007 8:22 am
Location: Germany
Score: 120 Give a positive score

Re: I am going to kill myself...

Postby BloodRedDragon » Fri Jan 16, 2009 10:15 pm

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 :?
Current projects:
Techno-Tank Arena: on hold
Techno-Tank SuperPortal (working title): 0.1%
Bowels of Galaxies: 35% (was a bit too optimistic)
User avatar
BloodRedDragon
 
Posts: 123
Joined: Tue Jan 29, 2008 10:07 pm
Location: The Underworld
Score: 5 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest

cron