• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[JASS] Rolling

Status
Not open for further replies.
Level 2
Joined
Oct 24, 2005
Messages
7
For my new RPG i need a Trigger, if a Player enters "-Roll 1-100" it should come a Message to all like this "Player <1-12> rolls a <1-100>.

Is this makeable? I need that for Raids in RPG's :>
 
Level 12
Joined
Apr 29, 2005
Messages
999
Ok here is how to do:

1. Create a new trigger.
2. Add an event Player - Chatt Message
3. Type in the text you want the trigger to detect.
4. Since there is no generic player event you have to copy
this event as many times there are players in the map and change the player number for each one.
5. In actions add Game - text Message, either you can use auto timed or specific duration.
6. In the text select Concentrate Strings. Now you have two strings.
7. In the first string select Player - Player Name.
8. In the second string select Concentrate Strings again so you have another string.
9. In the first of these new strings type " rolls a ". The spaces are important. This far it would resoult in "<Name> rolls a".
10. Now to the random vaule. In the last string select Conversion - Convert Integer To String.
11. In this vaule then, select Math - Random Number and choose the vaules you want to have. (1 and 100).


The trigger will now look like this:


Roll trigger
Events
Player - Player 1 (Red) types a chat message containing chat as An exact match
Conditions
Actions
Game - Display to (All players) the text: ((Name of (Triggering player)) + ( rolls a + (String((Random integer number between 1 and 100)))))

Keep in mind that if you want the randomized vaule stored for using it later, you have to giva an integer variable a reandom vaule between 1 and 100 before
line with all that text stuff. Then instead of choosing that random vaule in the last string you choose the variable.

The trigger will now look like this:

Roll trigger
Events
Player - Player 1 (Red) types a chat message containing chat as An exact match
Conditions
Actions
Set RandomVauleVar = (Random integer number between 1 and 100)
Game - Display to (All players) the text: ((Name of (Triggering player)) + ( rolls a + (String(RandomVauleVar))))

This will first store a random vaule in the RandomVauleVar variable and then display the whole text with the vaule of RandomVauleVar.


And, this thread was not worthy to be here in the JASS forum. This has nothing to do with JASS, unless that you can make it in JASS.
 
Status
Not open for further replies.
Top