Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
0 registered members (), 18,561 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
action lifetime #406746
08/28/12 15:10
08/28/12 15:10
Joined: Apr 2006
Posts: 159
Latvija
Arrovs Offline OP
Member
Arrovs  Offline OP
Member

Joined: Apr 2006
Posts: 159
Latvija
Hello mates.
Im not absolutely sure on one thing so i vish to hear your opinions and experience.
So after some tests i start to think, vhen model is deleted its action permanently deletes too so not letting it to execute some important lines.

Small example:
Code:
action darbiba()
{
//some initialization here
STRING* stringulio = str_create("blablabla");
while(my != NULL)
{
//do something here
wait(1);
}
//and here is some thing deleting
ptr_remove(stringulio);
}



So hov you see cycle vorks vhen model exists, but vhen its not anymore it should delete string, but it dont happens for me - so i decided about proccess vhat i said in first paragraph.
I think this vorked in c-script.


Arrovs once will publish game
Re: action lifetime [Re: Arrovs] #406752
08/28/12 19:06
08/28/12 19:06
Joined: Jan 2002
Posts: 4,225
Germany / Essen
Uhrwerk Offline
Expert
Uhrwerk  Offline
Expert

Joined: Jan 2002
Posts: 4,225
Germany / Essen
"my" or "me" will never get NULL until you explicitely set it to NULL and hence ptr_remove will never be called. The action will be terminated as soon as the corresponding entity gets removed.


Always learn from history, to be sure you make the same mistakes again...
Re: action lifetime [Re: Uhrwerk] #406759
08/28/12 22:03
08/28/12 22:03
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
Code:
action darbiba()
{
   STRING* stringulio = str_create("blablabla");
   //
   while(my != NULL)
   {
      //do something here
      //
      proc_mode=PROC_GLOBAL;     //this line must run EVERY loop before wait
      wait(1);
   }
   //
   ptr_remove(stringulio);
}



"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial

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

Gamestudio download | 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