Graal Forums  

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

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 02-24-2006, 06:18 AM
Prozac Prozac is offline
one of the good guys
Prozac's Avatar
Join Date: Jan 2006
Posts: 245
Prozac is on a distinguished road
Send a message via AIM to Prozac
calling public functions

So, in a weapon npc, i have this serverside:

PHP Code:
public function itemDesc()
{
 
this.msg="This is an item description";
 return 
this.msg;

then the player has the weapon, and I want a gui text window object called item_desc_text (necesarrily clientside) to get the text from the public function call, but all it returns is 0:

PHP Code:
item_desc_text.text=weapon-name.itemDesc(); 
so, what is the propper procedure to call a public function in a weapon, and have it return information to you/perform actions through another weapon (clientside or serverside etc)?
Reply With Quote
  #2  
Old 02-24-2006, 06:29 AM
Rick Rick is offline
PipBoy Extraordinaire!
Rick's Avatar
Join Date: Jul 2004
Location: Long Beach, California.
Posts: 831
Rick is on a distinguished road
You can't call serverside functions clientside.

My suggestion:

PHP Code:
// In your weapon
function onActionServerside()
{
  
player.triggerclient(params[0], this.namethis.itemDesc());
}

// In your GUI script
//#CLIENTSIDE
function onCreated() // or whatever...
{
  
triggeraction(00"serverside"weaponname.namethis.name);
}

function 
onActionClientside()
{
  
item_desc_text.text params[1];

Reply With Quote
  #3  
Old 02-24-2006, 06:54 AM
Prozac Prozac is offline
one of the good guys
Prozac's Avatar
Join Date: Jan 2006
Posts: 245
Prozac is on a distinguished road
Send a message via AIM to Prozac
Most excellent! thank you!
(wants a wiki "quick refrence card" like they have in the Windows for Dummies books. Perhaps there could be a Gs2 for Dummies eBook? ah yes the graal bible and wikis ... but thats Gs2 for people who already know how to script and program. Stefan, hire a technical writer for a week to get the wiki finally done right please ... i look forward to all the description fields being filled in)
Reply With Quote
  #4  
Old 02-24-2006, 02:59 PM
ApothiX ApothiX is offline
Okiesmokie
Join Date: May 2004
Posts: 1,447
ApothiX is on a distinguished road
I fail to see how this problem has anything to do with the incompleteness of the wiki. Also, this has been said many times before, but: If you want the wiki to be complete, add things to it.
__________________


[06:24:19] * Parts: Skyld (i=silent@unaffiliated/skyld) ("Perhaps Okiesmokie did not realise that I like the boys. ")
Reply With Quote
  #5  
Old 02-24-2006, 06:46 PM
Prozac Prozac is offline
one of the good guys
Prozac's Avatar
Join Date: Jan 2006
Posts: 245
Prozac is on a distinguished road
Send a message via AIM to Prozac
Quote:
Originally Posted by ApothiX
If you want the wiki to be complete, add things to it.
BUT what if i add something that turns out to be wong?
that would be .. hm whats that phase you have posted on several occasions .. DON'T GIVE BAD ADVICE!
and i dont want to get yelled at for giving bad advice, even if i was sure the advice was good, but it turned out not to be good.

congradulations apothix, your general attitude has scared me off from adding anything to the wiki.
Reply With Quote
  #6  
Old 02-25-2006, 03:32 AM
ZeLpH_MyStiK ZeLpH_MyStiK is offline
Scripter
ZeLpH_MyStiK's Avatar
Join Date: May 2003
Location: NYC
Posts: 553
ZeLpH_MyStiK is on a distinguished road
Send a message via MSN to ZeLpH_MyStiK Send a message via Yahoo to ZeLpH_MyStiK
Quote:
Originally Posted by Prozac
BUT what if i add something that turns out to be wong?
that would be .. hm whats that phase you have posted on several occasions .. DON'T GIVE BAD ADVICE!
and i dont want to get yelled at for giving bad advice, even if i was sure the advice was good, but it turned out not to be good.

congradulations apothix, your general attitude has scared me off from adding anything to the wiki.
That's why there is an edit button on it. =O
But if you're gonna add something, make it is accurate to the best of your knowledge.
__________________
Reply With Quote
  #7  
Old 02-25-2006, 04:23 AM
Prozac Prozac is offline
one of the good guys
Prozac's Avatar
Join Date: Jan 2006
Posts: 245
Prozac is on a distinguished road
Send a message via AIM to Prozac
There is a ton of accurate stuff on the wiki already.
the part (that from what i hear Stefan is working on) is making that knowledge USEFUL to people who are new to, or learning, the new language by describing what the functions, paramaters, etc actually do. but wait I've ranted on and on about this for months so i will stop now
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 07:08 AM.


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