How to make things shoot

Game Editor comments and discussion.

Re: How to make things shoot

Postby ESL » Thu Jul 08, 2010 4:16 am

It says

Error Line 9 Expected: (

I got this by hitting Shift , the number 9. Maybe it is not the right one?

Then, Warning line 9: Trying to convert from 'const int' to ' * struct '

Error line 9: Expected )
ESL
 
Posts: 96
Joined: Mon Jun 28, 2010 2:05 am
Score: 1 Give a positive score

Re: How to make things shoot

Postby Hblade » Thu Jul 08, 2010 6:15 am

lol, its not:
(

Its:
{

Same goes with the other one xD Its not
)
its
}
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4455
Joined: Fri Dec 08, 2006 11:14 pm
Score: 181 Give a positive score

Re: How to make things shoot

Postby ESL » Fri Jul 09, 2010 1:54 am

hehe

I fixed the bracket thing.

Now it says I have an error line 5 (where I have Create Actor)that it expects a semicolon

shottimer++;
if( shottimer=10)
{CreateActor} "words", "shipShot", "(none)", "(none)", 0, 0, false};
shottimer=0;
}

I don't understand because there is a semicolon
ESL
 
Posts: 96
Joined: Mon Jun 28, 2010 2:05 am
Score: 1 Give a positive score

Re: How to make things shoot

Postby jimmynewguy » Fri Jul 09, 2010 2:01 am

ESL wrote:shottimer++;
if( shottimer=10)
{CreateActor} "words", "shipShot", "(none)", "(none)", 0, 0, false};
shottimer=0;
}

all those red things are brackets where parentheses should go, brackets are used for (don't quote me on this) if/else/switch
cases
if(something)
{
brackets, see?
}
else
{

}
switch(a variable)
{
case 0:more brackets showing the start and finish of the script
break;
}
stuff like that, oh and when you make your own functions
void (sucha fucntion)
{
Brackets!
}
i hope that helps a lot, to be safe i would say parentheses are used A LOT more often :)
Working on a probably too ambitious project! Wild-west-adventure-RPG-shooter-thing.
User avatar
jimmynewguy
 
Posts: 1137
Joined: Sat Mar 31, 2007 6:27 pm
Score: 89 Give a positive score

Re: How to make things shoot

Postby Hblade » Fri Jul 09, 2010 2:03 am

Your code:
Code: Select all
if( shottimer=10)
{CreateActor} "words", "shipShot", "(none)", "(none)", 0, 0, false};
shottimer=0;
}


Change to:
Code: Select all
if(shottimer=10)
{
CreateActor("words", "shipShot", "(none)", "(none)", 0, 0, false);
shottimer=0;
}


Probably caused by:
    1
      if( shottimer=10)
      The spacing between the ( and shottimer.
    2
      CreateActor} "words", "shipShot", "(none)", "(none)", 0, 0, false};
      You used brackets for the create actor as well. Functions use "( and )", while if statements use brackets.
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4455
Joined: Fri Dec 08, 2006 11:14 pm
Score: 181 Give a positive score

Re: How to make things shoot

Postby ESL » Fri Jul 09, 2010 8:26 am

Using the ike you wrote it did the trick. Thanks!
ESL
 
Posts: 96
Joined: Mon Jun 28, 2010 2:05 am
Score: 1 Give a positive score

Re: How to make things shoot

Postby ESL » Sun Jul 11, 2010 9:45 am

It took me a few hours but I figured out that I had assigned the script to the shots instead of the shooter.
ESL
 
Posts: 96
Joined: Mon Jun 28, 2010 2:05 am
Score: 1 Give a positive score

Re: How to make things shoot

Postby Hblade » Sun Jul 11, 2010 11:51 am

:P
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4455
Joined: Fri Dec 08, 2006 11:14 pm
Score: 181 Give a positive score

Re: How to make things shoot

Postby Bee-Ant » Sun Jul 11, 2010 12:12 pm

Hblade wrote:Your code:
Code: Select all
if( shottimer=10)
{CreateActor} "words", "shipShot", "(none)", "(none)", 0, 0, false};
shottimer=0;
}


Change to:
Code: Select all
if(shottimer=10)
{
CreateActor("words", "shipShot", "(none)", "(none)", 0, 0, false);
shottimer=0;
}

It won't make any changes...
The problem is you should use == inside IF instead of =
So, I think the correct code is :
Code: Select all
if(shottimer==10)
{
    CreateActor("words", "shipShot", "(none)", "(none)", 0, 0, false);
    shottimer=0;
}
User avatar
Bee-Ant
 
Posts: 3723
Joined: Wed Apr 11, 2007 12:05 pm
Location: http://www.instagram.com/bee_ant
Score: 210 Give a positive score

Re: How to make things shoot

Postby Hblade » Sun Jul 11, 2010 12:56 pm

lol I didnt even notice the 1 = sign xD
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4455
Joined: Fri Dec 08, 2006 11:14 pm
Score: 181 Give a positive score

Re: How to make things shoot

Postby ESL » Tue Jul 13, 2010 2:11 am

How do you control the number of bullets that are fired? They are coming out in a steady stream and making one long dotted line.
ESL
 
Posts: 96
Joined: Mon Jun 28, 2010 2:05 am
Score: 1 Give a positive score

Re: How to make things shoot

Postby ESL » Wed Jul 14, 2010 4:44 am

Here is the file for my game. I want the planet to shoot words at the ship so the ship can destroy them.
Attachments
englishlearn.ged
(2.62 KiB) Downloaded 69 times
ESL
 
Posts: 96
Joined: Mon Jun 28, 2010 2:05 am
Score: 1 Give a positive score

Previous

Return to GE - General

Who is online

Users browsing this forum: No registered users and 1 guest