Graal Forums  

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

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 09-12-2002, 02:16 PM
HoudiniMan HoudiniMan is offline
Playerworld Administrator
HoudiniMan's Avatar
Join Date: Dec 2001
Location: Calfiornia - USA
Posts: 3,512
HoudiniMan will become famous soon enough
Quick Answer Needed

Quick answers are nice... take a look at this code:
NPC Code:

// NPC made by HoudiniMan (Asst Admin)
if (created) {
timeout=0.1;
this.disp=1;
}

if (timeout) {
if (this.disp<=5) {
message #s(server.notice#v(this.disp));
sleep1;
this.disp+=1;
} else {
this.disp=1;
}
timeout=0.1;
}

if (playerchats&&strequals(#a,HoudiniMan)) {
tokenize #c;
if (strequals(#t(0),notice)) {
set server.notice1=#s(#t(1));
}
}




notice the line: set server.notice1=#s(#t(1));
it is setting the server.flag to "#s(#t(1))" itself instead of what it represents... do i have missing quotes or something? I'm at a loss... thanks
__________________
-HoudiniMan (Chief Playerworld Administrator)
Compulsive Support Center Checker - 5 Years and Change
Graal Support Center

Reply With Quote
  #2  
Old 09-12-2002, 03:08 PM
HoudiniMan HoudiniMan is offline
Playerworld Administrator
HoudiniMan's Avatar
Join Date: Dec 2001
Location: Calfiornia - USA
Posts: 3,512
HoudiniMan will become famous soon enough
I fixed it using setstring, fairly simple, thanks
__________________
-HoudiniMan (Chief Playerworld Administrator)
Compulsive Support Center Checker - 5 Years and Change
Graal Support Center

Reply With Quote
  #3  
Old 09-13-2002, 12:33 AM
emortylone emortylone is offline
Registered User
Join Date: Apr 2002
Location: Control-NPC
Posts: 834
emortylone is on a distinguished road
Strings rae the best way to go XP. There sholud be some way to store a string that is ONLY for that NPC, so it doesn't really SAVE anwwhere, like a this.var, except this.strings are for D/B NPC's. Perhaps this.strings that are stored into a normal NPC?
---Shifter
__________________
Quote:
*Stefan: it seems sometimes they hire newbie scripters everywhere x-x
*Stefan: scripters are sometimes like people that draw paintings
*Stefan: all that counts is that it looks nice
Reply With Quote
  #4  
Old 09-13-2002, 10:51 AM
emortylone emortylone is offline
Registered User
Join Date: Apr 2002
Location: Control-NPC
Posts: 834
emortylone is on a distinguished road
local.strings o_O! LOL... I knew there were new strings, I didn't realize they were! So setstring local.string,value; hmm... I will DEFFINATELY put this to use XP Only clientside though... is there one that isn't? I know you can do a server.string... but those aren't nice
---Shifter
__________________
Quote:
*Stefan: it seems sometimes they hire newbie scripters everywhere x-x
*Stefan: scripters are sometimes like people that draw paintings
*Stefan: all that counts is that it looks nice
Reply With Quote
  #5  
Old 09-13-2002, 11:27 PM
emortylone emortylone is offline
Registered User
Join Date: Apr 2002
Location: Control-NPC
Posts: 834
emortylone is on a distinguished road
I never knew about local.strings... hmm... that is odd. And I know you can clear this.strings, you can clear server.strings too though =/ Can you have this.strings in a NON Database NPC?
---Shifter
__________________
Quote:
*Stefan: it seems sometimes they hire newbie scripters everywhere x-x
*Stefan: scripters are sometimes like people that draw paintings
*Stefan: all that counts is that it looks nice
Reply With Quote
  #6  
Old 09-14-2002, 12:50 AM
HoudiniMan HoudiniMan is offline
Playerworld Administrator
HoudiniMan's Avatar
Join Date: Dec 2001
Location: Calfiornia - USA
Posts: 3,512
HoudiniMan will become famous soon enough
i used server.strings so we can change it from RC, but thanks anyways
__________________
-HoudiniMan (Chief Playerworld Administrator)
Compulsive Support Center Checker - 5 Years and Change
Graal Support Center

Reply With Quote
  #7  
Old 09-14-2002, 11:11 AM
emortylone emortylone is offline
Registered User
Join Date: Apr 2002
Location: Control-NPC
Posts: 834
emortylone is on a distinguished road
Heh, it's funny, we are all pretty good scripters, but no one has really messed with technicalities. If you're not sure something will work, you find another way, lolz. Like I get tired of setting client.strings just to store temp data, it gets annoying x.X I use this.vars though for numbers, that's most efficient, but data you can't do that with
Server.strings = bad x.X I h8 them, and 99% of scripts shouldn't EVER contain them. OCCASIONALLY you may find a use for one, but then with (getnpc(Control-NPC)) { setstring this.string,data;}
He he. Best way I would say. Plus you can control and manipulate it better.
---Shifter
__________________
Quote:
*Stefan: it seems sometimes they hire newbie scripters everywhere x-x
*Stefan: scripters are sometimes like people that draw paintings
*Stefan: all that counts is that it looks nice
Reply With Quote
  #8  
Old 09-15-2002, 12:50 AM
emortylone emortylone is offline
Registered User
Join Date: Apr 2002
Location: Control-NPC
Posts: 834
emortylone is on a distinguished road
Okay, so I should've specified. Yes, TECHNICALLY numbers are data, but data can be more. Non-numerical data (along with numerical if you so wish)
---Shifter
__________________
Quote:
*Stefan: it seems sometimes they hire newbie scripters everywhere x-x
*Stefan: scripters are sometimes like people that draw paintings
*Stefan: all that counts is that it looks nice
Reply With Quote
  #9  
Old 09-16-2002, 12:43 AM
user13-xo user13-xo is offline
Registered User
Join Date: Nov 2001
Location: California
Posts: 297
user13-xo is on a distinguished road
Send a message via AIM to user13-xo
Quote:
Originally posted by Kaimetsu


On the server you can use this.strings and then clear them when you're finished. And local.strings are old, but they're not mentioned anywhere.
I forgot how i learned about them, but they are really useful sometimes
Reply With Quote
  #10  
Old 09-16-2002, 08:50 AM
emortylone emortylone is offline
Registered User
Join Date: Apr 2002
Location: Control-NPC
Posts: 834
emortylone is on a distinguished road
I just made a class selection system, and they are better than using client.strings hell yez! Thanks again Kai.
---Shifter
__________________
Quote:
*Stefan: it seems sometimes they hire newbie scripters everywhere x-x
*Stefan: scripters are sometimes like people that draw paintings
*Stefan: all that counts is that it looks nice
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 01:17 AM.


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