![]() |
strlen + #e
well im having a little scriptproblem
what i want is for it to take each letter of a string one by one, but i dont think im doing it quite right NPC Code: i guess thats where ive narrowed it to not working, because it wont take it piece by piece. |
lets say this.word2 = hello
Your script will set the string accordingly this.word2 = h this.word2 = e this.word2 = l this.word2 = l this.word2 = o if you want it as a list you will have to use addstring example NPC Code: |
Either PD has your answer, or you need to be more descriptive of your problem. Becouse the rest looks right.
|
ok i missed exactily what my point was, so far it is working right with the way you suggested to fix it, but it broke up all the parts and made a list with commas like
h,e,l,l,o but i fixed it thanks for your help :) |
setstring tword,Blahblah;
for (i=0;i<strlen(#s(tword));i++) { setstring tword2,#s(tword2)#e(i,1,#s(tword)); } gives you tword=Blahblah tword2=BlahblahB I dont know why it puts the B on thend, musta buggered up somewheres. |
Quote:
|
Quote:
|
Quote:
|
setstring tword2,;
setstring tword,Blahblah; for (i=0;i<strlen(#s(tword));i++) { setstring tword2,#s(tword2)#e(i,1,#s(tword)); } Still gives BlahblahB, dunno why. |
Quote:
|
Quote:
"setstring tword2,;" That is "unsetting" a string.. You cant assume stuff like that, ye know? |
Quote:
|
Quote:
|
Quote:
Ok... nor does that explain why the B is on the END of your string... OH, wait, did you use the debugger to view the string, or did you press F4 and look at the flag list? If you used F4, it might have re-parsed through the script and did what I said at the beginning. That would explain the B at the end rather than the beginning. Yeah, I just tested out that theory. That's exactly what it seems to be doing. Obviously a bug, as it shouldn't be going inside of a loop when it sets initial strings. Well, it's a bit awkward that it would even set strings before entering the level anyway... |
Quote:
|
All times are GMT +2. The time now is 04:12 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.