|
talonnb Apprentice
Joined: 30 Oct 2004 Posts: 127
|
Posted: Mon Dec 11, 2006 8:51 am
Accessing String Lists Oddly |
I am currently working something that requires an array of targets. Problem is, I use an incrementing variable to access them in a syncing order.
This is what I have so far, but I can't get it to access the list properly.
Each time I pull this alias, I want it to project a hallucination on a specific target.
#var halllevel [halllevel+1]
mind hallucinate @halltar.@halllevel @hallucination
#echo DOING HALLUCINATION: @hallucination
soooo, I'm sure I'm not accessing the stringlist halltar properly, since it isn't coming up properly for whatever reason. Help please? |
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Mon Dec 11, 2006 9:56 am |
Firstly, that syntax [hallevel+1] may not work. I'd check it - you haven't referenced the contents of @hallevel there, just it's name.
Secondly, you are referencing the string list wrong - @varname.keyname is the syntax for looking up data from record variables, and I assume that's the type of variable you're accessing, but zMUD has no idea that that the @hallevel is part of the variable name. Try using @{halltar.@hallevel} and see if that solves it - I know that works in CMUD. |
|
|
|
talonnb Apprentice
Joined: 30 Oct 2004 Posts: 127
|
Posted: Tue Dec 12, 2006 5:43 am |
New issue.
Thanks to the above response as it works perfectly now.
#var hallucinate {%-1}
Now, I have this in an alias to capute all the words after so I can hallucinate it. Problem is if I do something like,
dohal A solemn chaplain glares about, seemingly upset with the world as he yells, "Who gave me this sickness!"
It hallucinates everyone properly, but it ignores the quotes so they see
A solemn chaplain glares about, seemingly upset with the world as he yells, Who gave me this sickness!
Any ideas? |
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Tue Dec 12, 2006 7:34 am |
Quoting them out with ~ is the easiest way, but that might not be so great for fast typing.
|
|
|
|
Vijilante SubAdmin
Joined: 18 Nov 2001 Posts: 5182
|
Posted: Tue Dec 12, 2006 11:27 am |
It is always going to be tough to keep those quote characters in there. You will probably have to switch from an alias to an #ONINPUT trigger so that you can capture directly into a variable. Then you have to always use %expand to control how that variable is used. Even then you may still have problems.
|
|
_________________ The only good questions are the ones we have never answered before.
Search the Forums |
|
|
|
|
|