Page 2 of 2

Re: How to make things shoot

PostPosted: Thu Jul 08, 2010 4:16 am
by ESL
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 )

Re: How to make things shoot

PostPosted: Thu Jul 08, 2010 6:15 am
by Hblade
lol, its not:
(

Its:
{

Same goes with the other one xD Its not
)
its
}

Re: How to make things shoot

PostPosted: Fri Jul 09, 2010 1:54 am
by ESL
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

Re: How to make things shoot

PostPosted: Fri Jul 09, 2010 2:01 am
by jimmynewguy
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 :)

Re: How to make things shoot

PostPosted: Fri Jul 09, 2010 2:03 am
by Hblade
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.

Re: How to make things shoot

PostPosted: Fri Jul 09, 2010 8:26 am
by ESL
Using the ike you wrote it did the trick. Thanks!

Re: How to make things shoot

PostPosted: Sun Jul 11, 2010 9:45 am
by ESL
It took me a few hours but I figured out that I had assigned the script to the shots instead of the shooter.

Re: How to make things shoot

PostPosted: Sun Jul 11, 2010 11:51 am
by Hblade
:P

Re: How to make things shoot

PostPosted: Sun Jul 11, 2010 12:12 pm
by Bee-Ant
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;
}

Re: How to make things shoot

PostPosted: Sun Jul 11, 2010 12:56 pm
by Hblade
lol I didnt even notice the 1 = sign xD

Re: How to make things shoot

PostPosted: Tue Jul 13, 2010 2:11 am
by ESL
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.

Re: How to make things shoot

PostPosted: Wed Jul 14, 2010 4:44 am
by ESL
Here is the file for my game. I want the planet to shoot words at the ship so the ship can destroy them.