Some script help..

Some script help..

I have obstacleX with

animationscript data/scripts/new_script.c
and caller
@cmd booms "bochka_kysok" 5 0 20 0


new_script.c is:

void booms(void kyski, int raz, int napravlenie, int razbros, int more1){
....
projectile(1,kyski, rand()%razbros, -20, rand()%razbros/2, 0, 0, 1, 0);
....
}


bochka_kysok.txt
is something with none type. And it has inside
changeentityproperty(vSelf, "jumpheight" , rand()%5+7);
changeentityproperty(vSelf, "speed" , rand()%3);



When i destroy obstacleX it spawning (via new_script.c) few projectiles (bochka_kysok) with random properties ("jumpheight" "speed"). Is the way to move script (changeentityproperty "jumpheight" "speed") from bochka_kysok.txt to new_script.c so it will be looking like this

void booms(void kyski, int raz, int napravlenie, int razbros, int more1){
....
projectile(1,kyski, rand()%razbros, -20, rand()%razbros/2, 0, 0, 1, 0);
projectile "jumpheight" = ..
projectile "speed" = ..
....
}

?
 
I hope I understand your question clearly  :)

FYI you can acquire entity handle from shot spawned by projectile function. With this handle, you can modify the shot's properties
Example (using your scripts):
Code:
void booms(void kyski, int raz, int napravlenie, int razbros, int more1){
  void shot;
   ....
   shot = projectile(1,kyski, rand()%razbros, -20, rand()%razbros/2, 0, 0, 1, 0);
   changeentityproperty(shot, "jumpheight" , rand()%5+7);
   changeentityproperty(shot, "speed" , rand()%3);
   ....
}

HTH
 
Back
Top Bottom