Spawning enemy above minz

ABK

Well-known member
I want to give enemy spawn animation so he walks in from higher part of the screen (from doors) but that part is above minz and when i spawn him there then he's not displayed on stage because hes above minz and hes displayed on background so hes invisible cause my panel covers entire screen, any workaround for this ? I want to see him when he walks out the doors but minz is a problem, i tried to set subject to minz 0 and it doesnt really help with it, it just lets enemy to walk higher and he still disappears so minz is kinda still active.
 
I made those scripts to control where my enemies should be able to pass or not the min z/max z

void maxZ (int iZ)
{
void self = getlocalvar("self");
int z = getentityproperty(self,"z"); //Get character's z coordinate
changeentityproperty(self, "subject_to_maxz", iZ);
}

void minZ (int iZ)
{
void self = getlocalvar("self");
int z = getentityproperty(self,"z"); //Get character's z coordinate
changeentityproperty(self, "subject_to_minz", iZ);
}

I use this to make them be able to move freely
@cmd maxZ 0
@cmd minZ 0

and I need to set it back later
@cmd maxZ 1
@cmd minZ 1

To avoid problems, I spawn it on a follow anim and reproduce the walk anim there.
I have a script to detect if his Z position is bigger than min Z and it set it to subject_to_minz again
 
That's strange bWWd, I can make enemies walk out of door with no problem. I set subject_to_minz 0 as default settings and set it back to 1 with script after the action is done
 
I ended up using wall.
I have another problem with didhitscript, it doesnt play the sound, i want item to play different sound depends who collects it but checking name doesnt work and it doesnt play anything.Name is matching character.


Code:
void main()
{
  void self = getlocalvar("self");
 	void opp = getentityproperty(self, "opponent");
	void nam = getentityproperty(opp,"defaultname");
     int iSnd = loadsample("data/chars/jf/pizza.wav");
if (nam == "he-man"){

    playsample(iSnd, 0, openborvariant("effectvol"), openborvariant("effectvol"), 100, 0); //Get Item SFX
}
}
 
and if you change "opponent" for "damagetaker" ?
I remember some cases where "opponent" has bugs, like this http://www.chronocrash.com/forum/index.php?topic=1465.msg16957#msg16957

And for didhit:
didhitscript
Entity's hits another entity normally, or entity is an item type being retrieved.
self: Caller.
damagetaker: Recipient of attack or item.
damage: attack damage.
"drop: knockdown power.
attacktype: attack type, see 'openborconstant'.
noblock: block break force of attack.
guardcost: Guardcost of attack.
jugglecost: Jugglecost of attack.
pauseadd: Pause value of attack.
blocked: Receiving entity did (1) or did not (0) block attack.
 
Thanks! This worked:
void main()
{

  void self = getlocalvar("self");
void opp = getlocalvar("damagetaker");
void nam = getentityproperty(opp,"defaultname");
    int iSnd = loadsample("data/chars/jf/pizza.wav");
if (nam == "justin"){

    playsample(iSnd, 0, openborvariant("effectvol"), openborvariant("effectvol"), 100, 0); //Get Item SFX
}
}
 
Back
Top Bottom