So, what I want, is it creates a Ball, and do some effects.
The problem is, It is called " Ball "
And you need a name for Addpropforce, so I use " Ball " Ofcourse, but the effect is repeating, everytime it creates a new cannonball, the cannonball will have another name, since it is not possible to have 2 entities with the same name.
No, the problem is, if I open the map, It shoots the cannonball (With propforce) and does all the other effects, but after 3 seoconds, it shoots the ball, everything happen EXCEPT addpropforce, meaning the ball just fall down.
How can I make the ball use the "addpropforce" for the whole time..
Quick Explain:
I want a cannon that shoots a cannonball. (repeats after every 3 sec)
So, at the first shot of the cannon.
What happens? It creates an entity, called "Ball".
Then, Addpropforce, will Push the heck out of "Ball".
And this needs to repeat after 3 seconds.
BUT then, it creater a "Ball" again, but it is not possible to have 2 entities with the same name, so it creates *I think* "Ball_1" Or something like that, and THEN (this is where the problem comes)
The Addpropforce will add prop force to "Ball"...
So I need to make Addpropforce work with CreateEntityAtArea....
but if you make an area with An AddEntityCollideCallback and you say at the cannon:
if the area matches with the cannon what should you do?
create the timer inside the block:
void OnStart()
{
AddEntityCollideCallback("", "cannon", "cannonshootArea", "ShootCannon", false);
}
void ShootCannon(string &in asParent, string &in asChild, int alState)
{
//inside this block you put the timerScript with a name
}
void exTimer(string &in asTimer)
{
if(asTimer=="name")
//AddPropForceScript
//Timer as the ball is turning off
if(asTimer=="name2")
{
//disable ball
//turn off the PropForce put as the coordinates as the cannon
//timer active the ball
}
if (asTimer=="Timeractiveball")
//SetEntityActive("ball", true);
//regive back the addPropForce
//reloop timer1
}
I tried to give a Hint but I think that is all you want(sorry for my bad english)
In this simple 3 line pseudocode, it creates a ball starting at one until nine, each being called ball_1, ball_2 etc. Because I have the +i and the For Loop, then we have declared what "i" should be.
Be careful as well when it comes to performance. While a cannonball is just a round, low quality object, having many of them can be pretty draining.
Discord: Romulator#0001
(This post was last modified: 05-21-2015, 12:34 AM by Romulator.)