Gamestudio Links
Zorro Links
Newest Posts
Newbie Questions
by fairtrader. 12/05/23 14:22
Zorro Trader GPT
by TipmyPip. 12/04/23 11:34
Square root rule
by Smallz. 12/02/23 09:15
RTest not found error
by TipmyPip. 12/01/23 21:43
neural function for Python to [Train]
by TipmyPip. 12/01/23 14:47
Xor Memory Problem.
by TipmyPip. 11/28/23 14:23
Training with command line parameters
by TipmyPip. 11/26/23 08:42
Combine USD & BTC Pairs In Asset Loop
by TipmyPip. 11/26/23 08:30
AUM Magazine
Latest Screens
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Who's Online Now
0 registered members (), 631 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
fairtrader, hus, Vurtis, Harry5, KelvinC
19019 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
What is wrong here ? #403176
06/15/12 19:29
06/15/12 19:29
Joined: Jul 2001
Posts: 4,801
netherlands
Realspawn Offline OP

Expert
Realspawn  Offline OP

Expert

Joined: Jul 2001
Posts: 4,801
netherlands
I use this :

Code:
action stone_gone()
{	
set(my,SHADOW);
set(my,TRANSLUCENT);
while(vec_dist(my.x,player.x) >80)
{
wait(300); 
ent_remove(me); 

}
}



it works but before it disappears it gives me a E1513 error ?

Last edited by Realspawn; 06/15/12 20:08.

Find all my tutorials & Workshops at : www.rp-interactive.nl

Creativity starts in the brain
Re: Waht is wrong hete ? [Re: Realspawn] #403177
06/15/12 19:38
06/15/12 19:38
Joined: May 2010
Posts: 41
İstanbul/Turkey
Sorrowful Offline
Newbie
Sorrowful  Offline
Newbie

Joined: May 2010
Posts: 41
İstanbul/Turkey
I think

action stone_gone()
{
player = me;
....


A8.40 Professional
Sancak Oyun Ekibi
Re: Waht is wrong hete ? [Re: Realspawn] #403178
06/15/12 19:39
06/15/12 19:39
Joined: Mar 2006
Posts: 1,993
Karlsruhe
PadMalcom Offline
Serious User
PadMalcom  Offline
Serious User

Joined: Mar 2006
Posts: 1,993
Karlsruhe
Because you do a check on my.x after you have already removed it wink

Try:
Code:
action stone_gone()
{	
   set(my,SHADOW);
   set(my,TRANSLUCENT);
   while((me != NULL) && (vec_dist(my.x,player.x) >80))
   {
      wait(300); 
      ent_remove(me); 
   }
}



Re: Waht is wrong hete ? [Re: PadMalcom] #403180
06/15/12 20:07
06/15/12 20:07
Joined: Jul 2001
Posts: 4,801
netherlands
Realspawn Offline OP

Expert
Realspawn  Offline OP

Expert

Joined: Jul 2001
Posts: 4,801
netherlands
both did not help laugh this did laugh

action stone_gone()
{
set(my,SHADOW);
set(my,TRANSLUCENT);
while((me != NULL) && (vec_dist(my.x,player.x) >80))
wait(300);
ent_remove(me);
}


Find all my tutorials & Workshops at : www.rp-interactive.nl

Creativity starts in the brain
Re: Waht is wrong hete ? [Re: Realspawn] #403181
06/15/12 20:19
06/15/12 20:19
Joined: May 2009
Posts: 5,367
Caucasus
3run Offline
Senior Expert
3run  Offline
Senior Expert

Joined: May 2009
Posts: 5,367
Caucasus
Insert this as well:
Code:
action stone_gone(){ 
    while(!player){ wait(1); } // wait till player is created!
    set(my, SHADOW | TRANSLUCENT);
    while((me != NULL) && (vec_dist(my.x,player.x) >80)){
        wait(300); 
        ent_remove(me); 
    }
}




Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: Waht is wrong hete ? [Re: 3run] #403183
06/15/12 20:34
06/15/12 20:34
Joined: Jul 2001
Posts: 4,801
netherlands
Realspawn Offline OP

Expert
Realspawn  Offline OP

Expert

Joined: Jul 2001
Posts: 4,801
netherlands
when i add that i get back the error again


Find all my tutorials & Workshops at : www.rp-interactive.nl

Creativity starts in the brain
Re: Waht is wrong hete ? [Re: Realspawn] #403185
06/15/12 20:49
06/15/12 20:49
Joined: May 2009
Posts: 5,367
Caucasus
3run Offline
Senior Expert
3run  Offline
Senior Expert

Joined: May 2009
Posts: 5,367
Caucasus
Try this then:
Code:
action stone_gone(){ 
    while(!player){ wait(1); } // wait till player is created!
    set(my, SHADOW | TRANSLUCENT);
    while(vec_dist(my.x, player.x) > 80){
        wait(300);  
    }
    wait(1);
    ent_remove(me);
}


What should this do? Remove entity as soon as player gets closer or what?


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: Waht is wrong hete ? [Re: 3run] #403187
06/15/12 21:22
06/15/12 21:22
Joined: Jul 2001
Posts: 4,801
netherlands
Realspawn Offline OP

Expert
Realspawn  Offline OP

Expert

Joined: Jul 2001
Posts: 4,801
netherlands
it works laugh


Find all my tutorials & Workshops at : www.rp-interactive.nl

Creativity starts in the brain
Re: Waht is wrong hete ? [Re: Realspawn] #403256
06/17/12 07:48
06/17/12 07:48
Joined: Jun 2006
Posts: 2,640
Earth
Germanunkol Offline
Expert
Germanunkol  Offline
Expert

Joined: Jun 2006
Posts: 2,640
Earth
Can someone explain why?

I don't get it. Maybe I'm missing the obvious, but as soon as ent_remove(my) is called, the function should be stopped. That means the while() is never checked again. Which in turn means, assuming the player entity exists, the function shouldn't crash.
Or is it that some other function uses the entity?

One more thing, Realspawn, I think the wait(300) is supposed to wait for a certain time before checking again, right? This time should be PC-independent, though, I asume. If that's the case you should wait a time, not a number of frames. Waiting 300 frames on one PC might take 10 seconds, while on the other PC it'll take 3 seconds. So instead, try:
wait(-3);
The wait(1) is fine though (but I don't think it's necessary).


~"I never let school interfere with my education"~
-Mark Twain
Re: Waht is wrong hete ? [Re: Germanunkol] #403267
06/17/12 09:37
06/17/12 09:37
Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
Espér Offline
Expert
Espér  Offline
Expert

Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
correct me if i'm wrong, but i think the while loop checks the arguments as last after running through. like:

start loop
run
run
run
end loop but restart if()

?

Last edited by Espér; 06/17/12 09:38.

Selling my Acknex Engine Editions (A7 Com & A8 Pro):
>> click here if you are interested <<
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