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 10-23-2005, 06:45 AM
Mykel Mykel is offline
:o
Mykel's Avatar
Join Date: May 2002
Location: Canton, Ohio.
Posts: 5,526
Mykel has a spectacular aura about
Send a message via AIM to Mykel Send a message via MSN to Mykel
Scripting Guidance

Okay, so I've recently taken up an interest in scripting. So far all I am doing is looking at scripts and trying to understand them, and then editing them in some other way to try new things. I could use your help some. If someone could please explain the following script in the most basic of terms possible, it'd be greatly appreciated.

NPC Code:
if (playerchats && strequals(#a,Mykel)) {
if (startswith(/skin,#c)) {
setcharprop #C0,#T(#e(6,-1,#c));
}
}


I understand the part about it having to be my account, and it starting with /skin and then the color, but I don't understand how the
NPC Code:
setcharprop #C0,#T(#e(6,-1,#c));

makes it all work. Thank you for your help.
__________________
(Married to Skyld)

Last edited by Mykel; 10-23-2005 at 06:57 AM..
Reply With Quote
  #2  
Old 10-23-2005, 07:11 AM
LilNiglet LilNiglet is offline
Registered User
Join Date: Jun 2001
Posts: 3,178
LilNiglet is on a distinguished road
NPC Code:
setcharprop #C0,#T(#e(6,-1,#c));



setcharprop - sets THIS npc's property
#C0 - property for skin color
#T(string) - trims spaces off start and end of string, not needed here
#e(startindex,stopindex,string) - takes a slice of a string from startindex to stopindex. 6 is determined by counting characters (including spaces!), so it'd be / = 1, s = 2, k = 3, and so on. remember, spaces count. -1 means to not take a stopindex, but use the end of the string as the terminator. #c is the player's chat string.
Reply With Quote
  #3  
Old 11-03-2005, 11:40 PM
SyLaTAC SyLaTAC is offline
<3
Join Date: Mar 2005
Location: Irwin Idaho (look it up you wont find it that easy!)
Posts: 64
SyLaTAC is on a distinguished road
Send a message via AIM to SyLaTAC
wow...even that helped me thx
Reply With Quote
  #4  
Old 11-04-2005, 02:31 AM
Lance Lance is offline
dark overlord
Lance's Avatar
Join Date: Sep 2003
Location: Space Jam Mountain
Posts: 5,072
Lance is on a distinguished road
If you want that #T to work properly, the #e should start counting at position 5, not 6.

It starts from zero, Tupper.
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 07:11 PM.


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