I want to bind entity and binding works when i bind in spawn animation but when i clone spawn animation and rename it follow4 - it does not work, entity is bind but is invisible and weird glitches happen like spawned objects dont display all frames... so maybe its some aiflag in spawn that is missing in follow4 ? I dont really want to use spawn and it was a placeholder, i just want to make follow4 to act normal - like spawn where bind works fine.
Anim follow3 detects if orc is near - when it is then it goes to follow4
Now follow4 is identical to spawn but only spawn properly binds entity, in follow4 i put debug info and it looks like its "kinda" spawn but its not visible cause i do not get empty in text debug but i do not see the bind orcsit entity .
So the real question is, why follow4 does not act like spawn where it all works fine and binds fine, how do i make aiflags for follow4 to make it work like spawn, i dont see aiflag spawning , what aiflags are set in spawn animation ? I dont say that it will fix it but wanna try , what else i can try ?
what is interesting that this also works so looks like spawn is resetting some flags or something ?
How i can do that manually ? Animation before follow3 was rise , so maybe its some fall flags that were not reset in follow4 ?
Anim follow3 detects if orc is near - when it is then it goes to follow4
Code:
anim FOLLOW3
loop 9 11
offset 362 264
bbox 0 0 0 0
delay 8
@script
void self = getlocalvar("self");
float x = getentityproperty(self, "x");
float z = getentityproperty(self, "z");
void vEntity; // Target entity placeholder.
int iEntity; // Entity enumeration holder.
int iName; // Entity name.
int iMax = openborvariant("ent_max"); // Entity count.
float Tx;
float Tz;
float Disx;
float Disz;
settextobj(2, 220 , 270 , 0, -1, getentityvar(self, "myRider"), openborvariant("elapsed_time")+70);
if(frame == 1 ){
setentityvar(self, "myRider", NULL());
}
if(frame == 11) {
// Enumerate and loop through entity collection.
for(iEntity = 0; iEntity < iMax; iEntity++) {
vEntity = getentity(iEntity); // Get target entity from current loop.
iName = getentityproperty(vEntity, "name"); // Get target name.
// Match against "gobag"
if(iName == "orc" && vEntity != self) {
Tx = getentityproperty(vEntity, "x");
Tz = getentityproperty(vEntity, "z");
Disx = Tx - x;
Disz = Tz - z;
if((Disx >= -40 && Disx <= 40) && (Disz >= -30 && Disz <= 30)) {
settextobj(1, 220 , 220 , 0, -1, "STAND", openborvariant("elapsed_time")+70);
changeentityproperty(self, "animation", openborconstant("ANI_FOLLOW4"));
}
}
}
}
@end_script
alphamask data/chars/dino/rise_009-mask.png
frame data/chars/dino/rise_009.png
alphamask data/chars/dino/rise_008-mask.png
frame data/chars/dino/rise_008.png
alphamask data/chars/dino/rise_007-mask.png
frame data/chars/dino/rise_007.png
alphamask data/chars/dino/rise_006-mask.png
frame data/chars/dino/rise_006.png
alphamask data/chars/dino/rise_005-mask.png
frame data/chars/dino/rise_005.png
alphamask data/chars/dino/rise_004-mask.png
frame data/chars/dino/rise_004.png
alphamask data/chars/dino/rise_003-mask.png
frame data/chars/dino/rise_003.png
alphamask data/chars/dino/rise_002-mask.png
frame data/chars/dino/rise_002.png
alphamask data/chars/dino/rise_001-mask.png
frame data/chars/dino/rise_001.png
alphamask data/chars/dino/rise_000-mask.png
frame data/chars/dino/rise_000.png
alphamask data/chars/dino/rise_000-mask.png
frame data/chars/dino/rise_000.png
alphamask data/chars/dino/rise_000-mask.png
frame data/chars/dino/rise_000.png
alphamask data/chars/dino/rise_000-mask.png
frame data/chars/dino/rise_000.png
Now follow4 is identical to spawn but only spawn properly binds entity, in follow4 i put debug info and it looks like its "kinda" spawn but its not visible cause i do not get empty in text debug but i do not see the bind orcsit entity .
Code:
anim spawn
loop 0
offset 307 269
bbox 131 59 331 211
delay 6
@cmd setentityvar getlocalvar("self") "frozen" NULL()
@script
void self = getlocalvar("self");
void rider = getentityvar(self, "myRider");
if(rider == NULL()) {
clearspawnentry();
setspawnentry("name", "orcsit");
rider = spawn();
setentityvar(self, "myRider", rider); }
rider = getentityvar(self, "myRider");
if(rider != NULL()) {
if(frame == 1) { bindentity(rider, self, 0, 0, 66, 1, 6, 1); }
if(frame == 2) { bindentity(rider, self, 0, 0, 65, 1, 6, 1); }
if(frame == 3) { bindentity(rider, self, 0, 0, 64, 1, 6, 1); }
if(frame == 4) { bindentity(rider, self, 0, 0, 63, 1, 6, 1); }
if(frame == 5) { bindentity(rider, self, 0, 0, 62, 1, 6, 1); }
if(frame == 6) { bindentity(rider, self, 0, 0, 61, 1, 6, 1); }
if(frame == 7) { bindentity(rider, self, 0, 0, 61, 1, 6, 1); }
if(frame == 8) { bindentity(rider, self, 0, 0, 62, 1, 6, 1); }
if(frame == 9) { bindentity(rider, self, 0, 0, 63, 1, 6, 1); }
if(frame == 10) { bindentity(rider, self, 0, 0, 64, 1, 6, 1); }
if(frame == 11) { bindentity(rider, self, 0, 0, 65, 1, 6, 1); }
if(frame == 12) { bindentity(rider, self, 0, 0, 66, 1, 6, 1); }
if(frame == 13) { bindentity(rider, self, 0, 0, 67, 1, 6, 1); }
}
@end_script
alphamask data/chars/dino/idle_000-mask.png
frame data/chars/dino/idle_000.png
alphamask data/chars/dino/idle_001-mask.png
frame data/chars/dino/idle_001.png
alphamask data/chars/dino/idle_002-mask.png
frame data/chars/dino/idle_002.png
alphamask data/chars/dino/idle_003-mask.png
frame data/chars/dino/idle_003.png
alphamask data/chars/dino/idle_004-mask.png
frame data/chars/dino/idle_004.png
alphamask data/chars/dino/idle_005-mask.png
frame data/chars/dino/idle_005.png
alphamask data/chars/dino/idle_006-mask.png
frame data/chars/dino/idle_006.png
alphamask data/chars/dino/idle_007-mask.png
frame data/chars/dino/idle_007.png
alphamask data/chars/dino/idle_008-mask.png
frame data/chars/dino/idle_008.png
alphamask data/chars/dino/idle_009-mask.png
frame data/chars/dino/idle_009.png
alphamask data/chars/dino/idle_010-mask.png
frame data/chars/dino/idle_010.png
alphamask data/chars/dino/idle_011-mask.png
frame data/chars/dino/idle_011.png
alphamask data/chars/dino/idle_012-mask.png
frame data/chars/dino/idle_012.png
alphamask data/chars/dino/idle_013-mask.png
frame data/chars/dino/idle_013.png
anim follow4
loop 0
offset 307 269
bbox 131 59 331 211
delay 6
@cmd setentityvar getlocalvar("self") "frozen" NULL()
@script
void self = getlocalvar("self");
void rider = getentityvar(self, "myRider");
if(rider == NULL()) {
clearspawnentry();
setspawnentry("name", "orcsit");
rider = spawn();
setentityvar(self, "myRider", rider); }
rider = getentityvar(self, "myRider");
if(rider != NULL()) {
if(frame == 1) { bindentity(rider, self, 0, 0, 66, 1, 6, 1); }
if(frame == 2) { bindentity(rider, self, 0, 0, 65, 1, 6, 1); }
if(frame == 3) { bindentity(rider, self, 0, 0, 64, 1, 6, 1); }
if(frame == 4) { bindentity(rider, self, 0, 0, 63, 1, 6, 1); }
if(frame == 5) { bindentity(rider, self, 0, 0, 62, 1, 6, 1); }
if(frame == 6) { bindentity(rider, self, 0, 0, 61, 1, 6, 1); }
if(frame == 7) { bindentity(rider, self, 0, 0, 61, 1, 6, 1); }
if(frame == 8) { bindentity(rider, self, 0, 0, 62, 1, 6, 1); }
if(frame == 9) { bindentity(rider, self, 0, 0, 63, 1, 6, 1); }
if(frame == 10) { bindentity(rider, self, 0, 0, 64, 1, 6, 1); }
if(frame == 11) { bindentity(rider, self, 0, 0, 65, 1, 6, 1); }
if(frame == 12) { bindentity(rider, self, 0, 0, 66, 1, 6, 1); }
if(frame == 13) { bindentity(rider, self, 0, 0, 67, 1, 6, 1); }
}
@end_script
alphamask data/chars/dino/idle_000-mask.png
frame data/chars/dino/idle_000.png
alphamask data/chars/dino/idle_001-mask.png
frame data/chars/dino/idle_001.png
alphamask data/chars/dino/idle_002-mask.png
frame data/chars/dino/idle_002.png
alphamask data/chars/dino/idle_003-mask.png
frame data/chars/dino/idle_003.png
alphamask data/chars/dino/idle_004-mask.png
frame data/chars/dino/idle_004.png
alphamask data/chars/dino/idle_005-mask.png
frame data/chars/dino/idle_005.png
alphamask data/chars/dino/idle_006-mask.png
frame data/chars/dino/idle_006.png
alphamask data/chars/dino/idle_007-mask.png
frame data/chars/dino/idle_007.png
alphamask data/chars/dino/idle_008-mask.png
frame data/chars/dino/idle_008.png
alphamask data/chars/dino/idle_009-mask.png
frame data/chars/dino/idle_009.png
alphamask data/chars/dino/idle_010-mask.png
frame data/chars/dino/idle_010.png
alphamask data/chars/dino/idle_011-mask.png
frame data/chars/dino/idle_011.png
alphamask data/chars/dino/idle_012-mask.png
frame data/chars/dino/idle_012.png
alphamask data/chars/dino/idle_013-mask.png
frame data/chars/dino/idle_013.png
So the real question is, why follow4 does not act like spawn where it all works fine and binds fine, how do i make aiflags for follow4 to make it work like spawn, i dont see aiflag spawning , what aiflags are set in spawn animation ? I dont say that it will fix it but wanna try , what else i can try ?
what is interesting that this also works so looks like spawn is resetting some flags or something ?
How i can do that manually ? Animation before follow3 was rise , so maybe its some fall flags that were not reset in follow4 ?
Code:
if((Disx >= -40 && Disx <= 40) && (Disz >= -30 && Disz <= 30)) {
settextobj(1, 220 , 220 , 0, -1, "STAND", openborvariant("elapsed_time")+70);
changeentityproperty(self, "animation", openborconstant("ANI_SPAWN"));
changeentityproperty(self, "animation", openborconstant("ANI_FOLLOW4"));
}
