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 04-07-2008, 10:41 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 cbkbud View Post
Maybe something like this:

PHP Code:
this.attr[2] = findnpc("BlooIntercoms").(@this.intid).( @ "message" ); 
Absolutely not.
__________________
Reply With Quote
  #17  
Old 04-07-2008, 11:20 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
What's yucky about it?
__________________
Reply With Quote
  #18  
Old 04-07-2008, 11:29 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 cbkbud View Post
What's yucky about it?
Compare mine to yours.
__________________
Reply With Quote
  #19  
Old 04-08-2008, 12:07 AM
Chompy Chompy is offline
¯\(º_o)/¯
Chompy's Avatar
Join Date: Sep 2006
Location: Norway
Posts: 2,815
Chompy is just really niceChompy is just really niceChompy is just really nice
Send a message via MSN to Chompy
PHP Code:
function onCreated() {
  echo(
findnpc("rawr").message); // If the npc exists or not doesn't matter
}
/*
Script compiler output for ChompyTest:
Weapon/GUI-script ChompyTest added/updated by Chompy
*/ 
So, actually Chris' script wouldn't output the 'Script compiler ...' line ;o
__________________
Reply With Quote
  #20  
Old 04-08-2008, 01:24 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
I thought the problem was that it was rejecting any string named message, therefor, it wouldn't let you do x.message ... ?
__________________
Reply With Quote
  #21  
Old 04-08-2008, 02:59 PM
Chompy Chompy is offline
¯\(º_o)/¯
Chompy's Avatar
Join Date: Sep 2006
Location: Norway
Posts: 2,815
Chompy is just really niceChompy is just really niceChompy is just really nice
Send a message via MSN to Chompy
Quote:
Originally Posted by cbkbud View Post
I thought the problem was that it was rejecting any string named message, therefor, it wouldn't let you do x.message ... ?
Actually it only only happens when using findnpc, findplayer, findlevel, actually, any function like object, odd huh?

All these scripts will produce the line
PHP Code:
function onCreated() {
  echo(
findplayer("Chompy").message); // if the player exists or not doesn't matter
}
/*
Script compiler output for ChompyTest:
Weapon/GUI-script ChompyTest added/updated by Chompy
*/ 
PHP Code:
function onCreated() {
  echo(
findad("pepsi").message); // doesn't matter if the function exists
}
/*
Script compiler output for ChompyTest:
Weapon/GUI-script ChompyTest added/updated by Chompy
*/ 
PHP Code:
function onCreated() {
    echo(
findbirdandpatit().message); // you get the point..
}
/*
Script compiler output for ChompyTest:
Weapon/GUI-script ChompyTest added/updated by Chompy
*/ 
Now, the weird thing about it is..

this works:

PHP Code:
function onCreated() {
  
temp.a_b = new TStaticVar();
  
temp.a_b."foo";
  
  
temp."_b";
  
  echo(
makevar("a"@b).c);
}
/*
foo
*/ 
while this doesn't
PHP Code:
function onCreated() {
  
temp.a_b = new TStaticVar();
  
temp.a_b.message "foo";
  
  
temp."_b";
  
  echo(
makevar("a"@b).message);
}
/*
Script compiler output for ChompyTest:
Weapon/GUI-script ChompyTest added/updated by Chompy
*/ 
__________________
Reply With Quote
  #22  
Old 04-08-2008, 03:14 PM
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
It is possibly something to do with function prototyping (whereby functions are child members of an object with the same name). I guess if some object has a message() function, you can probably not use the same variable name.

Not sure why that would happen with objects returned from findplayer() though.
Reply With Quote
  #23  
Old 04-08-2008, 09:39 PM
Admins Admins is offline
Graal Administration
Join Date: Jan 2000
Location: Admins
Posts: 11,693
Admins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud of
Hmmm doesn't seem to be a new problem, same error on older servers. It has the same problem with any funcname().oldscriptcommand, e.g. funcname().loadmap, seeing loadmap as the GS1 loadmap() function and ignoring funcname(). (and giving error when being put in echo() or similar). I will check if that can be fixed easily.
Reply With Quote
  #24  
Old 04-08-2008, 11:59 PM
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
Quote:
Originally Posted by Inverness View Post
PHP Code:
this.attr[2] = findnpc("BlooIntercoms").(@ this.intid).message;
or
this.attr[2] = BlooIntercoms.(@ this.intid).message
You don't put a period inside the parenthesis thingy. You can only do that with makevar().
Wrong. I'm using it on multiple places.

TStaticVar() = this.attr[2] = findnpc("BlooIntercoms").(@ this.intid).message
Normal var = this.attr[2] = findnpc("BlooIntercoms").(@ this.intid ".message")
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
  #25  
Old 04-09-2008, 01:01 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 xXziroXx View Post
Wrong. I'm using it on multiple places.

TStaticVar() = this.attr[2] = findnpc("BlooIntercoms").(@ this.intid).message
Normal var = this.attr[2] = findnpc("BlooIntercoms").(@ this.intid ".message")
Well okay then, feel free to promote bad habits.
__________________
Reply With Quote
  #26  
Old 04-09-2008, 01:06 AM
Tolnaftate2004 Tolnaftate2004 is offline
penguin.
Join Date: Jul 2004
Location: Berkeley, CA
Posts: 534
Tolnaftate2004 is a jewel in the roughTolnaftate2004 is a jewel in the rough
Send a message via AIM to Tolnaftate2004
Quote:
Originally Posted by xXziroXx View Post
Normal var = this.attr[2] = findnpc("BlooIntercoms").(@ this.intid ".message")
This doesn't work.
__________________
◕‿‿◕ · pfa · check yer syntax! · src

Killa Be: when i got that locker in 6th grade the only thing in it was a picture of a midget useing a firehose :/
Reply With Quote
  #27  
Old 04-09-2008, 01:45 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
Inverness, Pfa - sorry. I scaned some of my older scripts where I was sooo sure I used it, and only examples I could find was with makevar().

l2think, right?
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
  #28  
Old 04-09-2008, 11:49 AM
zokemon zokemon is offline
That one guy...
zokemon's Avatar
Join Date: Mar 2001
Location: Sonoma County, California
Posts: 2,925
zokemon is a jewel in the roughzokemon is a jewel in the rough
Send a message via ICQ to zokemon Send a message via AIM to zokemon Send a message via MSN to zokemon Send a message via Yahoo to zokemon
Quote:
Originally Posted by xXziroXx View Post
Inverness, Pfa - sorry. I scaned some of my older scripts where I was sooo sure I used it, and only examples I could find was with makevar().

l2think, right?
I'm pretty sure PFA is referring to that fact that you did not concatenate this.intid and ".message" together which would cause a compiler (syntax) error, not a run-time error.
__________________
Do it with a DON!
Reply With Quote
  #29  
Old 04-09-2008, 05:22 PM
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
Quote:
Originally Posted by zokemon View Post
I'm pretty sure PFA is referring to that fact that you did not concatenate this.intid and ".message" together which would cause a compiler (syntax) error, not a run-time error.
I wasn't even looking at the var names or anything, I simply took what was written and showed the syntax I was so sure I had used in the past.
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
  #30  
Old 04-10-2008, 05:48 PM
Admins Admins is offline
Graal Administration
Join Date: Jan 2000
Location: Admins
Posts: 11,693
Admins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud of
Ok fixed the problem, the new npcserver will be uploaded in a few days. It was accepting GS1 commands after closing brackets ")", but not correctly handling the case "functioncall().variablename".
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 12:23 PM.


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