Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Search this Thread Display Modes
  #16  
Old 08-11-2009, 02:52 AM
WhiteDragon WhiteDragon is offline
Banned
Join Date: Feb 2007
Posts: 1,002
WhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to behold
Well, at least this way people will be dissuaded from using sleep, which increases the chance of weird and even more confusing things happening to scripters, like race conditions.

That said, a bug should never be a feature, so fix it please.
Reply With Quote
  #17  
Old 08-11-2009, 02:54 AM
DustyPorViva DustyPorViva is offline
Will work for food. Maybe
DustyPorViva's Avatar
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
DustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond repute
Send a message via AIM to DustyPorViva Send a message via MSN to DustyPorViva
On a slightly somewhat perhaps related note, I have often had problems where temp.vars lose their value in a for loop.
Reply With Quote
  #18  
Old 08-11-2009, 02:56 AM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by DustyPorViva View Post
On a slightly somewhat perhaps related note, I have often had problems where temp.vars lose their value in a for loop.
Are you declaring them inside the loop?

PHP Code:
temp.0;

for (
temp.item : array) {
  echo(
b);
  
++;

has always worked for me
__________________
Reply With Quote
  #19  
Old 08-11-2009, 02:58 AM
WhiteDragon WhiteDragon is offline
Banned
Join Date: Feb 2007
Posts: 1,002
WhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to behold
Quote:
Originally Posted by DustyPorViva View Post
On a slightly somewhat perhaps related note, I have often had problems where temp.vars lose their value in a for loop.
Is the script getting suspended in the middle (i.e., sleep, waitfor), or is it just a straight-up for loop?

I have literally no technical data on how GScript works, such as threading, etc. or how scripts execute based on what they are waiting for (i.e., do all of them lock if one is waiting on I/O), so I can only speculate.

Even if you aren't suspending the script, it's possible that another script runs and pushes some variables out of the memory, or perhaps the garbage collector is going haywire for some reason.
Reply With Quote
  #20  
Old 08-11-2009, 02:59 AM
DustyPorViva DustyPorViva is offline
Will work for food. Maybe
DustyPorViva's Avatar
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
DustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond repute
Send a message via AIM to DustyPorViva Send a message via MSN to DustyPorViva
It's not exactly that simple of a scenario. I can't do so right now, but I will pull up an example of a script where I have had the problem.
Reply With Quote
  #21  
Old 08-11-2009, 04:06 AM
DustyPorViva DustyPorViva is offline
Will work for food. Maybe
DustyPorViva's Avatar
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
DustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond repute
Send a message via AIM to DustyPorViva Send a message via MSN to DustyPorViva
Here is a script I've had the problem with... it may have to do with function temp vars or something:
PHP Code:
function HitWall(k,speed,wall) {
  
temp.foo k;
  for (
temp.i=0;i<speed;i+=1/16) {
    if (
onwall2(check[k][0]+vecx(k)*i,check[k][1]+vecy(k)*i,check[k][2],check[k][3])) {
      if (
k in {0,2}) {
        
player.+= vecy(k)*i;
        
player.int(player.y+.5);
      } else {
        
player.chat k;
        
player.+= vecx(k)*i;
        
player.int(player.x)+.5;
      }
      break;
    }
  }

var foo handles the value proper, var k does not. Player chat will return 0.

I've had the problem more than once, as well.
Reply With Quote
  #22  
Old 08-03-2012, 12:03 AM
devilsknite1 devilsknite1 is offline
C:
devilsknite1's Avatar
Join Date: Jul 2006
Location: Florida, USA
Posts: 269
devilsknite1 has a spectacular aura about
Send a message via AIM to devilsknite1 Send a message via MSN to devilsknite1 Send a message via Yahoo to devilsknite1
Reviving this thread after a good 3 years in hopes of reminding Stefan that this is still an issue. >.>
Reply With Quote
  #23  
Old 08-03-2012, 12:42 AM
Pandar Pandar is offline
Babylon Co-Manager
Pandar's Avatar
Join Date: Jan 2007
Location: New York
Posts: 68
Pandar has a spectacular aura aboutPandar has a spectacular aura about
Quote:
Originally Posted by devilsknite1 View Post
Reviving this thread after a good 3 years in hopes of reminding Stefan that this is still an issue. >.>
This, this, forever more, holy ****, it's one of the most ANNOYING things in GS2.
__________________
R.I.P. Graal (1998 - 2004)
Reply With Quote
  #24  
Old 08-03-2012, 12:48 PM
Emera Emera is offline
Delterian Hybrid
Emera's Avatar
Join Date: Mar 2011
Location: Newcastle Upon-Tyne
Posts: 1,704
Emera is a jewel in the roughEmera is a jewel in the rough
I've had it a couple of times. I agree it ****ing annoying.
__________________
Reply With Quote
  #25  
Old 11-29-2013, 08:10 PM
Emera Emera is offline
Delterian Hybrid
Emera's Avatar
Join Date: Mar 2011
Location: Newcastle Upon-Tyne
Posts: 1,704
Emera is a jewel in the roughEmera is a jewel in the rough
Bump. Are you every going to get around to fixing this Stefan? It's doing my head in.
__________________
Reply With Quote
  #26  
Old 12-14-2013, 11:59 PM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
Quote:
Originally Posted by Emera View Post
Bump. Are you every going to get around to fixing this Stefan? It's doing my head in.
Store the player object before calling sleep.

I.e.

PHP Code:
temp.pl player;
sleep(5);
echo(
temp.pl.account); 
This same issue occurs when loading TServerPlayer objects as well.
__________________
Quote:
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 08:44 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.