![]() |
defining script from string
Ok heres the deal:
1) I set a string like this: setstring client.Test,##v(this.test)##s(client.Test2); 2) It looks like this in the flag list: client.Test=#v(this.test)#s(client.Test2) 3) The variable this.test has a value of lets say 5 and string client.Test2=blah 4) I want this code to make it show 5blah not #v(this.test)#s(client.Test2): setplayerprop #c,#s(client.Test); How can I get that to work right, and I have to have it in the string like that so that it will show the current value in the variables and strings |
are you talking about something like this????
NPC Code: didnt understad question that well |
he wants message codes to be parsed for message codes...
like if #c contains the chat "#s(***)", #c would read the value of string ***, not literally "#s(***), origianally it was like this, but it caused issues back in 1.31, so message codes no longer act like this |
like this
NPC Code: the players text should always show the current value of this.test dont know how to get that to work right |
you cant put a message code in a message code
end of story close thread |
Quote:
|
Quote:
so when #c is #f, then #c is door.gif? no, people were abusing it, so it was "fixed" in version 1.38 or so |
-=Josey=-
I forgot how to do this whenever I left and came back, but a friend helped me out again. NPC Code: |
-=Josey=-
Oh yeah, use something like : setstring client.test, strtofloat(#s(client.test))+1; I do believe that should work. |
Quote:
:D |
Bah! Guess i'll have to change my script, oh well :(
|
It would be possible to support it
(the message code stuff is currently parsed at runtime, but only the first time it is seen). Problem is that this would crash Graal if it's producing an endless loop, and people always do scripting errors, so it's not supported. |
Why would that crash graal, is it a overflow issue?
You should just limit the number of times it can loop, could that work? |
Hmm actually if we add a new message code
like #M (to decode a message code) or so then it could work, then you would only need to keep care that there is no #M in the string. But I don't know if this is really needed, it will be hard to support in the new scripting engine we are planning |
Quote:
names, but with fast lookup, and the message codes will be pre-parsed so such a recursive message code will not work. |
Re: defining script from string
i am not sure, but couldn't you do something like setting them over time?
setstring client.Test,#; client.Test,#s(client.Test)#v(this.test); client.Test,#s(client.Test)#; client.Test,#s(client.Test)#s(client.Test2); or is # too much of a keyword? There has to be soime way. Quote:
Quote:
char* stringnames[] = {"string"}; char* stringvalue[] = {"value"}; no, probably structs would work better. Quote:
|
Quote:
|
Quote:
|
Quote:
|
Quote:
|
bah, i doubt the way i used it, that it would be any slower, oh well
|
| All times are GMT +2. The time now is 08:22 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.