Graal Forums

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

scottman5587 03-03-2002 09:38 PM

help with strings
 
what does the parameter part of the string scrip do???

Dustey 03-03-2002 11:08 PM

here is how a string works. are u sure u are working with strings not ganis?

setstring stringname,stringvalue;

stringvalue can be a numbers or letters. Its used to save information so that it can be accesed by other npcs and itself.
If im wrong in any of that let me know

Dustey 03-03-2002 11:15 PM

Re: help with strings
 
Quote:

Josey
-=Josey=-
A string is a stored variable that can be "called upon" at a latter time to be used for various things. Like in Graal, your account name is a string. To do something with it you would use something like:

code:--------------------------------------------------------------------------------
if (playerenters){
message Hello #a;
}--------------------------------------------------------------------------------

or
code:--------------------------------------------------------------------------------
if (playerenters&&strequals(#a,joseyisleet)){
message Hey Josey!;
playerrupees+=500;
}
--------------------------------------------------------------------------------

It's all fairly simply to learn and use.

take a look at that that was in another thread i found :megaeek:

joseyisleet 03-04-2002 05:18 AM

-=Josey=-
Also, to acces a string you've set yourself use something like:
NPC Code:

if (playerenters){
setstring client.test,hi;
timeout=1;
}
if (timeout){
setplayerprop #c,#s(client.test);
}


You can also use numbers with something like:
NPC Code:

if (playerenters){
setstring client.test,11;
timeout=1;
}
if (timeout){
setplayerprop #c,strtofloat(#s(client.test));
}


If you need any more help contact me via AIM or MSN Messenger. My contact information is in my signature.

SaijinGohan 03-07-2002 06:25 AM

And remember, when calling a number from a string use strtofloat otherwise just use #s(stringname);

right...?

screen_name 03-07-2002 10:38 AM

well, if its a string array, you would use #I(stringname,index)


All times are GMT +2. The time now is 11:55 PM.

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