|
Function called by Entity is terminated after Entity is removed?
#259112
04/03/09 22:40
04/03/09 22:40
|
Joined: Jan 2005
Posts: 605 Deutschland, NRW
garv3
OP
User
|
OP
User
Joined: Jan 2005
Posts: 605
Deutschland, NRW
|
Hi all!
I am calling a function from within an entity's action. In this function is a while loop that seems to be terminated, when the entity is being removed. Is this standard and if - how can I work around this problem?
Thx in advance! derGarv
GameStudio Version: A7 Pro v7.86
|
|
|
Re: Function called by Entity is terminated after Entity is removed?
[Re: garv3]
#259113
04/03/09 22:50
04/03/09 22:50
|
Joined: Apr 2006
Posts: 737 Ottawa, Canada
Ottawa
User
|
User
Joined: Apr 2006
Posts: 737
Ottawa, Canada
|
Hi! Can you make your entity invisible for the duration of the action. and Keep the entity until all of the action is done then you can remove it. Ottawa
|
|
|
Re: Function called by Entity is terminated after Entity is removed?
[Re: Ottawa]
#259114
04/03/09 23:17
04/03/09 23:17
|
Joined: Aug 2008
Posts: 218 U.S.
GamerX
Member
|
Member
Joined: Aug 2008
Posts: 218
U.S.
|
Yea it is standard when the entity is removed he is removed from his action. why not just call that function once from the action and put all the statements in the function in a while loop?
"You may never know what results come of your action, but if you do nothing there will be no result." -Mahatma Gandhi
|
|
|
Re: Function called by Entity is terminated after Entity is removed?
[Re: GamerX]
#259159
04/04/09 13:13
04/04/09 13:13
|
Joined: Jan 2005
Posts: 605 Deutschland, NRW
garv3
OP
User
|
OP
User
Joined: Jan 2005
Posts: 605
Deutschland, NRW
|
why not just call that function once from the action and put all the statements in the function in a while loop? That's what I did!
GameStudio Version: A7 Pro v7.86
|
|
|
Re: Function called by Entity is terminated after Entity is removed?
[Re: garv3]
#259161
04/04/09 13:35
04/04/09 13:35
|
Joined: Feb 2008
Posts: 3,232 Australia
EvilSOB
Expert
|
Expert
Joined: Feb 2008
Posts: 3,232
Australia
|
Inside the action, the ME pointer will empty, but unless your loop is something like while(me) it should stay running.
Can you post the action?
"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]
#259163
04/04/09 13:52
04/04/09 13:52
|
Joined: Jan 2005
Posts: 605 Deutschland, NRW
garv3
OP
User
|
OP
User
Joined: Jan 2005
Posts: 605
Deutschland, NRW
|
I am currently at work and for that do not have the code right here. But the function is something like... function doSomeStuff(ENTITY* ent){
while(ent){
// do something as logn as the entity exists
wait(1);
}
// do something else -> this is not performed!!!
} The action is very complex. But it just calls "doSomeStuff(me)" at the beginning!
GameStudio Version: A7 Pro v7.86
|
|
|
Re: Function called by Entity is terminated after Entity is removed?
[Re: garv3]
#259215
04/04/09 20:14
04/04/09 20:14
|
Joined: Jan 2005
Posts: 605 Deutschland, NRW
garv3
OP
User
|
OP
User
Joined: Jan 2005
Posts: 605
Deutschland, NRW
|
So this should work, right? But it definitely does not!
I hope someone can help me!
Thx in davance!
GameStudio Version: A7 Pro v7.86
|
|
|
Re: Function called by Entity is terminated after Entity is removed?
[Re: garv3]
#259224
04/04/09 20:49
04/04/09 20:49
|
Joined: Oct 2007
Posts: 5,210 İstanbul, Turkey
Quad
Senior Expert
|
Senior Expert
Joined: Oct 2007
Posts: 5,210
İstanbul, Turkey
|
that doesnt help, you need to post where exactly you call the function and function itself.
3333333333
|
|
|
Re: Function called by Entity is terminated after Entity is removed?
[Re: garv3]
#259225
04/04/09 20:54
04/04/09 20:54
|
Joined: Feb 2008
Posts: 3,232 Australia
EvilSOB
Expert
|
Expert
Joined: Feb 2008
Posts: 3,232
Australia
|
Umm, I dunno how to answer this but, TO ME, this should work but it dont. It seems that as soon as "ent" is removed, the entire action just aborts.
Ive even tried rolling back to 7.50 and it does the same, BUT ONLY WITH ENTITY related actions.... Hell they're not even actions, they are just functions.
Hopefully SOMEONE can answer this cause it doesnt make sense to me, but it would explain some odd behavious my actions sometimes give.
"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: Quad]
#259228
04/04/09 21:03
04/04/09 21:03
|
Joined: Jan 2005
Posts: 605 Deutschland, NRW
garv3
OP
User
|
OP
User
Joined: Jan 2005
Posts: 605
Deutschland, NRW
|
that doesnt help, you need to post where exactly you call the function and function itself. Well, that does not make any sense! From where within the action I call the function does not have ANY effect at all! And to be precise: Even if I call it in the first line of the action, the behaviour is the same. And if you want the function - here it is: function bodentextur_fuer_turm_steuern(PARTICLE* bodentextur, ENTITY* turm){
set(bodentextur, TRANSLUCENT);
bodentextur.alpha = 100;
while (turm){
bodentextur.lifespan = 16000;
wait(1);
}
debug1 = 1;
while(bodentextur.alpha > 0){
bodentextur.lifespan = 16000;
bodentextur.alpha -= time_step;
wait(1);
}
bodentextur.lifespan = 0;
} debug1 is never set to 1 !!! I am really frustrated...
GameStudio Version: A7 Pro v7.86
|
|
|
|