Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Savevars (https://forums.graalonline.com/forums/showthread.php?t=72416)

Chandler 02-23-2007 09:12 PM

Savevars
 
Having a little problem. It doesn't seem to want to store the data. It's creating the file, just isn't storing it I suppose. Any suggestions?
HTML Code:

  this.itemName = "Red Apple";
  this.increasehp = 0.5;
  this.cureEffect = {{"poison"}, {70}};

  temp.newData = new TStaticVar();
  temp.allFlags = getstringkeys("this.");
  for (temp.currentFlag: temp.allFlags)
  {
    if (temp.currentFlag.starts("item"))
    {
      temp.newString @= temp.currentFlag @ "=" @ makevar("this." @ temp.currentFlag) @ ",";
    }
    makevar(temp.("newData." @ temp.currentFlag)) = makevar("this." @ temp.currentFlag);
  }
  temp.fileName = this.itemName @ ".arc";
  temp.fileLocation = "archetypes/" @ this.itemCatagory @ "/";
 
  temp.newData.savevars(temp.fileLocation @ temp.fileName, 0);

Any suggestions?

xXziroXx 02-23-2007 09:14 PM

Have you given the rw rights to (npcserver)?

Chandler 02-23-2007 09:15 PM

Quote:

Originally Posted by xXziroXx (Post 1281358)
Have you given the rw rights to (npcserver)?

Should do, it's creating the file.

xXziroXx 02-23-2007 09:23 PM

Try echoing temp.newData.getDynamicVarNames() right before it saves it and see what it outputs?

Chandler 02-23-2007 09:40 PM

Quote:

Originally Posted by xXziroXx (Post 1281363)
Try echoing temp.newData.getDynamicVarNames() right before it saves it and see what it outputs?

Weird, it's not producing anything. How bizarre

HTML Code:

makevar(temp.("newData." @ temp.currentFlag)) = makevar("this." @ temp.currentFlag);
HTML Code:

temp.newData.( @ temp.currentFlag) = makevar("this." @ temp.currentFlag);
Works, how weird.


All times are GMT +2. The time now is 03:16 PM.

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