After so long I think it's time to let the community know some secrets, I hope noone has something against this.
I think that this trick will be a giant improvement in the community as it opens a brand new feature that can be used in any scenario and is quite handy.
- Mythic_Freak
- Invent00r
- Nottud
- SwordOfValor
- HailToTheOboe
These guys all played big roles in finding this trick.
1.
Ok, first, you'll need a ''setup unit''. This means that you will never actually use it ingame, but it is crucial for the hotkeys to work. This unit MUST be atlantean, you will see why later. For example let the setup unit be an oracle scout.
2.
Unless you want some stupid people to ruin the game and complain about it, I recommend that you put the setup units on a terrain that they can't move on, and it would be good if you hide them under some rocks or something. Here's an example, I haven't hidden it, but it's on black rock, so it can't move.
3.
Now you need to make a main unit. I've put a Militia in the example, but it could be any unit really.
4.
Ok so this Militia will be your main unit, that means you will add effects for it if a hotkey is pressed. This is just another example, you can make hotkeys for other stuff aswell.
Now it's time for the triggerwork. First of all you will need to create Groups. One for the main unit and one for the setup unit. To do this, first add the effect select unit type. Type in the protounit name of your setup unit. Then add an effect GROUP Create. Write in any number between 1 and 9. When you have done this your setup unit will be grouped. Do the same for your main unit, but use a different group number. In the last part you've got XS User Code. There write in -
map("Your hotkey","game","uiSelectNumberGroup(The number of the group your setup unit is in) uiTransformSelectedUnit(\"The hero form of your setup unit\")");
It's best if this trigger is on High Priority.
EXAMPLE
Trigger1
Active
High Priority
Conditions
Always
Effects
Select Unit Type - Oracle Scout
Group Create - 1
Select Unit Type - Militia
Group Create - 2
XS User Code - map("1","game","uiSelectNumberGroup(1) uiTransformSelectedUnit(\"Oracle Hero\")");
Ok so, the above trigger means that the groups have been set - Oracle Scout is Group 1, and Militia is Group 2. The XS User Code means that if you press the key ''1'', then Group 1 will be selected - the Oracle Scout, and it will be trasformed into it's hero form - Oracle Hero.
5.
Ok next we want to set an effect if the Oracle has turned into an Oracle Hero. It's VERY IMPORTANT that there are no other units on the map of the same type as the setup unit. You'll need the condition Player Unit Count. Set the parameters , the unit should be the Hero form of the setup unit. Example-
This is it. You have made the trigger to fire if the setup unit is in hero form. Unfortunately you can only use numbers with this method, but as there are no better methods that I know of, you should be satisfied.
You have now set it so that if the hotkey is pressed the effects in this trigger will happen.
6.
Ok, you can put any effect you want to happen if the key is pressed but there are some crucial effects you need if you want the system to work with no flaws. Ok the effects of each trigger should be -
The effects you want to happen if the hotkey is pressed
7a. In the end copy the trigger. Now that you have two identical triggers you want them to fire eachother. This makes a hotkey reusable, so if you want your hotkey to be used only one time you can skip this point.
Ok now to make the two triggers fire eachother, you have the trigger Fire Event, which was also written above. Just make the one trigger fire the other. In my example - Trigger 2 fires Trigger 3, and Trigger 3 fires Trigger 2. Make the trigger active and the copy of the trigger non active.
7b. Instead of point 7a, you could just try looping the trigger and don't copy it. Although I haven't tryed it but you can.
[This message has been edited by AuroraP (edited 10-30-2009 @ 08:25 AM).]