repeating+Adding on script looks impossible?!
I tried some things, with the "cannon" Entity. (custom)
I tried to make it shoot cannonballs, each 3 seconds.
with the script:
void BallShoot(string &in asTimer)
{
PlayGuiSound("break_wood_metal", 3);
CreateEntityAtArea("Ball_+i", "cannonball.ent", "Ball_Shoot", true);
AddPropForce("Ball_+i", 0, 0, -1000000, "world");
CreateParticleSystemAtEntity("", "ps_hit_rock.ps", "Ball_Shoot", true);
AddTimer("", 3,"BallShoot");
}
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)
I want those things to happen:
PlayGuiSound("break_wood_metal", 3);
CreateEntityAtArea("Ball_+i", "cannonball.ent", "Ball_Shoot", true);
AddPropForce("Ball_+i", 0, 0, -1000000, "world");
CreateParticleSystemAtEntity("", "ps_hit_rock.ps", "Ball_Shoot", true);
The problem:
Let's say the entity is called "Ball" instead of Ball_+i
CreateEntityAtArea("Ball", "cannonball.ent", "Ball_Shoot", true);
AddPropForce("Ball", 0, 0, -1000000, "world");
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....
|