Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting > New Scripting Engine (GS2)
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 09-22-2009, 02:27 PM
Crow Crow is offline
ǝɔɐɹq ʎןɹnɔ
Crow's Avatar
Join Date: Dec 2006
Location: Germany
Posts: 5,153
Crow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond repute
If you still want to use client.vars, do the following:
PHP Code:
( @ client.var).func(); 
Reply With Quote
  #2  
Old 09-22-2009, 02:50 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 Crow View Post
If you still want to use client.vars, do the following:
PHP Code:
( @ client.var).func(); 
Wrong.

PHP Code:
client.(@var @ "_propersyntax").(@subvar "_isawesome").(@etc
To call a function from a string, this would be best:

PHP Code:
temp.weapon_name "myWeapon";
temp.function_name "myFunction";

// Weapon based on string
(@temp.weapon_name).myFunction(param1param2etc);
// Function based on string
myWeapon.(@temp.functon_name)(param1param2etc);
// Weapon AND function based on string
(@temp.weapon_name).(@temp.function_name)(param1param2etc); 
Threw in some extra examples.
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
  #3  
Old 09-22-2009, 03:00 PM
Crow Crow is offline
ǝɔɐɹq ʎןɹnɔ
Crow's Avatar
Join Date: Dec 2006
Location: Germany
Posts: 5,153
Crow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond repute
Quote:
Originally Posted by xXziroXx View Post
Wrong.
Not at all. Let's assume that client.var holds the string "-System", the name of the weapon npc (let's also assume that weapon npc exists). You could then either do:
PHP Code:
( @ "-System").func(); 
or:
PHP Code:
( @ client.var).func(); 
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 07:21 PM.


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