Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
talonnb
Apprentice


Joined: 30 Oct 2004
Posts: 127

PostPosted: 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?
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: 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.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
talonnb
Apprentice


Joined: 30 Oct 2004
Posts: 127

PostPosted: 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?
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: 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.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: 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
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net