Graal Forums  

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

Reply
 
Thread Tools Search this Thread Display Modes
  #16  
Old 08-28-2008, 11:32 PM
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 xXziroXx View Post
makevar("this.rights-" @ temp.i) instead of this.("rights-" @ temp.i)
It shouldn't make a difference though, should it? I prefer this.(@ "blah").
__________________
Reply With Quote
  #17  
Old 08-28-2008, 11:42 PM
Inverness Inverness is offline
Incubator
Inverness's Avatar
Join Date: Aug 2004
Location: Houston, Texas
Posts: 3,613
Inverness is a jewel in the roughInverness is a jewel in the rough
Quote:
Originally Posted by cbk1994 View Post
It shouldn't make a difference though, should it? I prefer this.(@ "blah").
It makes a difference if there are any dots in temp.i... I think.
__________________
Reply With Quote
  #18  
Old 08-29-2008, 12:18 AM
xXziroXx xXziroXx is offline
Malorian
xXziroXx's Avatar
Join Date: May 2004
Posts: 5,289
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
this.(STUFF HERE) should only be used with dynamic variables, and makevar("this." @ STUFF HERE)) with normal strings. Otherwise they will spontaneously behave odd from time to time, and maybe they're not supposed to do that, but I've dealt a lot with this particular issue over the last years.
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
  #19  
Old 08-29-2008, 12:32 AM
Skyld Skyld is offline
Script-fu
Skyld's Avatar
Join Date: Jan 2002
Location: United Kingdom
Posts: 3,914
Skyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud of
Send a message via AIM to Skyld
Quote:
Originally Posted by xXziroXx View Post
this.(STUFF HERE) should only be used with dynamic variables, and makevar("this." @ STUFF HERE)) with normal strings. Otherwise they will spontaneously behave odd from time to time, and maybe they're not supposed to do that, but I've dealt a lot with this particular issue over the last years.
I use this.(stuff here) all the time because I hate hate hate how messy code looks when using makevar(), and I have never had any issues.
Reply With Quote
  #20  
Old 08-29-2008, 02:02 AM
Frankie Frankie is offline
xChugxLifex
Frankie's Avatar
Join Date: Feb 2008
Location: New York
Posts: 1,610
Frankie is a jewel in the roughFrankie is a jewel in the rough
Send a message via AIM to Frankie Send a message via MSN to Frankie
my post got cut off because Chris started a new page in case you guys didn't see :[

Quote:
Originally Posted by Chompy View Post
Also, loops inside with() aren't optimized Just thought you would want to know =p
it doesn't work if I take the for() loop out of the with()


it's just making me curious now that he said that.
__________________
*Sum41Freeeeek
*Frankie
Reply With Quote
  #21  
Old 08-29-2008, 03:11 AM
TheStan TheStan is offline
Stan?
Join Date: May 2008
Location: U.S.
Posts: 100
TheStan is on a distinguished road
Send a message via AIM to TheStan Send a message via MSN to TheStan
BOOYAH!

PHP Code:
function onCreated() {
  
this.test();
}
public function 
test() {
  
temp.file = new TStaticVar();
  
temp.file.loadvars("gangs/Los Carteles.txt");
  
  
with (temp.file) {
    
temp.keys getstringkeys("this.rights-");
  } 
  for (
temp.itemp.keys)
  {
    if (
temp.file.("rights-" temp.i)[7] == 1)
    {
      echo(
temp.i);
    }
  }

Should work rougly.
Reply With Quote
  #22  
Old 08-29-2008, 03:30 AM
Inverness Inverness is offline
Incubator
Inverness's Avatar
Join Date: Aug 2004
Location: Houston, Texas
Posts: 3,613
Inverness is a jewel in the roughInverness is a jewel in the rough
Quote:
Originally Posted by TheStan View Post
BOOYAH!

PHP Code:
function onCreated() {
  
this.test();
}
public function 
test() {
  
temp.file = new TStaticVar();
  
temp.file.loadvars("gangs/Los Carteles.txt");
  
  
with (temp.file) {
    
temp.keys getstringkeys("this.rights-");
  } 
  for (
temp.itemp.keys)
  {
    if (
temp.file.("rights-" temp.i)[7] == 1)
    {
      echo(
temp.i);
    }
  }

Should work rougly.
If that was C++ you'd have a memory leak. And you forgot the @ before "rights-" in the loop.
__________________
Reply With Quote
  #23  
Old 08-29-2008, 03:37 AM
LoneAngelIbesu LoneAngelIbesu is offline
master of infinite loops
LoneAngelIbesu's Avatar
Join Date: May 2007
Location: Toldeo, Ohio
Posts: 1,049
LoneAngelIbesu has a spectacular aura aboutLoneAngelIbesu has a spectacular aura about
Send a message via AIM to LoneAngelIbesu
Quote:
Originally Posted by Inverness View Post
If that was C++ you'd have a memory leak. And you forgot the @ before "rights-" in the loop.
Thank God it's not C++.
__________________
"We are all in the gutter, but some of us are looking at the stars."
— Oscar Wilde, Lady Windermere's Fan
Reply With Quote
  #24  
Old 08-29-2008, 03:53 AM
Inverness Inverness is offline
Incubator
Inverness's Avatar
Join Date: Aug 2004
Location: Houston, Texas
Posts: 3,613
Inverness is a jewel in the roughInverness is a jewel in the rough
Quote:
Originally Posted by LoneAngelIbesu View Post
Thank God it's not C++.
I wouldn't say that.

Having a server crash due to Stan's scripting error would be popcorn-worthy.
__________________
Reply With Quote
  #25  
Old 08-29-2008, 04:32 AM
TheStan TheStan is offline
Stan?
Join Date: May 2008
Location: U.S.
Posts: 100
TheStan is on a distinguished road
Send a message via AIM to TheStan Send a message via MSN to TheStan
Quote:
Originally Posted by Inverness View Post
I wouldn't say that.

Having a server crash due to Stan's scripting error would be popcorn-worthy.
That's all well and funny but you seem to be forgetting one thing had you been paying close attention Invern...that isn't my script. I copied and pasted and just moved the for loop and changed "this.(@ blah)" to "temp.file.(@ black)" any other errors are of his property.
Reply With Quote
  #26  
Old 08-29-2008, 04:39 AM
Frankie Frankie is offline
xChugxLifex
Frankie's Avatar
Join Date: Feb 2008
Location: New York
Posts: 1,610
Frankie is a jewel in the roughFrankie is a jewel in the rough
Send a message via AIM to Frankie Send a message via MSN to Frankie
I don't understand what temp.file.("rights-" @ temp.i) is any different from temp.file.(@ "rights-" @ temp.i
__________________
*Sum41Freeeeek
*Frankie
Reply With Quote
  #27  
Old 08-29-2008, 05:00 AM
LoneAngelIbesu LoneAngelIbesu is offline
master of infinite loops
LoneAngelIbesu's Avatar
Join Date: May 2007
Location: Toldeo, Ohio
Posts: 1,049
LoneAngelIbesu has a spectacular aura aboutLoneAngelIbesu has a spectacular aura about
Send a message via AIM to LoneAngelIbesu
Quote:
Originally Posted by Frankie View Post
I don't understand what temp.file.("rights-" @ temp.i) is any different from temp.file.(@ "rights-" @ temp.i
PHP Code:
function onCreated() {
  
temp."foo";
  
temp.i.rights_foo "bar";
  echo(
temp.i.(@ "rights_" temp.e));
  echo(
temp.i.("rights_" temp.e));

Returns:
PHP Code:
Weapon/GUI-script _DylanTest2 added/updated by LoneAngelIbesu
bar
bar 
So, I don't see the difference either.
__________________
"We are all in the gutter, but some of us are looking at the stars."
— Oscar Wilde, Lady Windermere's Fan
Reply With Quote
  #28  
Old 08-29-2008, 05:04 AM
TheStan TheStan is offline
Stan?
Join Date: May 2008
Location: U.S.
Posts: 100
TheStan is on a distinguished road
Send a message via AIM to TheStan Send a message via MSN to TheStan
There is no difference according to code. The different is preference. :/
Reply With Quote
  #29  
Old 08-29-2008, 05:07 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 Frankie View Post
I don't understand what temp.file.("rights-" @ temp.i) is any different from temp.file.(@ "rights-" @ temp.i
I'm actually not sure ... that's how I've always seen it done though, so that's how I've done it. I wonder why people do it (if it really DOES make a difference).
__________________
Reply With Quote
  #30  
Old 08-29-2008, 05:42 AM
coreys coreys is offline
N-Pulse Assistant Manager
coreys's Avatar
Join Date: Mar 2005
Posts: 2,180
coreys has a spectacular aura about
Send a message via AIM to coreys Send a message via MSN to coreys Send a message via Yahoo to coreys
Quote:
Originally Posted by TheStan View Post
That's all well and funny but you seem to be forgetting one thing had you been paying close attention Invern...that isn't my script. I copied and pasted and just moved the for loop and changed "this.(@ blah)" to "temp.file.(@ black)" any other errors are of his property.
Then don't present it as such?
Say "Hey, you should organize it like this" rather than "Hey, this should work."
__________________

Quote:
*SlikRick: so should I even ask about your aim status?
*Xor: well if you want to
*Xor: but i am LARPING
*SlikRick: While on a computer?
*Xor: yes
*Xor: in my living room
*SlikRick: ahh
*Xor: i have a fort setup to hide from beasts
Reply With Quote
Reply


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 06:42 AM.


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