"proximity mine", plow, "fat" enemy

oldyz

Well-known member
hello, these 3 seem to require either an "spherical" or cubic range of detection, but from what i see on the manual,

if you use:

      range  150 160
      rangez  150 160
      rangea  150 160
      rangeb  150 160

that does not seem to be the case, its the other way around, the entity will only do the animation if these very Very specific coordinates are met

using        range  150 160
only works when you align yourself exactly to the entity's X , it would help if the entity was "fat" & tall like a wall, that way any point along the X range would work...

either way i'm stuck, i cant make this entity react like a proximity mine or cubic mine
 
this is the closest thing to what im looking for, but i cant figure out how to use it...
Bloodbane said:
Instead of correcting that script, I'll show you the function I usually use:

void attack1(int RxMin, int RxMax, int Rz, void Ani)
{// Attack interruption with range check
    void self = getlocalvar("self");
    void target = findtarget(self); //Get nearest player
    float x = getentityproperty(self, "x");
    float z = getentityproperty(self, "z");
    int dir = getentityproperty(self, "direction");

    if(target!=NULL()){
      float Tx = getentityproperty(target, "x");
      float Tz = getentityproperty(target, "z");
      float Disx = Tx - x;
      float Disz = Tz - z;

      if(Disz < 0){
        Disz = -Disz;
      }

      if( Disx >= RxMin && Disx <= RxMax && Disz <= Rz && dir == 1) // Target within range on right facing?
      {
        performattack(self, openborconstant(Ani)); //Change the animation
      } else if( Disx >= -RxMax && Disx <= -RxMin && Disz <= Rz && dir == 0) // Target within range on left facing?
      {
        performattack(self, openborconstant(Ani)); //Change the animation
      }
    }
}

Usage example:

@cmd attack1 240 2000 100 "ANI_FOLLOW1"
 
that does not seem to be the case, its the other way around, the entity will only do the animation if these very Very specific coordinates are met

Well of course, with 4 ranges set, opponent will have to be inside very small area to be detected (around 10x10x10 pixels cubic). Why are you using 4 range commands at once and with very small detection area?

Back to proximity mine topic, attack1 function can be used for mines however it ignores opponent's altitude. If you don't mind the mine to ignore altitude, use attack1 function
Otherwise, you'd need to use other function which checks altitude difference also

Do you know how to use script function in animation?
 
Bloodbane

very little, i can deduce some things from time time & do trial & error.

using the code above as an @script thing did not seem to work....

I did figure out how to make the entity "fatter" , but now i have a problem, it seems that the thing im making will not work all that great if i cant figure a way for it to ignore players 2,3 & 4 , unless player one is gone, & then there is the issue of what happens if player 1 ree-spawns....

the solution would be for this thing to detect a modified "panel" or NPC entity, or find a way to script this thing to detect the panel entity's unique name, or just that particular NPC....
 
I asked cause that function requires animationscript before it can be called to be used

The function is declared like this:
Code:
	@cmd	attack1 70 150 15 "ANI_FOLLOW2"

This function will change animation to FOLLOW2 if opponent is found within x > 70 pixels and x < 150 pixels in front and within 15 pixels in z axis

However that function only checks distance and ignores opponent's size. It can be modified to check size also but that might require extra work

it seems that the thing im making will not work all that great if i cant figure a way for it to ignore players 2,3 & 4 , unless player one is gone, & then there is the issue of what happens if player 1 ree-spawns....

I'm not sure what you are making there however I suggest it shouldn't be player specific
If it has to be player specific, I'm gonna need to ask what actually you are making here
 
does your mine is set on the senter offset and you want to detonate only when very close? if that is the case i think those range coord could be wrong, is it a ground mine or a floating one?
if i am correct -5 10 for both range and rangez should work, rangea and rangeb values depend on what kind of mine it is. i may be misinterpreting you problem but i dont andurstend why would you need script for this,  the mine is an enmy type entity right? unles it has set antigravity or subject to gravity, normal range/z commands should be suficient.
 
Back
Top Bottom