SOLVED Entity that does not disappear with death

Toranks

Active member
See on minute 20:08. When I fall with the demolition machine and die, the balls are still "alive" and following me. The machine has a lifespan of 39, but the balls do not. However, if I try to add a 39 lifespan via script, they appear motionless and crooked instead of moving as usual. Any ideas how to fix this?
The balls is an entity without lifespan, and I cannot create it with the lifespan at 39 by default, it must be via script.
Thanks!

This is the animation that acts as a spawn of the balls:
Code:
anim	follow1
@script
if(frame==1)
{
  changeentityproperty(getlocalvar("self"), "type", openborconstant("TYPE_OBSTACLE"));
}
@end_script
	loop	0
	delay	15
	offset	175 540
	bbox	0 0 0 0
	frame	data/chars/3jackballs/steelatk08.gif
	frame	data/chars/3jackballs/steelatk08.gif
	frame	data/chars/3jackballs/steelatk08.gif
	frame	data/chars/3jackballs/steelatk08.gif
	@cmd	beidle
	frame	data/chars/3jackballs/steelatk08.gif

This is the code that I have tested. All cause the balls to become immobile and crooked, as in the attached image

Code:
[...]
	bbox	0 0 0 0
	@cmd	lifesp 39
	frame	data/chars/3jackballs/steelatk08.gif
[...]

[...]
anim	follow1
@script
void self = getlocalvar("self");
if(frame==1)
{
  changeentityproperty(getlocalvar("self"), "type", openborconstant("TYPE_OBSTACLE"));
  changeentityproperty(self, "lifespancountdown", 39);
}
@end_script
[...]

[...]
anim	follow1
@script
if(frame==1)
{
  changeentityproperty(getlocalvar("self"), "type", openborconstant("TYPE_OBSTACLE"));
  changeentityproperty(getlocalvar("self"), "lifespancountdown", 39);
}
@end_script
[...]
 

Attachments

  • AOF - 0070.png
    AOF - 0070.png
    218.4 KB · Views: 7
I think you set lifespan wrong

Code:
changeentityproperty(self, "lifespancountdown", 39);

That script will set 39 centiseconds lifespan instead of 39 seconds
So when that script is ran, the balls dies and become motionless

However, judging from the problem, the real issue is how the balls are linked to Jack. I don't understand why it has to be an entity which acts seperately from Jack.

I'm going to suggest binding the balls to Jack but before that can you explain what the balls does?
 
The demolition machine itself has a "lifespan 39" on the header. Is lifespan different in the header than via script?
The balls do nothing, they are just for decoration
 
LOL you are right! Lifespancoundown of 4600 aprox solves the problem!

Why is "lifespan 39" on the header 39 seconds, but "lifespancountdown", 39); is 39 centiseconds? 😹
 
Toranks said:
Why is "lifespan 39" on the header 39 seconds, but "lifespancountdown", 39); is 39 centiseconds? 😹

Simple, because text commands are often not the "real" values. They are converted to the real value when a model loads. This is meant to make the text files simple to use (I think it just causes confusion, but they have to be left as is for backward compatibility, future commands aren't this way).

When you use script, you are working directly with the real values OpenBOR uses.

DC
 
Back
Top Bottom