Difference between Target and Opponent

tightninja

Member
It seems "opponent" is the last entity hit correct?

Is "target" the entity about to be hit (within range of attack?
 
Is "target" the entity about to be hit (within range of attack?

Target is the current entity targeted by AI - meaning, which one it's applying movement logic to, whether that is seeking or evading depending on its setup.

Obviously meaningless for players, but does apply to homing projectiles.

Opponent is the last entity interacted with. That coukd be hitting, getting hit, or items you pick up.

DC
 
C:
void ani005(void vTar, void vAni, int iFrame){

     //ani005
     //Damon Vaughn Caskey
     //07/31/2007
     //
     //Change target entity to desired animation.
     //
     //vTar: Target entity (see vTar001 for settings).
     //vAni: Animation cosntant.
     //iFrame: Frame.

     void vSelf = getlocalvar("self"); //Get calling entity
     void vTarget = vTar001(vTar, vSelf); //Target. 

     changeentityproperty(vTarget, "animation", openborconstant(vAni)); //Switch to desired animation.
     changeentityproperty(vTarget, "animpos", iFrame); //Switch to desired frame.



So in this script or ones similar the "target" would be player or other entity. This would not function if used in a player entity file
 
C:
void ani005(void vTar, void vAni, int iFrame){

     //ani005
     //Damon Vaughn Caskey
     //07/31/2007
     //
     //Change target entity to desired animation.
     //
     //vTar: Target entity (see vTar001 for settings).
     //vAni: Animation cosntant.
     //iFrame: Frame.

     void vSelf = getlocalvar("self"); //Get calling entity
     void vTarget = vTar001(vTar, vSelf); //Target.

     changeentityproperty(vTarget, "animation", openborconstant(vAni)); //Switch to desired animation.
     changeentityproperty(vTarget, "animpos", iFrame); //Switch to desired frame.



So in this script or ones similar the "target" would be player or other entity. This would not function if used in a player entity file

You're confusing the engine's internal target property for entities with a local variable in a function. "Target" in this case just means target object for the function to act on, nothing more. I could have named it "have_a_nice_day" if I'd wanted to.

DC
 
Back
Top Bottom