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


Joined: 18 Oct 2003
Posts: 18

PostPosted: Wed Jan 07, 2004 6:26 am   

Random Player Picking in a Room
 
Hello there, I'm pretty new to Zmud's scripting, all..

Would anyone know how to gather information for like whos in one room, then like throw a ball or something at random people in the room instead of just the same one all the time??

If anyone happens to know how this could be done, please help a new scripter out, thanks.

Peace, Happy New Years.
Reply with quote
Caled
Sorcerer


Joined: 21 Oct 2000
Posts: 821
Location: Australia

PostPosted: Thu Jan 08, 2004 4:09 pm   
 
For a precise answer, please prive an example of what it looks like when you see a list of names in the room. IT can be done... probably. For example... if you have something like this:

Name of the Room
Description of
the room spanning
several lines
Name1 is here.
Name2 is here.
Name3 is here
Exits: N, E and SE

Then this would work:
#CLASS {randomthrow}
#AL setn {setn=%null;look}
#VAR setn %null
#TR "setn" {(%w) is here.} {#ADDITEM setn %1}
#AL rthrow {throw ball to %item( @setn, %random( 1, %numitems( @setn)))}
#CLASS 0
Reply with quote
RapidRunner
Beginner


Joined: 18 Oct 2003
Posts: 18

PostPosted: Fri Jan 09, 2004 4:23 am   
 
Well.. mud has no room names.. and no descriptions...
The general room has no exits..

I don't know how to make it work with those things out...

it locked Zmud up when i tried it...
Reply with quote
Caled
Sorcerer


Joined: 21 Oct 2000
Posts: 821
Location: Australia

PostPosted: Fri Jan 09, 2004 11:10 am   
 
Then show me an example of what you DO see, so I have something to work with...
Reply with quote
RapidRunner
Beginner


Joined: 18 Oct 2003
Posts: 18

PostPosted: Fri Jan 09, 2004 2:31 pm   
 
ok, well.. All you see is...

Pabach is here.

You see no exits, no room name or description...

If that helps out, please lemme know..

Thanks.
Reply with quote
Danlo
Magician


Joined: 28 Nov 2003
Posts: 313
Location: Australia

PostPosted: Fri Jan 09, 2004 3:13 pm   
 
Try this:

#trigger {(%w) is here.} {#additem PlayersinRoom {%1};#alarm +1 {throw ball %item(@playersinroom,%random(1,%numitems(@playersinroom)));#var Playersinroom %null}}
Reply with quote
fireangel37
Beginner


Joined: 09 Jan 2004
Posts: 17

PostPosted: Fri Jan 09, 2004 5:28 pm   
 
That's pretty cool. I want to do something like this, but have a list of people and items displayed in my status window. I used something like this and couldn't sort elements out of the string list. That, and I can't figure out how to get the list to stick until I change rooms...
Reply with quote
RapidRunner
Beginner


Joined: 18 Oct 2003
Posts: 18

PostPosted: Sat Jan 10, 2004 1:49 am   
 
hehe, it works fine... i had to set Zmud's special characters back to default.. i forgot i changed the ; to ~ for command stacking :P

oh well.. Peace, thanks a lot for the help :)
Reply with quote
RapidRunner
Beginner


Joined: 18 Oct 2003
Posts: 18

PostPosted: Mon Jan 12, 2004 2:17 am   
 
Umm... It targets only the same person in the room all the time, it don't go to random people in the same room...

I dunno what to do bout that :(
Peace, thanks in advance..
Reply with quote
Danlo
Magician


Joined: 28 Nov 2003
Posts: 313
Location: Australia

PostPosted: Mon Jan 12, 2004 8:44 pm   
 
Hmmm, it works fine for me. It may simply be that the alarm of 1 second is not long enough to capture all the players in the room. Try increasing it to 2
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