Player picks up weapon - item entity for the weapon disappears once GET anim is played and all is good - now im binding that picked up weapon to the player , the issue is - i cant do it from frame 0 cause it most of the time is not appearing, its the nasty frame 0 "bug" .
Some people know it, some say it does not exist and its not a bug( cause of how animationscripts are updated just once per frame but somehow first frame is not properly updated on init ), id say it is very very true issue even if its supposed to be like this and i had to give up a lot of mechanics in games because of it.
So what are Your workarounds for this? I tried very long delays on frame 0 , very short delays on frame 0 - nothing, sometimes binded entity is just not spawned, it must be on frame 1.
Because of this - i have a blink, where picked up weapon disappears, and if its big enough , it is pretty noticeable.
How to solve this ? By turning animationscripts to inline ?
So absolute fastest way to spawn it is with if ( har == NULL() ) but it still does the blink, even if delay is 1
Another way that would save me - having DEATH animation in item entity, so after i pickup item - its DEATH animation is played while player plays his GET animation. But is that even doable ? No info on how to trigger DEATH with item objects on pickup. Sure- i can spawn a clone, but no, i dont want to cause i plan to do a lot more weapons like this and it will be ton of clones of clones just for displaying one frame for milisecond.
Some people know it, some say it does not exist and its not a bug( cause of how animationscripts are updated just once per frame but somehow first frame is not properly updated on init ), id say it is very very true issue even if its supposed to be like this and i had to give up a lot of mechanics in games because of it.
So what are Your workarounds for this? I tried very long delays on frame 0 , very short delays on frame 0 - nothing, sometimes binded entity is just not spawned, it must be on frame 1.
Because of this - i have a blink, where picked up weapon disappears, and if its big enough , it is pretty noticeable.
How to solve this ? By turning animationscripts to inline ?
So absolute fastest way to spawn it is with if ( har == NULL() ) but it still does the blink, even if delay is 1
Another way that would save me - having DEATH animation in item entity, so after i pickup item - its DEATH animation is played while player plays his GET animation. But is that even doable ? No info on how to trigger DEATH with item objects on pickup. Sure- i can spawn a clone, but no, i dont want to cause i plan to do a lot more weapons like this and it will be ton of clones of clones just for displaying one frame for milisecond.
Code:
anim get
loop 0
offset 92 309
bbox none
@script
void self = getlocalvar("self");
void har;
if ( frame == 1 ){
clearspawnentry();
setspawnentry("name", "drumbind");
har = spawn();
setentityvar(self, 0, har); // Store 'har' in an entityvar of 'self'
bindentity(har, self, 30, 0, 0, -1, 6,1);
}
if ( frame == 3 ){
bindentity(har, self, 0, 0, 20, -1, 6,1 );
}
if ( frame == 4 ){
bindentity(har, self, -10, 0, 80, -1, 6,1 );
}
if ( frame == 5 ){
bindentity(har, self, -20, 0, 200,-1, 6,1 );
}
if ( frame == 6 ){
bindentity(har, self, -35, 0, 280,-1, 6,-1 );
}
@end_script
delay 2
alphamask data/chars/heman/get_001-mask.png
frame data/chars/heman/get_001.png
delay 7
alphamask data/chars/heman/get_002-mask.png
frame data/chars/heman/get_002.png
alphamask data/chars/heman/get_003-mask.png
frame data/chars/heman/get_003.png
alphamask data/chars/heman/get_004-mask.png
frame data/chars/heman/get_004.png
alphamask data/chars/heman/get_005-mask.png
frame data/chars/heman/get_005.png
alphamask data/chars/heman/get_006-mask.png
frame data/chars/heman/get_006.png
alphamask data/chars/heman/get_007-mask.png
frame data/chars/heman/get_007.png
Last edited: