Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Reading Sub-strings (https://forums.graalonline.com/forums/showthread.php?t=783)

JoMomma 03-31-2001 01:30 AM

There has GOT to be a way to do this. I don't know if it's thru the new way of scripting on the NPC Server, or an undocumented (or perhaps documented but unnoticed) command.

Let's say we have the string: "say this is a test". Now I want to get the part after "say". I can easily detect the "say" part, but how do I get the rest of it without the say part? Think about things like:
"play dead" "play dancey" etc etc for bomy pets
"setbomy name number" for bomy class

Are these just built-in to the npc and they check every single possibility, and have to change the code a bit once a new animation is added or a new bomy "body" is made?

Tyhm 03-31-2001 02:48 AM

In reverse order:

if(playerchats&&strcontains(#c,play dead)){

if(playerchats&&strcontains(#c,say)){
message #s(#c-say);
}

I've seen that used a few times with varying degrees of success. Personally, I just steer clear of string manipulation....say and fire is about as far as I'll go there. =P

Admins 03-31-2001 04:34 AM

no there is no string parsing yet,
although it would be quite easy to make,
may be i should add it soon

grim_squeaker_x 03-31-2001 06:15 PM

Quote:

Originally posted by Stefan
no there is no string parsing yet,
although it would be quite easy to make,
may be i should add it soon

That would be really useful for script reducal in some cases ^^


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

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