Page 1 of 2

How to make things shoot

PostPosted: Mon Jun 28, 2010 2:09 am
by ESL
I am a newbie here. Have read through the tutorials and watched the Space Invaders demo but am still having trouble making a spaceship to shoot. I am probably just missing one detail but not sure what it is. Are there any detailed instructions on how to do this?

Re: How to make things shoot

PostPosted: Mon Jun 28, 2010 4:07 am
by DST
Okay here's a quick vid i threw together for you of the *fastest* way to make this stuff happen.

Welcome to Game Editor!!!


Re: How to make things shoot

PostPosted: Mon Jun 28, 2010 5:57 am
by GtcGaming
if you don't get his video. I'll tell you how I do it


Creat actor name it PlayerShot than -add anaimation-look in their data/your pictures for the shot. Now make sure you set the "on startup" to off now

Go to your spaceship. add event - key pressed down - creat actor - PlayerShot

Now your spaceship will shoot.

To make it where it kills the enemy:

on your shot you made go to add event- collision- Destory actor "what ever your enemy is"

This should work, if it doesn't tell me and i'll see what's wrong.

Re: How to make things shoot

PostPosted: Tue Jun 29, 2010 2:59 am
by ESL
Thanks to both of you. I understand how to do it now :wink:

Re: How to make things shoot

PostPosted: Tue Jun 29, 2010 3:25 am
by ESL
Well, sort of. Now it shoots once but the ship goes flying off screen too.

Re: How to make things shoot

PostPosted: Thu Jul 01, 2010 1:03 am
by ESL
On the video, I had trouble reading the script code for the Enemy actor.

I wrote: xvelocity=-10;
//-is opposite of player shot's direction

but it looks like there are dots or quotation marks. I can't quite read them because the font color is light blue.

Re: How to make things shoot

PostPosted: Thu Jul 01, 2010 3:43 am
by GtcGaming
Are you trying to get the enemy to shoot towards you? It should be yvelocity than. Y is for up and down and X is for side to side.

To make them move down you need to have them connected to "base_enemy" and have two sensors on both sides so if "enemy" touches it they will go "down" and "side to side"

I'm not sure how to do all this because I've been busy with learning c++.

Re: How to make things shoot

PostPosted: Fri Jul 02, 2010 2:39 am
by ESL
Yes, I want the enemy to shoot back. On 2:12 through 2:26 of the video, he shows a script but I am having trouble reading it because of the font color.

Re: How to make things shoot

PostPosted: Sat Jul 03, 2010 3:28 am
by krenisis
Ok 1st click the enemy bullet actor
Click on add// click on draw actor // click on script editor //
yvelocity=+10;

Ok now click on the enemy
click on add // click on create actor // click on create timer
a small windows pops up after you give it a name on the line below it type 250 . Now the go down to the line below that and erase the * symbol type 500. Now click on and go out of that.

Now for the last part click on the enemy again
click on add // click on timer // choose the timer you just made //
now add action // create actor // choose the enemy bullet and click ok

Now run you game and the enemies will be firing at you!!! enjoy

Re: How to make things shoot

PostPosted: Sat Jul 03, 2010 4:57 am
by Hblade
How to make things shoot

If you would like to make things shoot, you should first open up Global Code

    Global Code:
      Click variables
      Click Add
      Name the variable bul_spd
      click where it says Integer, and select "Real"
      Click where it says Global Variable, and click Actor variable
      Click Okay

Close global code now, and go to your bullet actor. On the bullet actor, add this code

    Create Actor
      Script Editor
      Code: Select all
      bul_spd = 12;
      xvelocity+=bul_spd;

bul_spd is an actor variable, so it can be set for every actor separately. Now, go to your actor that shoots the bullet.
    Key down
      Shoot key (Which ever key you chose, we will use Z in this case)
      Create Actor - Bullet actor
      And you should be good :D

ENEMY BULLET:
Do the same thing as the first one, only use this code at create actor instead :)
Code: Select all
bul_spd = 12;
xvelocity = -bul_spd;

This will actually make it -12, instead of 12. Thus making a shot hurdle towards the character xD I hope this fixed your issue ^.^

Re: How to make things shoot

PostPosted: Mon Jul 05, 2010 1:24 am
by ESL
Thanks! This helps a lot.

Re: How to make things shoot

PostPosted: Wed Jul 07, 2010 2:05 am
by ESL
I have the ship shooting but for the enemy ship, it says I have a script error




shottimer++;
if(shottimer==10)(CreateActor("planet_shot1", "shipShot", "(none)", "(none)", 0, 0, false);




shottimer=0;
>

Re: How to make things shoot

PostPosted: Wed Jul 07, 2010 2:19 am
by Hblade
use this not " ( " :D
Code: Select all
if (shottimer == 10)
{
    Create Actor - Do the rest
}

Re: How to make things shoot

PostPosted: Wed Jul 07, 2010 5:45 am
by krenisis
What complex coding we using here, for the enemy to shoot its very simple. Did you use the method I described?

Re: How to make things shoot

PostPosted: Thu Jul 08, 2010 4:06 am
by ESL
I understand the concepts pretty well. I am just having trouble reading the light blue font scripts because my room has too much light. I will try it again tonight when I have a dark room.