damage entity when text end

betterbold

Active member
Hi, I'm enjoy to make OpenBOR Mods. ;D

is it possible that damage entity (player or enemy) when text entity end ?

I think "Damage_all_enemies" script but it didn't work...
 
Vou can use a smartbomb for that or use the scripted version I use on my mod.

void damage_all_enemies(int damage, int drop, void atk_type, void vName, char sound)
//thanks Lagarto, Piccolo and White Dragon
{
int  iEntity;
        void vEntity;
        void self        = getlocalvar("self");
        int  iMax        = openborvariant("count_entities"); 
playSound("data/sounds/"+sound);

        for(iEntity=0; iEntity<iMax; iEntity++)
        {
        vEntity = getentity(iEntity);
float x = getentityproperty(vEntity, "x") - openborvariant("xpos");
float a = getentityproperty(vEntity, "a");
float z = getentityproperty(vEntity, "z");
void Spawn;
if(getentityproperty(vEntity, "type")==openborconstant("TYPE_enemy"))
{

clearspawnentry();
        setspawnentry("name", vName);
        setspawnentry("coords", x, z+1, a+30);
        spawn();
        clearspawnentry();
damageentity(vEntity,self,damage,drop,openborconstant(atk_type));

}
}
}

 
Thanks, O Ilusionista. :D I'll try it.

I should explain that I want to do.    Is there better way to do this?


*Preview video*
https://www.youtube.com/watch?v=2sjTnAK8i4Y
 
Hmmm... from my observation, the best entity to do the damage is the text entity. Since there are only two fighters in the field, you should be able to acquire both handles easily. For player you can acquire it directly with this:

Code:
    void P1 = getplayerproperty(0, "entity");

You can damage or do anything with player 1 after you got that
As for the other fighter, if he/she's another player you can use similar line like the above to get the other player. But if he/she's enemy or NPC, I highly suggest, he/she register himself/herself when he/she is spawned on the field. What I mean by register is storing his/her handle into a global variable or indexed variable like this:

Code:
  void self = getlocalvar("self");
  setglobalvar("Fighter2", self);

With these, cutscene entity could acquire both fighters' handle to do the damage after text ends

As for the blast wrestling part, that's another story ;)
 
@bloodbane
    Thanks for your advice !! :D
    Unfortunately, I'm not good at scripts.
   
    Should I edit "Damage_all_enemies" script,  if I follow your advice ?
 
Back
Top Bottom