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
getirdros@
Novice


Joined: 10 Jul 2006
Posts: 43

PostPosted: Mon Jul 10, 2006 2:01 pm   

Needed: A zmud trigger script
 
Hi, I've been a zmud user for some time now but the complexity of the set of triggers I need is beyond my figuring out, very frustrating, and the one person I know that might be able to do it refuses so I am hoping someone on here would be willing to help me.

I am trying to set up a sort of roulette wheel on the mud I am an imm on as an OOC game for the mortals to play with me every so often. I want the selection of the prize to be completely random however, not something I pick, there are both positive prizes and negative prizes (a balance of the two), sort of like russian roulette but without the gun ya know. I'm not even sure what all would be needed to do this. It would be triggered by the mortal saying spin wheel, which would set of a room echo (which i can do easily enough) but I cannot think of how to set it up so that also sets off other triggers to randomly run through the available prizes and select one after say 30 secs or something and then announce to the room the prize won.

If anyone can help me it would be greatly appreciated.
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Mon Jul 10, 2006 3:02 pm   
 
First, you would need the trigger that matches a mortal telling you to spin the wheel. In this trigger, you probably want to set some variable to 1 to indicate that the wheel is already spinning. You would check this variable before setting it to 1 and doing anything else, so that you don't spin that someone else doesn't spin the wheel again while it is already spinning. If you don't care about multiple mortals spinning the wheel at the same time, then forget about the variable.

Next, the trigger would set up a temporary alarm that lasts 30 seconds. A pattern of +30 indicates that the alarm is temporary and it will fire after 30 seconds. In this alarm, you would use the %random function to generate a random number, which you would most likely use as the item index for a stringlist variable. The stringlist would contain the possible prizes. If you are using the variable to prevent multiple mortals from spinning the wheel, then it would be reset to 0 at this time.
_________________
Kjata
Reply with quote
getirdros@
Novice


Joined: 10 Jul 2006
Posts: 43

PostPosted: Mon Jul 10, 2006 3:09 pm   
 
hrmm, the spin wheel trigger i can manage, just not sure about the scripting. like i can gag channels fine i know the whole #cap #gag thing just not sure what sort of thing in the value field is needed to get the rest, i'm not worried about multiple spinning so the variable is not needed. hrmm, the alarm bit i should be able to work out on a trial and error basis.
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Mon Jul 10, 2006 3:26 pm   
 
An alarm is just like a trigger. Check out the #ALARM command in the help file for specifics on the syntax, but the basic syntax is just like a trigger: a "pattern" which tells it when it shoudl fire (a +30 pattern would make it temporary and have it fire 30 seconds from when it is created) and the value part containing the commands to execute when the alarm fires.

As for the stringlist, you can make this through the settings editor easily. Just create a new variable, select stringlist as its type and enter the prizes one by one in the stringlist. The strings in this stringlist could perhaps even be whole commands that you would send to the MUD to create or give the prizes to the mortals.

As for randomly choosing one of the items in this stringlist, look at the help file entry for %item and %random. The %item accepts a stringlist as one of its parameter and the numbered index of the item within that stringlist to return (starting from 1). The %random function, accepts as its parameters the minimum and maximum values that zMUD should use to generate a random number.

If you need more help, post again and we can give you a sample script for you to study.
_________________
Kjata
Reply with quote
getirdros@
Novice


Joined: 10 Jul 2006
Posts: 43

PostPosted: Mon Jul 10, 2006 3:29 pm   
 
i think i should be able to work from what you have posted. thank you so much Kjata for all your help. :)
Reply with quote
Troublemag
Wanderer


Joined: 14 Jul 2004
Posts: 83

PostPosted: Mon Jul 10, 2006 5:29 pm   zmud/mobprogs
 
This isn't exactly zmud related, but, if you're an imm, why not do it as a mob/obj prog? The limitations of zmud would be that you would have to be online to have it useable whereas an in-game prog would allow players to use it when you're not on.
Reply with quote
Vitae
Enchanter


Joined: 17 Jun 2005
Posts: 673
Location: New York

PostPosted: Tue Jul 11, 2006 12:22 am   
 
Troublemag, as he pointed out, he wants it to be run OOC thru him.

getirdros@, do a search on here for roulette. there are few mentions.
_________________
http://www.Aardwolf.com
Reply with quote
getirdros@
Novice


Joined: 10 Jul 2006
Posts: 43

PostPosted: Tue Jul 11, 2006 1:17 pm   
 
i'm actually a woman, easily confused no worries ;). and ya, i want to run it myself, also i know about as much about writing mob progs as i do zmud triggers so.

thank you Vitae, I'll do that :)
Reply with quote
getirdros@
Novice


Joined: 10 Jul 2006
Posts: 43

PostPosted: Tue Jul 11, 2006 1:32 pm   
 
ok so I checked out the few other boards. if the prizes were money based they would work
but the prizes aren't only money based their also things like xp, quest points, etc etc.
I kinda see how I need to make it but at the same time I don't. I'm a very visual
learner, if someone does it infront of me while explaining I can grasp it but have
a harder time just learning from bits and pieces.

i have the trigger that kicks the spinning at least

pattern: %w says 'spin wheel'
value: echo As %1 grabs the wheel and sets it spinning a quick clacking sound fills the air as the pegs strike the wheel's marker. Gradually the clacking sound becomes slower and more audible as the giant wheel slows down until it stops.

now I'm assuming after this line I can set off another trigger for the number generator or put it into
the value itself just not sure how to combind the #random and the #item, i have the stringlist made
with the prizes at least.
Reply with quote
getirdros@
Novice


Joined: 10 Jul 2006
Posts: 43

PostPosted: Tue Jul 11, 2006 1:54 pm   
 
ok so I set up another trigger, #1 {%item( @prizeList, %random( 1, 10))}
this randomly selects the prize, which is good i actually managed to do something on my own, :D
however i can't figure out the alarm portion, I'm putting what is shown as an example but
can't figure out how to use it to delay the showing of the prize, give a bit of suspense right.
Reply with quote
getirdros@
Novice


Joined: 10 Jul 2006
Posts: 43

PostPosted: Tue Jul 11, 2006 2:06 pm   
 
ya'll are gonna get tired of me posting

pattern: +roulette
value: #ALARM {+roulette} {#SUSPEND roulette}
#ALARM "roulette" {+30}
#RESUME roulette
gt prize

i added a %1 tells the group +roulette
to trigger the alarm but all it does is make a trigger saying +roulette #suspend roulette
so its kinda working but can't get the delay of 30seconds that i want
Reply with quote
phranq
Beginner


Joined: 11 Jul 2006
Posts: 13

PostPosted: Tue Jul 11, 2006 2:24 pm   
 
I can't really tell what you're going for from the last post there. You want something like

#TRIGGER {I'm not too clear what you're trying to do, but whatever message you want to start the 30 seconds here} {#ALARM +30 {gt prize}}

Either you're overthinking this, or I'm just completely confused as to what you're trying to do with the alarm. I'm just assuming you want it to wait 30 seconds after the wheel is spun to give the prize?


Last edited by phranq on Tue Jul 11, 2006 2:37 pm; edited 1 time in total
Reply with quote
getirdros@
Novice


Joined: 10 Jul 2006
Posts: 43

PostPosted: Tue Jul 11, 2006 2:34 pm   
 
YAY! Thank you phranq, that worked much better. i was working off the example zmud help file gives
I didn't find it very helpful but gave it a shot. My roulette wheel now works :) thank you so much for
your help everyone!
Reply with quote
phranq
Beginner


Joined: 11 Jul 2006
Posts: 13

PostPosted: Tue Jul 11, 2006 2:38 pm   
 
Glad to help...always got to think simple, heh. The alarm command is most useful for that purpose...waiting a certain amount of time before performing an action. Have fun with roulette.
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