Graal Forums

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

XeroMaster 01-05-2002 08:34 AM

cloths changer
 
can some one tell me how I might make a cloths changer?
I want it to have 5 slots
and saves the following

head
sleeves
skin
belt
coat
shoes
hat
+ the outline of your body..(normaly black)
thanks

mikepg 01-05-2002 08:55 AM

...
 
these can easily be changed with the message codes at the bottom, and saved with strings.

you could have something like:

setstring client.suit1,#C0,#C1,ect,ect,ect,ect;

and the outline is #C5, which stefan didnt bother adding into newfeatures or commands.rtf.

Python523 01-05-2002 08:58 AM

saving example:
setstring outfit1_c0,#C0;
loading example:
setplayerprop #C0,#s(outfit1_c0);

mikepg 01-05-2002 09:01 AM

hmmm
 
that would work python, but the player flag list would get filled up quick!

it would be better to use
setstring client.suit1,#C0,ect,ect....,ect;

and use
setplayerprop #C0,#I(client.suit1,0);


that way, it wouldnt take up so many lines in the flag section.

TDO2000 01-05-2002 09:57 AM

Re: hmmm
 
Quote:

Originally posted by mikepg
that would work python, but the player flag list would get filled up quick!

it would be better to use
setstring client.suit1,#C0,ect,ect....,ect;

and use
setplayerprop #C0,#I(client.suit1,0);


that way, it wouldnt take up so many lines in the flag section.

normally u use addstring or replacestring for stringlists because this would't probably work
the string u get with your script:

example
client.suit1=black,yellow,white,red

what stringlist look like:
client.suit1="black","yellow","white","red"

so u couldn't normally read the parts with #I

mikepg 01-06-2002 02:39 AM

Re: Re: hmmm
 
Quote:

Originally posted by TDO2000


normally u use addstring or replacestring for stringlists because this would't probably work
the string u get with your script:

example
client.suit1=black,yellow,white,red

what stringlist look like:
client.suit1="black","yellow","white","red"

so u couldn't normally read the parts with #I

no, youre wrong. graal does not put ""s in because those are characters. The only way one of those is used, is if you have a comma in the string ie: "black, is good",yellow;
and you have to put "" in manually. You think I'm wrong still, go test this script i just wrote:

NPC Code:

// NPC made by War Lord Mpg2
// suit1=head,body,skin,feet,coat
if (playerenters) {
timeout = .1;
setstring suit1,#3,#8,#C0,#C3,#C1;
setplayerprop #3,head816.png;
setplayerprop #8,body2.png;
setplayerprop #C0,blue;
setplayerprop #C3,black;
setplayerprop #C1,white;
}
if (playertouchsme) {
}
if (playerchats&&strequals(#c,load)) {
setplayerprop #3,#I(suit1,0);
setplayerprop #8,#I(suit1,1);
setplayerprop #C0,#I(suit1,2);
setplayerprop #C3,#I(suit1,3);
setplayerprop #C1,#I(suit1,4);
setplayerprop #c,loaded!;
}



then come back and tell me im wrong :)

TDO2000 01-06-2002 04:13 AM

just use addstring dude and watch the string after this...

if(playerenters){
addstring test,lala;
addstring test,lala2;
}

would be:
test="lala","lala2"

Saga2001 01-06-2002 04:54 AM

tell your mom i said hi.

Saga2001 01-06-2002 04:55 AM

oh and thanks

mikepg 01-06-2002 05:14 AM

Quote:

Originally posted by TDO2000
just use addstring dude and watch the string after this...

if(playerenters){
addstring test,lala;
addstring test,lala2;
}

would be:
test="lala","lala2"


why would you want to do that? The only time i can think of when you want to use "addstring" is when you have strings set already, and you want to add on to it without changing information. Going back to the topic...addstring is not needed here. my way works fine. it works, i scripted, i tested it.


All times are GMT +2. The time now is 09:15 AM.

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