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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
ShadowWind
Newbie


Joined: 21 Feb 2007
Posts: 8

PostPosted: Wed Feb 21, 2007 10:30 am   

Completely Confused
 
Ok, I'm trying to figure out how to make string lists and I really don't get it. I have this line of text {You finish mixing up your * potion} and I want to make it so I can have a number of different responses. I was told I should make a string list of all the different responses, but I'm not sure it that will work since the responses are not just one word. An example of the responses would be {say done mixing potion} and {emote admires a perfect potion} So, how would I set it up so I could have the same line of text with these responses randomly selected one at a time?
Reply with quote
Guinn
Wizard


Joined: 03 Mar 2001
Posts: 1127
Location: London

PostPosted: Wed Feb 21, 2007 11:38 am   
 
A stringlist doesn't have to be single word items.

If there are no special characters then you can just create them as below.
myList = {say done mixing potion|emote admires a perfect potion|emote dances about, waving a potion bottle in the air|say Yup, that's done}

If there are then just put each string in quotes.
myList = {"say {done} mixing potion"|"emote (admires a) perfect potion"|"emote dances about, +-*waving a potion bottle in the air"|"say Yup, that's done"}

Then to pick a random one
#say %item(@myList,%random(1, %numitems(@myList)))
_________________
CMUD Pro, Windows Vista x64
Core2 Q6600, 4GB RAM, GeForce 8800GT
Because you need it for text... ;)
Reply with quote
ShadowWind
Newbie


Joined: 21 Feb 2007
Posts: 8

PostPosted: Thu Feb 22, 2007 7:38 am   
 
That worked perfectly, thank you!!!
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD 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