3 registered members (AndrewAMD, Ayumi, ozgur),
678
guests, and 7
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: Function called by Entity is terminated after Entity is removed?
[Re: EvilSOB]
#259229
04/04/09 21:04
04/04/09 21:04
|
Joined: Oct 2007
Posts: 5,210 İstanbul, Turkey
Quad
Senior Expert
|
Senior Expert
Joined: Oct 2007
Posts: 5,210
İstanbul, Turkey
|
void print_lol(){
while(1){
printf("lol\n");
wait(-.1);//print lol every 0.1 sec.
}
}
action remove_me(){
printf("ent_created");
print_lol();//-> you mean this stops too?
my.skill1=1000;
while(me){
my.skill1--;
if(my.skill1==0){
ent_remove(me);
printf("ent removed");
}
wait(1);
}
}
void main(){
video_screen = 0;//dont open video device
wait(1);
level_load("");
ent_create("cube.mdl",nullvector,remove_me);
}
yeah it stops... i demand explanation too.
3333333333
|
|
|
Re: Function called by Entity is terminated after Entity is removed?
[Re: EvilSOB]
#259230
04/04/09 21:06
04/04/09 21:06
|
Joined: Jan 2005
Posts: 605 Deutschland, NRW
garv3
OP
User
|
OP
User
Joined: Jan 2005
Posts: 605
Deutschland, NRW
|
Hopefully SOMEONE can answer this cause it doesnt make sense to me, but it would explain some odd behavious my actions sometimes give. Yeah, it makes absolutely no sense! I wonder why I've never been stuck with this before. And maybe this is kind of a bug. Anyway - this behaviour is not correct not to mention logical.
GameStudio Version: A7 Pro v7.86
|
|
|
Re: Function called by Entity is terminated after Entity is removed?
[Re: garv3]
#259488
04/06/09 13:32
04/06/09 13:32
|
Joined: Jan 2005
Posts: 605 Deutschland, NRW
garv3
OP
User
|
OP
User
Joined: Jan 2005
Posts: 605
Deutschland, NRW
|
Ok, here is some of the original code... The Action: action EoR_aktion(){
c_trace(vector(my.x+bauoptionen_gegner_scan_ausgangspunkt_gewaehlt[0],my.y+bauoptionen_gegner_scan_ausgangspunkt_gewaehlt[1],my.z+bauoptionen_gegner_scan_ausgangspunkt_gewaehlt[2]), vector(my.x+bauoptionen_gegner_scan_ausgangspunkt_gewaehlt[0],my.y+bauoptionen_gegner_scan_ausgangspunkt_gewaehlt[1],my.z-100), IGNORE_PUSH|IGNORE_ME|IGNORE_PASSABLE|IGNORE_SPRITES|IGNORE_CONTENT|USE_POLYGON);
PARTICLE* bodentextur = ent_decal (spielfeld, baustellen_boden_tga, my.einheiten_reichweite*2, 0);
my.einheiten_status = im_bau;
[...]
bodentextur_fuer_turm_steuern(bodentextur, me); //this line calls the function
[...]
EoR_mainFunktion(auge, balken1, balken2, balken3, balken4, balken5, balken6);
} And the function: function bodentextur_fuer_turm_steuern(PARTICLE* bodentextur, ENTITY* turm){
set(bodentextur, TRANSLUCENT);
bodentextur.alpha = 100;
while (turm){
bodentextur.lifespan = 16000;
wait(1);
}
// The code below this line will never be executed. The function is terminated if the entity is removed
debug1 = 1;
while(bodentextur.alpha > 0){
bodentextur.lifespan = 16000;
bodentextur.alpha -= time_step;
wait(1);
}
bodentextur.lifespan = 0;
} So may someone please tell me why?!
GameStudio Version: A7 Pro v7.86
|
|
|
Re: Function called by Entity is terminated after Entity is removed?
[Re: garv3]
#259491
04/06/09 13:51
04/06/09 13:51
|
Joined: Feb 2008
Posts: 3,232 Australia
EvilSOB
Expert
|
Expert
Joined: Feb 2008
Posts: 3,232
Australia
|
Hey garv, I reckon this needs bumping to bugs IMHO.
"There is no fate but what WE make." - CEO Cyberdyne Systems Corp. A8.30.5 Commercial
|
|
|
Re: Function called by Entity is terminated after Entity is removed?
[Re: EvilSOB]
#259494
04/06/09 14:08
04/06/09 14:08
|
Joined: Jan 2005
Posts: 605 Deutschland, NRW
garv3
OP
User
|
OP
User
Joined: Jan 2005
Posts: 605
Deutschland, NRW
|
I agree and will open a thread in the bug hunt section.
GameStudio Version: A7 Pro v7.86
|
|
|
|