Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Quick Answer Needed (https://forums.graalonline.com/forums/showthread.php?t=37840)

HoudiniMan 09-12-2002 02:16 PM

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 09-12-2002 03:08 PM

I fixed it using setstring, fairly simple, thanks :)

emortylone 09-13-2002 12:33 AM

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

emortylone 09-13-2002 10:51 AM

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

emortylone 09-13-2002 11:27 PM

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

HoudiniMan 09-14-2002 12:50 AM

i used server.strings so we can change it from RC, but thanks anyways

emortylone 09-14-2002 11:11 AM

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

emortylone 09-15-2002 12:50 AM

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

user13-xo 09-16-2002 12:43 AM

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 :D

emortylone 09-16-2002 08:50 AM

I just made a class selection system, and they are better than using client.strings hell yez! Thanks again Kai.
---Shifter


All times are GMT +2. The time now is 12:23 AM.

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