Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
0 registered members (), 947 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
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
G
garv3 Offline OP
User
garv3  Offline OP
User
G

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
O
Ottawa Offline
User
Ottawa  Offline
User
O

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 smile

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 Offline
Member
GamerX  Offline
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
G
garv3 Offline OP
User
garv3  Offline OP
User
G

Joined: Jan 2005
Posts: 605
Deutschland, NRW
Originally Posted By: GamerX
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 Offline
Expert
EvilSOB  Offline
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
G
garv3 Offline OP
User
garv3  Offline OP
User
G

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...
Code:
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
G
garv3 Offline OP
User
garv3  Offline OP
User
G

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 Offline
Senior Expert
Quad  Offline
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 Offline
Expert
EvilSOB  Offline
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
G
garv3 Offline OP
User
garv3  Offline OP
User
G

Joined: Jan 2005
Posts: 605
Deutschland, NRW
Originally Posted By: Quadraxas
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:
Code:
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
Page 1 of 2 1 2

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1