Tutorial The Easiest Random Hero Thingy Ever! (With Super Noob Guide!)

Scary Nachos

Castro flashing Gang Signs!
Reaction score
45
Hello! This is a system for the easiest random hero spawn trigger thingy ever!
1. First, open up World Editor
2. Go to Trigger Editor
3. Go to Variable Editor

Here it is, first of all we are going to need a couple variables.

List of Variables
1. Random_Heros - Unit-Type - Array - Size #
For size, add how many heros you want to be 'randomized', so for mine I'm going to use 8
2. RandomHero_Spawn - Point

My Variables look like this.

Random_Heros - Unit-Type Array (8) - -None-
RandomHero_Spawn - Point - - None-


There, now that we have our variables, we can begin the triggering

4. Make a new trigger
For this trigger, we are going to declare all of our heros that we want to be 'randomized', so make sure and put the number of heros in the 'Size #' variable.
Now for this trigger, name it 'Human Random', we are going to make an event and action
1. First make an events 'Map Initialization'
2. Then for the actions, Go to 'Set Variable = Value'
3. Select the Variable, 'Random_Heros'
4. For the 'Index' put a #1
5. Then for the 'Value' select the first hero that you want to be 'randomized', such as Paladin.
6. Now repeat those steps from 1 - 5, and for the 'Index' add the numbers in numerical order. 1,2,3,4,5,6,7,8. Also remeber to select different heros, if you want them to be 'randomized'.
**HINT! - Set Variable = Value; Can be found in the 'All' Section, 4 options down
**HINT! - Map Initialization; Can be found as the first 'Event' in the event section
Now that you are done, your trigger should be something like this,

Trigger:
  • Human Random
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set Random_Heros[1] = Paladin
      • Set Random_Heros[2] = Archmage
      • Set Random_Heros[3] = Mountain King
      • Set Random_Heros[4] = Blood Mage
      • Set Random_Heros[5] = Keeper of the Grove
      • Set Random_Heros[6] = Priestess of the Moon
      • Set Random_Heros[7] = Demon Hunter
      • Set Random_Heros[8] = Warden


5. Now, just so I dont forget this, go to World Editor (The place where you see the terrain) and 'File' <-- Preferences <-- Test Map <-- Use Fixed Random Seed. (Make sure that is NOT checked). And hit 'Ok"

6. Next, go to Object Editor.
1. Copy a hero
2. Paste the hero
3. Change the Icon on the hero to a question mark. (I like this one ^^ 'ReplaceableTextures\CommandButtons\BTNSelectHeroOn.blp').
4. Rename that hero to 'Random Hero'


7. Ok from there, we must go back into Trigger Editor.
8. Now make a new trigger called 'RandomHeroKill'
Now this one is going to remove 'Random Hero' from the map.
1. Now make a 'Events'
Trigger:
  • Unit - A unit enters (Playable map area)

**HINT! - A unit enters (Playable map area); can be found in the section 'Units' and subsection 'Unit - Unit Enters Region'
2. Now in Conditions
Trigger:
  • (Unit-type of (Entering unit)) Equal to Random Hero

**HINT! - (Unit-type of (Entering unit)) Equal to Value; can be found in the section 'Units' and subsection 'Unit-Type Comparison'
3. In Actions
Trigger:
  • Unit - Remove (Entering unit) from the game

**HINT! - Remove (Entering unit) from the game; can be found in section 'Units' and subsection 'Remove'

This trigger, makes it so that when 'Random Hero' enters the game, it will be removed so that we can add the 'randomized' hero.

So.. your trigger should look like this.
Trigger:
  • RandomHeroKill
    • Events
      • Unit - A unit enters (Playable map area)
    • Conditions
      • (Unit-type of (Entering unit)) Equal to Random Hero
    • Actions
      • Unit - Remove (Entering unit) from the game

**HINT! - Unit - A unit enters (Playable map area); can be found in section 'Units' and subsection 'Unit Enters Region'
**HINT! - (Unit-type of (Entering unit)) Equal to Random Hero; can be found in section 'All' and subsection 'Unit-Type Comparison'
**HINT! - Unit - Remove (Entering unit) from the game; can be found in section 'Unit' and subsection 'Remove'

9. Good work! Now we need to make a region, so our 'randomized' hero can spawn there.
1. Now go to World Editor (The place where you can see all the terrain) and make a region.
2. Now name that region 'Random Hero 1'

10. Last Trigger! Ok! So now we must make the random hero spawn.
11. Go to Trigger Editor
12. Make a new trigger named 'RandomHero Red'
1. For the event, use this
Trigger:
  • Unit - A unit enters (Playable map area)

2. For the conditions,
Trigger:
  • (Unit-type of (Entering unit)) Equal to Random Hero

and
Trigger:
  • (Owner of (Entering unit)) Equal to Player 1 (Red)

3. As for actions
Trigger:
  • Set RandomHero_Spawn = (Center of Random Hero 1 &lt;gen&gt;)

and
Trigger:
  • Unit - Create 1 Random_Heros[(Random integer number between 1 and 8)] for Player 1 (Red) at RandomHero_Spawn facing Default building facing degrees

and
Trigger:
  • Custom script: call RemoveLocation (udg_RandomHero_Spawn)


**HINT! - Unit - Create 1 Random_Heros[(Random integer number between 1 and 8)] for Player 1 (Red) at RandomHero_Spawn facing Default building facing degrees; Can be found in section 'Unit' and subsection 'Unit - Create Units Facing Angle' ==== For the unit, select the variable 'Random_Heros', for the Index, Choose 'Random integer number between 1 and #

ZOMG! CUSTOM SCRIPT! Go to Actions <--
Scroll down 3 and hit custom script, then type 'call RemoveLocation (udg_RandomHero_Spawn)' without the ' and you should be good!

13. Final Step! Add 'Random Heros' (The hero) to a hero shop, then place the shop onto the terrain.....and.. ta da! You are done!

You can also add alot of features onto the map.
Such as...
1. Hero Limiting
2. Hero Items
3. And alot more things!

Heres all the code all together.

Trigger:
  • Human Random
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set Random_Heros[1] = Paladin
      • Set Random_Heros[2] = Mountain King
      • Set Random_Heros[3] = Archmage
      • Set Random_Heros[4] = Blood Mage
      • Set Random_Heros[5] = Keeper of the Grove
      • Set Random_Heros[6] = Priestess of the Moon
      • Set Random_Heros[7] = Demon Hunter
      • Set Random_Heros[8] = Warden


Trigger:
  • RandomHeroKill
    • Events
      • Unit - A unit enters (Playable map area)
    • Conditions
      • (Unit-type of (Entering unit)) Equal to Random Hero
    • Actions
      • Unit - Remove (Entering unit) from the game


Trigger:
  • RandomHero Red
    • Events
      • Unit - A unit enters (Playable map area)
    • Conditions
      • (Unit-type of (Entering unit)) Equal to Random Hero
      • (Owner of (Entering unit)) Equal to Player 1 (Red)
    • Actions
      • Set RandomHero_Spawn = (Center of Random Hero 1 &lt;gen&gt;)
      • Unit - Create 1 Random_Heros[(Random integer number between 1 and 8)] for Player 1 (Red) at RandomHero_Spawn facing Default building facing degrees
      • Custom script: call RemoveLocation (udg_RandomHero_Spawn)



So yeah... thats about it...
This is my first tut, so.. keep that in mind when tell me stuff
This is my easy way of making a random hero mode, and i think its pretty good. But i dont know if everyone else is gonna like it :p
Comments and Suggestions are welcome.

Btw: I don't know what the crap this is.. I think its a tutorial.. but I am not sure. So tell me what I should do. Thanks!

Here is a map as well.
 

Attachments

  • EasiestRandomHeroTriggerEver!.w3x
    19.1 KB · Views: 238

Scary Nachos

Castro flashing Gang Signs!
Reaction score
45
Well... i mean they could edit it, but yeah thats for one player, should i make it for everyone? But i mean.. # of triggers doesnt really hurt the loading time or map right?
 

Scary Nachos

Castro flashing Gang Signs!
Reaction score
45
I mean.. i do that.. i mean.. ive got triggers for 10 players, it takes a while... im not that good at triggering so im not sure how to condense it into a smaller ammount of triggers
 

Darthfett

Aerospace/Cybersecurity Software Engineer
Reaction score
615
im not that good at triggering so im not sure how...

Then why are you writing a tutorial?

Tutorials are a guide to beginners from experts, not a "this is how I did it" from a beginner to a beginner.

Tutorials should also always explain the BEST way to do something, should be in-depth, easy to understand, and cover a broad enough topic to warrant a spot in the Tutorials forum.
 

Scary Nachos

Castro flashing Gang Signs!
Reaction score
45
Huh...
>Then why are you writing a tutorial?

Cause i THOUGH i knew how to do stuff (Which i did not)

>Tutorials are a guide to beginners from experts, not a "this is how I did it" from a beginner to a beginner.

Tutorials should also always explain the BEST way to do something, should be in-depth, easy to understand, and cover a broad enough topic to warrant a spot in the Tutorials forum.

Is this even a tutorial? Maybe... a system or something?

Tutorials are a guide to beginners from experts, not a "this is how I did it" from a beginner to a beginner.

Tutorials should also always explain the BEST way to do something, should be in-depth, easy to understand, and cover a broad enough topic to warrant a spot in the Tutorials forum.

Isnt it sorta?
 

Jesus4Lyf

Good Idea™
Reaction score
397
>The Easiest Random Hero Thingy Ever! (With Super Noob Guide!)
=/

For in future, if you feel inclined to study something and then release a tutorial on it, post in Jass Help asking what the best way to do something is, collaborate all the suggestions together until you establish the method you find best based on that research, then write a tutorial explaining how and why to follow this best practice, and maybe briefly include alternatives and why you've they're frowned upon by you or mappers in general, including the downsides of your method and how to apply alternative techniques to avoid these.

And definitely, never make statements like the following without any reason to believe them:
>the easiest random hero spawn trigger thingy ever! Guaranteed or your money back!
Copy/paste spamming triggers is not the easiest. >_<

>im not that good at triggering so im not sure how...
>Then why are you writing a tutorial?
>_< *Nods*...
 

Scary Nachos

Castro flashing Gang Signs!
Reaction score
45
Well.. i mean.. theres gotta be a first for everything :p
.....
Ill get rid of the offensive things D=

>For in future, if you feel inclined to study something and then release a tutorial on it, post in Jass Help asking what the best way to do something is, collaborate all the suggestions together until you establish the method you find best based on that research, then write a tutorial explaining how and why to follow this best practice, and maybe briefly include alternatives and why you've they're frowned upon by you or mappers in general, including the downsides of your method and how to apply alternative techniques to avoid these.

Hmk, so this should be graveyarded?
Or how can i fix this up so its a bit better?
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top