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.
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'.
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'
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.
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
2. For the conditions,
and
3. As for actions
and
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.
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
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.
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
Now that you are done, your trigger should be something like this,**HINT! - Map Initialization; Can be found as the first 'Event' in the event section
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
- Events
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)
2. Now in Conditions**HINT! - A unit enters (Playable map area); can be found in the section 'Units' and subsection 'Unit - Unit Enters Region'
Trigger:
- (Unit-type of (Entering unit)) Equal to Random Hero
3. In Actions**HINT! - (Unit-type of (Entering unit)) Equal to Value; can be found in the section 'Units' and subsection 'Unit-Type Comparison'
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
- Events
**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 <gen>)
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
- Events
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
- Events
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 <gen>)
- 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)
- Events
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
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.