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
kent
Beginner


Joined: 03 Apr 2006
Posts: 29

PostPosted: Mon Jun 03, 2013 10:27 pm   

sitting up a variable to choose from the list of monsters
 
This is the trigger name

#Trigger {^You sense a hidden life form in the area.$}

this is the variable that I am working with

@InvMonster {imp|assi|kend|kobold|goblin}

Finally this is the body:

#loo 1,5 {
cib @invmonster
#wait 4000
}

The problem I am having is each time I one of these monsters. I would like the trigger to fire like this

You sense a hidden life form in the area.

I start to cast 'iceball' @InvMonster

at one of these five monsters, but it is seeing {imp|assi|kend|kobold|goblin} as one monster instead of seperate beasts. help
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Tue Jun 04, 2013 2:37 am   
 
Use %item() to get a specific element. Assuming you want to just pick one at random, use %random().
_________________
EDIT: I didn't like my old signature
Reply with quote
kent
Beginner


Joined: 03 Apr 2006
Posts: 29

PostPosted: Tue Jun 04, 2013 7:33 pm   tried %item() nothing :(
 
MattLofton wrote:
Use %item() to get a specific element. Assuming you want to just pick one at random, use %random().


not sure if I am doing this correctly. %item() is suppost to go in the variable like this

@InvMonster {%item( imp|assi|kend|kobold|goblin)}

or like this

#loo 1,5 {
cib, %item(@invmonster)
#wait 4000
}

both ways didn't not seem work. Anymore ideas?
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Tue Jun 04, 2013 8:10 pm   
 
your syntax is wrong. %item() requires 2 arguments, the first being the stringlist you wish to act upon and the second being the position of the element you want.
_________________
EDIT: I didn't like my old signature
Reply with quote
chris123zugg
Apprentice


Joined: 23 Aug 2013
Posts: 175

PostPosted: Tue Jan 13, 2015 10:17 am   
 
I use seomthing similar...


^(%w) dealt the killing blow to Small Kresh Pack.$
#IF (@np > 500) {vani}

vani = #Loo 10 {v animal %i}
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