|
Setepth Novice
Joined: 17 Dec 2001 Posts: 34 Location: USA
|
Posted: Tue Mar 11, 2003 3:11 am
Help with Random Coding |
Hello, I am wanting to produce a trigger to help with my roleplay (since this action happens so rapidly and i dont have time to emote something inbetween) and i was hoping you might be able to help.
My new character, an orc, has been assigned to be the main forester of his city because he has the advantage of fast regain. However, i'd like to add some flavor to it.
when I enter the command swing tree, the mud responds with "You swing at the tree!" (This happens 10 times before that tree falls and you move onto the next one). Right now i have it triggered so i automatically swing at the tree again once i regain my ability to do so. However, every time it says "You swing at the tree!" I want to have a RANDOM selection of one of these emotes to be present.
1. emote wipes the sweat from his brow before raising his axe for another go...
2. emote grunts harshly as a splinter of wood flys off from his last cut...
3. emote flexes his thick well-bred muscles as he raises his axe into the air...
4. emote switches his sharp axe to his other hand, giving his other side a short period of rest...
5. emote enraged, throws himself into a systematic manner, quickly crunching his axe into the side of the tree.
6. emote smiles a bit, as he cleanly cuts into the tree.
___________________________________________
I want zmud to choose at random one of those emotes for each time it does that. I wont have to bother you then on how to code things like random commands! (im sure you want to hear that)
Thanks again!
Hey meet my character:
Prince Basher, Of Que-Hagan.
At
telnet: elysium-rpg.com port:7777 |
|
|
|
Emit Magician
Joined: 24 Feb 2001 Posts: 342 Location: USA
|
Posted: Tue Mar 11, 2003 3:17 am |
#var TreeEmotes {emote wipes the sweat from his brow before raising his axe for another go...|emote grunts harshly as a splinter of wood flys off from his last cut...|emote flexes his thick well-bred muscles as he raises his axe into the air...|emote switches his sharp axe to his other hand, giving his other side a short period of rest...|emote enraged, throws himself into a systematic manner, quickly crunching his axe into the side of the tree.|emote smiles a bit, as he cleanly cuts into the tree.}
#alias ShowTreeWork {
%item(@TreeEmotes, %random(1, %numitems(@TreeEmotes)))
}
With this combination of %item, %random, and %numitems, you can easily return a random member of any string list.
--------
moon.icebound.net:9000 |
|
|
|
|
|
|
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
|
|