Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 10-25-2006, 08:49 AM
Loakey_P2P Loakey_P2P is offline
SL Oldbie
Loakey_P2P's Avatar
Join Date: Apr 2006
Location: U.S.A
Posts: 137
Loakey_P2P is an unknown quantity at this point
Send a message via AIM to Loakey_P2P Send a message via Yahoo to Loakey_P2P
Time Problem

ok the first npc involved is a time database which is self sustaining . the npc im making is a self sustaining weather database . the problem seem's to be that it's not checking the time corectly . as all the different aspect's of weather are stored as flag's on the npc and check every so many hour's and altered . i have it pretty much set up but it's not setting the flag's to the right value .

Flag List -
---------------------------------------------------------------------
possable conditions for the weather for all season's .

conditions="rain","snow","sleet","fog","cloudy","c learskies"
humidity="10%","other weather functions like temp or moisture"
moisture="10%","0%-100%","groundmoisture" ,"plantgrowing","plantwatering"
temperature="70","-60 - 90+","groundmoisture","plantgrowth","plantwatering "
waterlevel="hightide","naturaltide","lowtide","raf tmovement","waterbaddys"
windconditions="5,100,direction","raftmovement"
---------------------------------------------------------------------
what all the different string's are .

information.pos.strings=possable settings for the season
information.rights=Still Working It , this is just set up for example to show the strings that will be used , their tolerance levels and what they will effect .
information.time.strings=time checked and resetted
information.weather.strings=actual information strings
---------------------------------------------------------------------
the hour the condition was last checked .

rights.lastcheckedconditions=hour
rights.lastcheckedmoisture=hour
rights.lastcheckedtempature=hour
rights.lastcheckedwaterlevel=hour
rights.lastcheckedwindconditions=hour
---------------------------------------------------------------------
possable setting's for the current season .

rights.posconditions=rain,fog,cloudy,clearskies
rights.posmoisture=0,100
rights.postemperature=+50,100
rights.poswaterlevel=lowtide,naturaltide,hightide
rights.poswindconditions=10,50
---------------------------------------------------------------------
the time each condition is checked . hourly rate .

rights.timeconditions=3
rights.timemoisture=2
rights.timetempature=1
rights.timewaterlevel=6
rights.timewindconditions=4
---------------------------------------------------------------------
the real information flag's , or current setting's .

rights.weather.conditions="clearskies"
rights.weather.moisture="10"
rights.weather.temperature="60"
rights.weather.waterlevel="naturaltide"
rights.weather.windconditions="5,north-east"
---------------------------------------------------------------------
my first problem is as i said before a flag isnt setting the right value . instead
of the flag being set to a number its being set to the word . ive tryed several varation's but nothing has worked so far . and i searched throu the wikipidia site but i didnt see any kind of time example in the new gs2 or even a discription .

this.rights.lastcheckedwaterlevel = "hour";

but if this isnt working i wonder if the time checker part will work either but i wont know untill i get least one of them fixed . can anyone help with this , but there is another problem . the old with(getnpc(npcname)){ command . i found a new one in one of our script's but im not sure about how
it send's the informaton and what not . i know nothing about this new command other then the findNPC("NPCnameHere") , "the .guilds.remove" i believe is the word trigger's sent but im not for sure . any help would be greatly appreciated .

findNPC("Control-LocalGuilds").guilds.remove(uppercase(clientr.guil d[0]));
__________________
Shaded Legend Playerworld
-Past accounts - LoakeyTheElf - Loakey_P2P
-Past Servers - Rune - Sparitoria - Shaded Legends
-Past Sl Jobs * ET/LAT/NAT/LAT Admin/Developer/Admin/Head Admin/Asst. Manager/Manager
-Current Job - Retired

*Sorry you must have mistaken me for someone that cares .
Reply With Quote
  #2  
Old 10-25-2006, 09:16 AM
Devil Devil is offline
Banned
Join Date: Feb 2003
Location: Australia
Posts: 2,835
Devil has a little shameless behaviour in the past
Send a message via AIM to Devil Send a message via MSN to Devil
In the flag list, why is there a space in "c learskies"?
Reply With Quote
  #3  
Old 10-25-2006, 12:04 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 there are quite often spaces in the commands you have posted, may be it was copied incorrectly? For the actual problem I would need some part of the code I guess
Reply With Quote
  #4  
Old 10-28-2006, 01:23 AM
Loakey_P2P Loakey_P2P is offline
SL Oldbie
Loakey_P2P's Avatar
Join Date: Apr 2006
Location: U.S.A
Posts: 137
Loakey_P2P is an unknown quantity at this point
Send a message via AIM to Loakey_P2P Send a message via Yahoo to Loakey_P2P
sorry bout that but no it wasnt an error in the script . it was an error on my part in the copy process but here is the code stefan . the time npc we are sure they are working but the flag's are as minute , hour , ect .
PHP Code:
///////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////
//Scripter = Loakey_P2P,Loakey Ronso
//information = mostly this will make another variable to the plant growing . which will make the process to grow
//information = stuff vary at times . other stuff will be varying water movement for the raft as well as water baddys
//information = in the end i want this to control rain , snow , ect. as well as string's for thing's mentioned above .
//map info below -
//overworldsize = "54 Levels By 54 Levels"
//corditanitesize = "32400 x 32400"
//x.random(0,32400);
//y.random(0,32400);
//String Info
//rights.time[param]=time between checks
//rights.lastchecked[param]=last time it was checked
///////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////
function onCreated(){                       //sets up basic stuff the script need's to function
  
if(serverr.season == "spring"){         //defines all possable condition's for the seasons
  
this.rights.posconditions "rain,fog,cloudy,clearskies";
  
this.rights.posmoisture "0,100";
  
this.rights.postemperature "+50,+70";
  
this.rights.poswaterlevel "lowtide,naturaltide,hightide";
  
this.rights.poswindconditions "5,30";
  }
  if(
serverr.season == "summer"){
  
this.rights.posconditions "rain,fog,cloudy,clearskies";
  
this.rights.posmoisture "0,100";
  
this.rights.postemperature "+50,100";
  
this.rights.poswaterlevel "lowtide,naturaltide,hightide";
  
this.rights.poswindconditions "10,50";
  }
  if(
serverr.season == "fall"){
  
this.rights.posconditions "rain,fog,cloudy,clearskies";
  
this.rights.posmoisture "0,60";
  
this.rights.postemperature "40,+70";
  
this.rights.poswaterlevel "naturaltide,lowtide";
  
this.rights.poswindconditions "5,30";
  }
  if(
serverr.season == "winter"){
  
this.rights.posconditions "sleet,snow,cloudy,clearskies";
  
this.rights.posmoisture "0,50";
  
this.rights.postemperature "-20,+50";
  
this.rights.poswaterlevel "naturaltide,lowtide";
  
this.rights.poswindconditions "20,50";
  }
  
this.rights.timeconditions "3";
  
this.rights.timemoisture "2";
  
this.rights.timetempature "1";
  
this.rights.timewaterlevel "6";
  
this.rights.timewindconditions "4";
  
this.rights.lastcheckedmoisture "hour";
  
this.rights.lastcheckedtempature "hour";
  
this.rights.lastcheckedconditions "hour";
  
this.rights.lastcheckedwindconditions "hour";
  
this.rights.lastcheckedwaterlevel "hour";
  
TimeCheck();
}

function 
ChangeMoisture(){
  if(
this.rights.weather.conditions == "rain" || "sleet" && this.rights.weather.tempature =< "50"){
  
this.rights.weather.moisture "this.rights.weather.moisture+1";
  }  
//wet and cold adds mositure
  
if(this.rights.weather.conditions == "clearskies" || "cloudy" && this.rights.weather.tempature => "70"){
  
this.rights.weather.moisture "this.rights.weather.moisture-1";
  }  
//dry and warm removes moisture
  
this.rights.lastcheckedmoisture "hour";
}

function 
ChangeTempature(){
  if(
this.rights.weather.conditions == "rain" && this.rights.weather.tempature != "rights.postemperature[1]"){this.rights.weather.tempature "rights.weather.tempature - random(1,5);";}
  if(
this.rights.weather.conditions == "snow"){this.rights.weather.tempature "rights.weather.tempature - random(1,5);";}
  if(
this.rights.weather.conditions == "sleet"){this.rights.weather.tempature "rights.weather.tempature - random(1,5);";}
  if(
this.rights.weather.conditions == "fog"){this.rights.weather.tempature "rights.weather.tempature - 1";}
  if(
this.rights.weather.conditions == "cloudy"){this.rights.weather.tempature "rights.weather.tempature + random(1,5);";}
  if(
this.rights.weather.conditions == "clearskies"){this.rights.weather.tempature "rights.weather.tempature + random(1,5);";}
  
this.rights.lastcheckedtempature "hour";
}

function 
ChangeConditions(){
  
this.newcondition "random(1,4);";
    if(
this.newcondition == "1"){this.rights.weather.conditions "rights.posconditions[0]";}
    if(
this.newcondition == "2"){this.rights.weather.conditions "rights.posconditions[1]";}
    if(
this.newcondition == "3"){this.rights.weather.conditions "rights.posconditions[2]";}
    if(
this.newcondition == "4"){this.rights.weather.conditions "rights.posconditions[3]";}
  unset 
this.newcondition;
  
this.rights.lastcheckedconditions "hour";
}

function 
ChangeWindConditions(){
  
this.rights.windconditions[0] = "random(rights.poswindconditions[0],rights.poswindconditions[1]);"// wind speed
  
this.newdirection "random(0,7)";                                   //wind direction - cords like direction .
    
if(this.newdirection == "0"){this.rights.windconditions[1] = "north";}
    if(
this.newdirection == "1"){this.rights.windconditions[1] = "north-west";}
    if(
this.newdirection == "2"){this.rights.windconditions[1] = "west";}
    if(
this.newdirection == "3"){this.rights.windconditions[1] = "south-west";}
    if(
this.newdirection == "4"){this.rights.windconditions[1] = "south";}
    if(
this.newdirection == "5"){this.rights.windconditions[1] = "south-east";}
    if(
this.newdirection == "6"){this.rights.windconditions[1] = "east";}
    if(
this.newdirection == "7"){this.rights.windconditions[1] = "north-east";}
  unset 
this.newdirection;
  
this.rights.lastcheckedwindconditions "hour";
}

function 
ChangeTide(){
  if(
this.rights.weather.moisture => "50" && this.rights.weather.conditions == "rain" || "sleet"){  // Raise Tide
    
if(this.rights.weather.waterlevel == "lowtide"){
    
this.rights.weather.waterlevel "naturaltide";
    }
    if(
this.rights.weather.waterlevel == "naturaltide"){
    
this.rights.weather.waterlevel "hightide";
    }
    if(
this.rights.weather.waterlevel == "hightide"){
    
this.rights.weather.waterlevel "hightide";
    }
  }
  if(
this.rights.weather.moisture =< "50" && this.rights.weather.conditions == "cloudy" || "clearskies"){  //Lower Tide
    
if(this.rights.weather.waterlevel == "lowtide"){
    
this.rights.weather.waterlevel "lowtide";
    }
    if(
this.rights.weather.waterlevel == "naturaltide"){
    
this.rights.weather.waterlevel "lowtide";
    }
    if(
this.rights.weather.waterlevel == "hightide"){
    
this.rights.weather.waterlevel "naturaltide";
    }
    
this.rights.lastcheckedwaterlevel "hour";
  }
}

function 
TimeCheck(){
  if(
hour == "rights.lastcheckedconditions+rights.timeconditions"){ChangeConditions();}
  if(
hour == "rights.lastcheckedmoisture+rights.timemoisture"){ChangeMoisture();}
  if(
hour == "rights.lastcheckedtempature+rights.timetempature"){ChangeTempature();}
  if(
hour == "rights.lastcheckedwaterlevel+rights.timewaterlevel"){ChangeTide();}
  if(
hour == "rights.lastcheckedwindconditions+rights.timewindconditions"){ChangeWindConditions();}
  if(
this.rights.weather.conditions == "rain" && this.rights.weather.tempature => "70"){
    
this.rights.weather.humidity this.rights.weather.humidity 5;
  } 
  if(
this.rights.weather.conditions == "rain" && this.rights.weather.tempature =< "70"){
    
this.rights.weather.humidity this.rights.weather.humidity 5;
  }
  
sleep("1800");
  
TimeCheck();
}

function 
Acumulation(){

the last function hasnt been made yet . that's one i was putting off to last which will be the actual weather showing part . i dont doubt i made several error's in the process but i was more looking for the difacult problem's . and i cant spell .
__________________
Shaded Legend Playerworld
-Past accounts - LoakeyTheElf - Loakey_P2P
-Past Servers - Rune - Sparitoria - Shaded Legends
-Past Sl Jobs * ET/LAT/NAT/LAT Admin/Developer/Admin/Head Admin/Asst. Manager/Manager
-Current Job - Retired

*Sorry you must have mistaken me for someone that cares .

Last edited by Skyld; 10-28-2006 at 10:58 AM.. Reason: Added PHP tags
Reply With Quote
  #5  
Old 10-28-2006, 02:26 AM
Gambet Gambet is offline
Registered User
Join Date: Oct 2003
Posts: 2,712
Gambet is on a distinguished road
You should get used to using switches. They are more efficient and keep things a bit more orderly. Not to mention this script is very disorganized, making it utterly annoying to fix. I'm only going to bother with the switches, assuming that you don't know much about using them.


PHP Code:
function onCreated() {      
  switch(
serverr.season) {       
   case 
"spring"this.rights.posconditions "rain,fog,cloudy,clearskies";
                  
this.rights.posmoisture "0,100";
                  
this.rights.postemperature "+50,+70";
                  
this.rights.poswaterlevel "lowtide,naturaltide,hightide";
                  
this.rights.poswindconditions "5,30"; break;
  case 
"summer":  this.rights.posconditions "rain,fog,cloudy,clearskies";
                  
this.rights.posmoisture "0,100";
                  
this.rights.postemperature "+50,100";
                  
this.rights.poswaterlevel "lowtide,naturaltide,hightide";
                  
this.rights.poswindconditions "10,50"; break;
  case 
"fall":    this.rights.posconditions "rain,fog,cloudy,clearskies";
                  
this.rights.posmoisture "0,60";
                  
this.rights.postemperature "40,+70";
                  
this.rights.poswaterlevel "naturaltide,lowtide";
                  
this.rights.poswindconditions "5,30"; break;
  case 
"winter":  this.rights.posconditions "sleet,snow,cloudy,clearskies";
                  
this.rights.posmoisture "0,50";
                  
this.rights.postemperature "-20,+50";
                  
this.rights.poswaterlevel "naturaltide,lowtide";
                  
this.rights.poswindconditions "20,50"; break;
  default:        
this.rights.timeconditions "3";
                  
this.rights.timemoisture "2";
                  
this.rights.timetempature "1";
                  
this.rights.timewaterlevel "6";
                  
this.rights.timewindconditions "4";
                  
this.rights.lastcheckedmoisture "hour";
                  
this.rights.lastcheckedtempature "hour";
                  
this.rights.lastcheckedconditions "hour";
                  
this.rights.lastcheckedwindconditions "hour";
                  
this.rights.lastcheckedwaterlevel "hour";
                  
TimeCheck(); break;
  }
}

function 
ChangeMoisture() {
  switch(
this.rights.weather.conditions) {
    case 
"rain"Weather1(); break;
    case 
"sleet"Weather1(); break;
    case 
"clearskies"Weather2(); break;
    case 
"cloudy"Weather2(); break;
    default: 
this.rights.lastcheckedmoisture "hour"; break;
  }
}

function 
Weather1() {
 if (
this.rights.weather.tempature =< "50"
  
this.rights.weather.moisture "this.rights.weather.moisture+1";
  
//wet and cold adds mositure
}

function 
Weather2() {
  if (
this.rights.weather.tempature => "70")
   
this.rights.weather.moisture "this.rights.weather.moisture-1";
   
//dry and warm removes moisture



etc...


I would have switched all functions that could use it, but the script itself is too disorganized and I don't feel like wasting my time on it when this is example enough.


EDIT: I also noticed that you call a lot of the same flags to the same value in vast areas. I edited some of it in my example, but I didnt fix the first function. You should use seperate functions to make it more efficient.

I.E:

PHP Code:
//#CLIENTSIDE
function onPlayerChats() {
  switch(
player.chat) {
    case 
"hello"ClearChat(); break;
    case 
"hey"ClearChat(); break;
    case 
"wow"ClearChat(); break;
  }
}

function 
ClearChat() {
  
player.chat "";


Also, you should use PHP or Code tags when posting script, mainly to not piss people off by making it difficult to read and having them just avoid reading the script and helping you.
Reply With Quote
  #6  
Old 10-28-2006, 10:59 AM
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
Quote:
Originally Posted by Gambet View Post
I.E:

PHP Code:
//#CLIENTSIDE
function onPlayerChats() {
  switch(
player.chat) {
    case 
"hello"ClearChat(); break;
    case 
"hey"ClearChat(); break;
    case 
"wow"ClearChat(); break;
  }

PHP Code:
switch (player.chat)
{
  case 
"hello":
  case 
"hey":
  case 
"wow":
  {
    
clearChat();
    break;
  }

Reply With Quote
  #7  
Old 10-28-2006, 01:19 PM
Loakey_P2P Loakey_P2P is offline
SL Oldbie
Loakey_P2P's Avatar
Join Date: Apr 2006
Location: U.S.A
Posts: 137
Loakey_P2P is an unknown quantity at this point
Send a message via AIM to Loakey_P2P Send a message via Yahoo to Loakey_P2P
ok on the first hand , thank's . i dont know about switches , case and break command's , i have seen them used but i myself dont know them . not saying my script isnt organized but it is alot more organzed then some ive seen . mainly by the structure of it (meaning it's all clean and easy to read) . but no one has answered my question about the time checker . just setting the flag to the value of "hour" isnt working , not even "this.hour" . some of the flag's have the same value but there is reasoning behind it . each season has a different set of possable condition's . some may be the same but im not trying to complicate it so i made all different string's . some may have the same value as other's but not all of them . keep in mind that im still working on figureing out the new gscript . ive learned what i can by looking at other script's and seeing how they made thing's happen . but there are still thing's i havent seen used yet or havent figured out how to use or how they work yet . but thank's to everyone for their assistance .
__________________
Shaded Legend Playerworld
-Past accounts - LoakeyTheElf - Loakey_P2P
-Past Servers - Rune - Sparitoria - Shaded Legends
-Past Sl Jobs * ET/LAT/NAT/LAT Admin/Developer/Admin/Head Admin/Asst. Manager/Manager
-Current Job - Retired

*Sorry you must have mistaken me for someone that cares .
Reply With Quote
  #8  
Old 11-05-2006, 02:02 PM
Loakey_P2P Loakey_P2P is offline
SL Oldbie
Loakey_P2P's Avatar
Join Date: Apr 2006
Location: U.S.A
Posts: 137
Loakey_P2P is an unknown quantity at this point
Send a message via AIM to Loakey_P2P Send a message via Yahoo to Loakey_P2P
well i guess no one can tell me why im having problem's getting a database npc to check flag's on another database npc ? ive given the code for the weather npc . if you still need more all i can give is the time npc . which isnt that complicated . it's not very long and not very complicated .

PHP Code:
function onCreated(){
  
setTimer(5);
}
function 
onTimeout(){
  
this.namesday={"Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"};

  
this.sec = (int(timevar 5)) % 60;
  
this.min = (int(timevar 12) + 4) % 60;
  
this.hour = (int(timevar / (12 60)) + 2) % 24;
  
this.days = (int(timevar / (12*60*24)) + 31) % 365;
  
this.years int(timevar / (12 60 24 365)) + 2001;
  
this.season = (int(this.days / (365 4)) - 3) % 4;
  
this.leapyear this.years == int(this.years 4);
  if(
this.season "0"){setstring serverr.season,spring;this.season "spring";}
  if(
this.season "1"){setstring serverr.season,summer;this.season "summer";}
  if(
this.season "2"){setstring serverr.season,fall;this.season "fall";}
  if(
this.season "3"){setstring serverr.season,winter;this.season "winter";}
  
setTimer(5);

any help please ? from anyone . after posting it and looking at it a minute i wonder if i shouldnt case the "if(this.season)" parts ?
__________________
Shaded Legend Playerworld
-Past accounts - LoakeyTheElf - Loakey_P2P
-Past Servers - Rune - Sparitoria - Shaded Legends
-Past Sl Jobs * ET/LAT/NAT/LAT Admin/Developer/Admin/Head Admin/Asst. Manager/Manager
-Current Job - Retired

*Sorry you must have mistaken me for someone that cares .
Reply With Quote
  #9  
Old 11-05-2006, 02:23 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 should never use = for comparison checking. If you are checking a value, it always should be ==.
PHP Code:
if (this.season == 0
Also, don't use setstring. It's outdated.
PHP Code:
serverr.season "spring"
Reply With Quote
  #10  
Old 11-05-2006, 03:02 PM
Loakey_P2P Loakey_P2P is offline
SL Oldbie
Loakey_P2P's Avatar
Join Date: Apr 2006
Location: U.S.A
Posts: 137
Loakey_P2P is an unknown quantity at this point
Send a message via AIM to Loakey_P2P Send a message via Yahoo to Loakey_P2P
sorry i never even noticed that . but can you tell me how to do the new type of script for the problem im having ?
PHP Code:
with(getnpc(Control-WEATHER)){
   
this.rights.lastcheckedmoisture "this.hour";
   
this.rights.lastcheckedtempature "this.hour";
   
this.rights.lastcheckedconditions "this.hour";
   
this.rights.lastcheckedwindconditions "this.hour";
   
this.rights.lastcheckedwaterlevel "this.hour";

i just need this to set the last hour the different part's were checked to set flag's that will be used durring the time out that will check to see if the current time minus the last time it was checked equal's the time param's set between check's . if you can follow that .

ill try to better explain . the first flag's set are the ones that tell the script how many hour's to wait untill checking or changeing a certain weather condition . the following flags are those .
PHP Code:
this.rights.timeconditions "3";
this.rights.timemoisture "2";
this.rights.timetempature "1";
this.rights.timewaterlevel "6";
this.rights.timewindconditions "4"
the next set of flags are the ones that change each time the weather condition's are checked and possable changed . that's why this has been so important couse i wont be able to start working out the bug's till i get time established .
PHP Code:
 this.rights.lastcheckedmoisture "this.hour";
 
this.rights.lastcheckedtempature "this.hour";
 
this.rights.lastcheckedconditions "this.hour";
 
this.rights.lastcheckedwindconditions "this.hour";
 
this.rights.lastcheckedwaterlevel "this.hour"
now when you take "time for checks" and add it to the "last checked time" if you have the current time you do another check . but that can be done more then one way i believe . like if you take the "current time" and subtract the "time required" and get the last checked time, do another check .
__________________
Shaded Legend Playerworld
-Past accounts - LoakeyTheElf - Loakey_P2P
-Past Servers - Rune - Sparitoria - Shaded Legends
-Past Sl Jobs * ET/LAT/NAT/LAT Admin/Developer/Admin/Head Admin/Asst. Manager/Manager
-Current Job - Retired

*Sorry you must have mistaken me for someone that cares .
Reply With Quote
  #11  
Old 11-05-2006, 04:29 PM
Gambet Gambet is offline
Registered User
Join Date: Oct 2003
Posts: 2,712
Gambet is on a distinguished road
What?

Why are you putting quotes around the this. variables? You do realize that you're setting the value of all of that to "this.hour" and not the VALUE of it? You don't put quotes when setting the value of one variable to another.

this.blah = this.test <---Correct

this.blah = "this.text" <---Incorrect, unless you want this.blah to actually equal the words "this.text"
Reply With Quote
  #12  
Old 11-05-2006, 04:50 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
As well as not using quotes, you should not be using getnpc(). For the new scripting engine, we use findnpc():
PHP Code:
with (findNPC("NameOfNPC"))
{
  
// foo

Also inside with () blocks, when you want to retrieve this. flags from outside of the with () block, you must use thiso.:
PHP Code:
with (findNPC("Control-Weather"))
{
  
this.rights.lastcheckedmoisture thiso.hour;
  
// etc

Reply With Quote
  #13  
Old 11-05-2006, 09:18 PM
Loakey_P2P Loakey_P2P is offline
SL Oldbie
Loakey_P2P's Avatar
Join Date: Apr 2006
Location: U.S.A
Posts: 137
Loakey_P2P is an unknown quantity at this point
Send a message via AIM to Loakey_P2P Send a message via Yahoo to Loakey_P2P
ok that should help me out . i didnt think about qouteing it as being a possable problem . but yes im still not sure what all the commands have changed to , im just recently looking into the wikipidia site for info . but that should help . yea after about an hour of messing with the code in both npc's i got the time checking to work right . now i can check to see if the rest work's and start the accumulation part's . thank's to all who threw in their two cent's . : )
__________________
Shaded Legend Playerworld
-Past accounts - LoakeyTheElf - Loakey_P2P
-Past Servers - Rune - Sparitoria - Shaded Legends
-Past Sl Jobs * ET/LAT/NAT/LAT Admin/Developer/Admin/Head Admin/Asst. Manager/Manager
-Current Job - Retired

*Sorry you must have mistaken me for someone that cares .

Last edited by Loakey_P2P; 11-05-2006 at 10:02 PM..
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 10:13 PM.


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