Killi Cloud Posted March 13, 2014 Share Posted March 13, 2014 Maybe it's just getting late and google does not like me, but I am currently trying to use llGetsubstring to get the letter from a string and then add to a vector name.May not make sence, so here...vector texta = <0.0, -0.0, 0.0>;string words = "abc";(vector)text + llGetSubString((string)words, 0, 0) // THIS LINE NOT WORKING FOR ME How would i go about doing this or am i doing it all wrong? (This is so i can change the texture vector baced on string without each texture change every time i make changes) Link to comment Share on other sites More sharing options...
LepreKhaun Posted March 13, 2014 Share Posted March 13, 2014 It's a bit unclear what you're attempting but if you're trying to dynamically change the name of a variable, that can't be done. If you're wanting to use different textures according to a letter in a supplied string, extract the letter into a string variable and then use an if else chain to set a variable to the one you wish to display. Link to comment Share on other sites More sharing options...
Killi Cloud Posted March 13, 2014 Author Share Posted March 13, 2014 See i thought someone was going to say that and i was tring to take the easy way out as i did not want to have to make 30 or so if and else commands but set the string and then work out from that the vector =p Link to comment Share on other sites More sharing options...
LepreKhaun Posted March 13, 2014 Share Posted March 13, 2014 Though that is supported in some languages, LSL limits us to changing only the values within named variables, whose names are pretty much written in stone. Now, if only we had a switch statement! Link to comment Share on other sites More sharing options...
Killi Cloud Posted March 13, 2014 Author Share Posted March 13, 2014 Problem from when i come from PHP and JS the rules change, I will try making the vector to a list and output based on string and see if that works nay better as if and else make this to long and to much of a lag. Link to comment Share on other sites More sharing options...
LepreKhaun Posted March 13, 2014 Share Posted March 13, 2014 Killian Jayaram wrote: Problem from when i come from PHP and JS the rules change, I will try making the vector to a list and output based on string and see if that works nay better as if and else make this to long and to much of a lag. I feel that would be an excellent approach to the problem! I wish you good luck in implementing it and if you encounter any problems with it, just ask. 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Please take a moment to consider if this thread is worth bumping.
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now