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 06-26-2006, 05:55 PM
excaliber7388 excaliber7388 is offline
Banned
excaliber7388's Avatar
Join Date: Jul 2005
Location: US
Posts: 5,229
excaliber7388 can only hope to improve
Send a message via AIM to excaliber7388
converting to gs2

So far, this is the only really annoying thing about gs2: Strings. More specifically, variables in string names. Of course, that might not be the problem here, who knows.
Anyway, this works in gs1, not gs2 I blame the strings, however I may have screwed something up when transfering it to gs2. The action IS received, and the parameter is read.
PHP Code:
if(params[0]=="buy")
  {
    if(
player.rupees>=("serverr.market_" params[1] @ "_price"))
    {
      
addweapon ("serverr.market_" params[1] @ "_item");
      
player.rupees-=("serverr.market_" params[1] @ "_price");
      
with(findplayer(("serverr.market_" params[1] @ "_acct")))
      {
        
player.rupees+=("serverr.market_" params[1] @ "_price");
        
player.chat="You sold something at the market!";
      }
    (
"serverr.market_" params[1] @ "_item")=0;
    (
"serverr.market_" params[1] @ "_acct")=0;
    (
"serverr.market_" params[1] @ "_img")=0;
    (
"serverr.market_" params[1] @ "_price")=0;
    }
  } 
Reply With Quote
  #2  
Old 06-26-2006, 06:15 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
You must not put periods inside the string name like that.
This is correct:
PHP Code:
serverr.("market_" params[1] @ "_price") = 0;
serverr.("mystring_" temp.number).("morefoo_" temp.bzz) = 0
__________________
Skyld
Reply With Quote
  #3  
Old 06-27-2006, 07:03 AM
ApothiX ApothiX is offline
Okiesmokie
Join Date: May 2004
Posts: 1,447
ApothiX is on a distinguished road
Expanding on what Skyld said: Periods do work if you're using makevar() as opposed to the foo.("bar") format. ie: makevar("clientr.myname") = "Okiesmokie" is equal to: clientr.(@"myname") = "Okiesmokie";
__________________


[06:24:19] * Parts: Skyld (i=silent@unaffiliated/skyld) ("Perhaps Okiesmokie did not realise that I like the boys. ")
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 12:25 PM.


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