• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Chance Trigger

Level 6
Joined
Aug 5, 2006
Messages
126
DISCLAIMER: I'm not so sure how it works again, so please bear with me and have kind but critical feedback...since I can't get my computer to Normal Mode I can't test it again, how can I make the trigger tags?

FAQs

Q: What the Hell is a Chance Trigger?
A: A Chance trigger is a trigger where you get to rely on "pure" luck....Which means you need to get the "rare" stuff by chance from any other RPG game like Diablo II, KotoR, RF, Ran Online etc.

Q:Whats it good at?
A: Its the perfect trigger if your going to make "Casino" maps, RPGs that involve cooking similar to RuneScape, you can make a monster explode when the trigger is pulled, gives you the real understanding of either you accomplish or fail in raising crops like Harvest Moon....

Q:What do I need?
A: Do you even need a Superior!?!? its pretty obvious....

1 - Warcraft III: Frozen Throne...
Why: because thats where you'll put the system in, its also the game you manipulating *doh! You'll need TFT, because RoC does not support Variables unless programed by a third-party application...You can buy it at a low low price.....since its like....3 years...

2 - Warcraft III: World Editor
Why: Its the tool used for making maps, and custom Triggers......Its also the core where almost every aspect of Wc3 can be made....

3 - Some good experience of the world editor
Why: If your a new guy in the editor, you WILL be confused about any info this user gives out, so you'll need to understand many aspects of the editor......

Done with that? Good!
----

How to have the "Chance" trigger.....

"uhh...where will I start?", OK, since your an intermediate user of the editor, now its time for you to make the Chance trigger....due to its many uses (Actually, you can use the chance trigger in MANY WAYS!!! OMG!!) I'll start by making an "Open Christmas Presents!!" System....a system where a random item can be made from clicking on a 1 use only item

....Here are the stuff you need to make it working....

1. Think of at least 10 (more or less, but not 2 because its really boring..) items for you to place...Heres an example list but you can put any item you wish......You'll need this in case you only want to set out Custom items on your map....

Example List..

- Claws of Attack
- Voodoo Doll
- Skull of Gul'dan
- Wirt's Leg
- Potion of Greater Healing
- Key of Three Moons
- Monster Lure
- Healing Wards
- Anti-Magic Potion
- Neclace of Spell Immunity

2. Go to the Item Editor from the Object Editor, Make an Item Called "Present" and make the Goblin Merchant Sell it or scatter the "Present" items to the map....make sure they are perishable and are only 1 in amount....

3. Go to Triggers and access "Variables", make a "Real" Variable named "Present Number"...

4. Make a Trigger like this.....

  • Event
  • Wait - Every 0.02 seconds of Game Time
  • Conditions
  • Actions
  • Set Present Number to Present Number + 1
  • Action - If/Then/Else Do Multiple Actions
  • If - Conditions
  • Present Number More Than 10
  • Then - Actions
  • Set Present Number to 0
  • Else - Actions
  • Do Nothing
Because we only made 10 items, its only good enough to limit the number in present number to 10....because each number is equivalent to items you will receive....

4. Now we want to make the Presents have Items just like getting an actual gift for your Birthday (And not even the guy who made the trigger, especially ME!! and other people who follow it....), though you do know what Items come out from the presents, you actually don't know if your lucky enough to get the present you always wanted....its like opening only 1 out of 10 gifts thats hiding a PSP on one of them....

OK, so heres the info....its not that hard, its just REALLY LONG!!!

  • Events
  • Player - A unit owned by Player 1 uses an item
  • Conditions
  • Boolean - Item being Manipulated Equal to Present
  • Actions
  • Multiple Actions If/Then/Else Do Multiple Actions
  • If - Conditions
  • Real - Present Number equal to 1
  • Then - Actions
  • Hero - Create an item for Triggering Unit called "Claws of Attack"
  • Else - Actions
  • Do Nothing
  • ---------------------------------------
  • - If/Then/Else Do Multiple Actions
  • IF Conditions
  • Real - Present Number equal to 2
  • Then - Actions
  • Hero - Create an item for Triggering Unit called "Voodoo Doll"
  • Else - Actions
  • Do Nothing
  • ---------------------------------------
  • If/Then/Else Do Multiple Actions
  • If - Conditions
  • Real - Present Number equal to 3
  • Then - Actions
  • Hero - Create an item for Triggering Unit called "Skull of Gul'dan"
  • Else - Actions
  • Do Nothing
  • ---------------------------------------
  • If/Then/Else Do Multiple Actions
  • If - Conditions
  • Real - Present Number equal to 4
  • Then - Actions
  • Hero - Create an item for Triggering Unit called "Wirt's Leg"
  • Else - Actions
  • Do Nothing
  • ---------------------------------------
  • If/Then/Else Do Multiple Actions
  • If - Conditions
  • Real - Present Number equal to 5
  • Then - Actions
  • Hero - Create an item for Triggering Unit called "Potion Of Healing"
  • Else - Actions
  • - Do Nothing
  • ---------------------------------------
  • If/Then/Else Do Multiple Actions
  • If - Conditions
  • Real - Present Number equal to 6
  • Then - Actions
  • Hero - Create an item for Triggering Unit called "Key of Three Moons"
  • ELSE Actions
  • Do Nothing
  • ---------------------------------------
  • If/Then/Else Do Multiple Actions
  • If - Conditions
  • Real - Present Number equal to 7
  • Then - Actions
  • Hero - Create an item for Triggering Unit called "Monster Lure"
  • Else - Actions
  • Do Nothing
  • ---------------------------------------
  • If/Then/Else Do Multiple Actions
  • If - Conditions
  • Real - Present Number equal to 8
  • Then - Actions
  • Hero - Create an item for Triggering Unit called "Healing Wards"
  • Else Actions
  • Do Nothing
  • ---------------------------------------
  • If/Then/Else Do Multiple Actions
  • If -Conditions
  • Real - Present Number equal to 9
  • THEN Actions
  • Hero - Create an item for Triggering Unit called "Anti-Magic Potion"
  • Else - Actions
  • Do Nothing
  • ---------------------------------------
  • If/Then/Else Do Multiple Actions
  • If - Conditions
  • Real - Present Number equal to 10
  • Then - Actions
  • Hero - Create an item for Triggering Unit called "Necklace of Spell Immunity"
  • Else - Actions
  • Do Nothing

{-Negative} Note - OK, so I don't know what the action was truly named if its now placed as a trigger, but it is based on "Hero - Create An Item For Hero..."

"I updated the trigger code, and I also placed those -------------- lines on purpose so that you can separate the Actions, All you have to do is to copy the first If/Then/Else Action and Paste it on top of the Actions tab"

Also, please separate the If/Then/Else Triggers by not putting them in "Else", otherwise, it won't work

Now for the good part.....make the Goblin Merchant sell the present for 3000 gold and start with 3000 gold or scatter the presents item in the whole map.....I don't care what the Presents Look like, as long as theres a system that makes it work, to make it more Elder Scrolls traditional, name it (Wrapped Item) or something....

OK, then....thats all you need for the presents system, but as I said the Chance Trigger has many uses of its own.....you can also use it for setting up a triggered Passive ability....like if you get hit, a Doom guard will appear near you to protect you.....

If you can either improve or give me some corrections, I'll be happy for that, or if you like it, you can make your own system from the chance trigger....

Also, please forgive me for bad ways of setting up a trigger in a ["trigger"] since I don't really know much about the Triggers option like the other expert guys who show tutorials are using....

If there are any misunderstandings in this thread, please inform me....
 
Last edited:
Level 6
Joined
Aug 5, 2006
Messages
126
"Real -" is a condition based on "Real Comparison".....
"-----------------------" - Is placed on purpose to prevent putting the next If/Then/Else Condition/Action trigger on the "Else - Actions" tab....

The Trigger Should have text similar to this

Event
Player - A unit owned by Player 1 uses an item
Condition
Item being Manipulated Equal to Present
Action
+ If/Then/Else Do Multiple Actions
+ If/Then/Else Do Multiple Actions
+ If/Then/Else Do Multiple Actions
+ If/Then/Else Do Multiple Actions
+ If/Then/Else Do Multiple Actions
+ If/Then/Else Do Multiple Actions
+ If/Then/Else Do Multiple Actions
+ If/Then/Else Do Multiple Actions
+ If/Then/Else Do Multiple Actions
+ If/Then/Else Do Multiple Actions

Those "+ If/Then/Else Do Multiple Actions" are the parts where the Items take place from the random presents.....Which means, each of them has a Real Comparison Condition called "Present Number Equal To (1 to 10)" in each and every If/Then/Else Do multiple actions action trigger...And therefore it shouldn't look like

Event
Player - A unit owned by Player 1 uses an item
Condition
Item being Manipulated Equal to Present
Action
- If/Then/Else Do Multiple Actions
If - Conditions
Present Number equal to 1
Then - Actions
Create an Item for Hero Called "Claws Of Attack"
Else - Actions
+ If/Then/Else Do Multiple Actions (And so on until it reaches the If Condition: Present Number equal to 10)

Ask more....please!! Or if its not what your looking for, please specify the problem you have about the Chance Trigger.....

But I don't know what the Boolean is really based on, you need to look for the Condition yourself....

Updated
- Now I put more understandable code to the triggers.......
 
Level 6
Joined
Aug 5, 2006
Messages
126
Dreadnought[dA];595814 said:
This tutorial is completely useless if you use this one correctly.

http://www.hiveworkshop.com/forums/showthread.php?t=35180

Not Everyone knows how to use JASS. All he did was use it for an itempool, and I'm not sure whether he has other uses for the itempool, that tutorial I made was only a "sample" of the Chance Trigger....And unless you don't know JASS, you probably know that people who don't know JASS are not so sure whether they can use the itempool for other uses....

It's stupid to use 2 triggers for this.
Use random number instead of laggy periodic event.

I've been using "laggy" periodic event and the map is still stable, dude, get an upgrade from that PC of yours.
And What do you mean by "Random Number"?

ehhh :/ I am not really sure if this is needed at all, all you need is common sense... though well detailed tutorial.

Well, I haven't seen other tutorials that rely on "pure luck"....I said it has many uses than just clicking on items, there isn't much people who know how to use "Passive Trigger Abilities" or "Fishing certain kinds of fish from the Fishing System"....
 
Level 12
Joined
Feb 23, 2007
Messages
1,030
That JASS tutorial is so freaking easy to understand.
What he means by random number is.
set Integer = random number between 1 - 5
If Integer = 1 then create item.
If Integer = 2 then create item.
If Integer = 3 then create item.
If Integer = 4 then create item.
If Integer = 5 then create item.

Use integer as a condition.
Anyways your whole system is laggy and telling other people to upgrade there computers is one of the dumbest things I've ever heard. If you have 10 systems like this that are laggy, then even you will lag.
 
Last edited:
Level 6
Joined
Aug 5, 2006
Messages
126
DA, I said to give "kind but critical feedback" but you didn't listen to me and tell me all the shit you have to say! If your gonna say something, Why don't you say it in a kinder Tone!? You have NO Right to flame a N00b Like that!! I think you didn't even "READ" the Disclaimer! So what? Rush around and say, (This tutorial sucks Dick!!)......MAN, WHO RAISED YOU!? POLAR BEARS!?

Its probably "TOO EASY" for you because you already read the instructions of the tutorial by opening the fucking map, what about those other guys who "CAN'T!!" even understand JASS thus they're in Safe Mode because of a Virus? Your the total n00b of other's intelligence!

- I don't care if any admin or critic mod would neg rep me or even BAN me for saying that, but even they have no RIGHT to talk shit to Newbies!!
 
Level 6
Joined
Aug 5, 2006
Messages
126
Man! That gives you NO RIGHT to say its worthless, even if your right, you know how much it feels if someone else says "Oh, what a worthless guide on how to get your phone re-formatted"What if your "DAD" tells you nonsense instructions, are you gonna do the same?......Dude? Its not even funny! seriously......get some friends! Get outta the comp. Enough with the Map Making $hit and GET SOME REAL PEOPLE FOR YOU TO SAY STUFF THEY MAKE SUCKS A$$!!! Wow, Am I right or What!? You ARE THE TOTAL N00B OF OTHER'S INTELLIGENCE!!
 
Top