You must be logged in to post messages.
Please login or register

Scenario Design
Moderated by Yeebaagooon, nottud

Hop to:    
loginhomeregisterhelprules
Bottom
Topic Subject: Guide: The Flawless Online Hotkeys Trick
posted 29 October 2009 08:55 AM EDT (US)   


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.





Flawless Online Hotkeys Trick

Credits
- Mythic_Freak
- Invent00r
- Nottud
- SwordOfValor
- HailToTheOboe

These guys all played big roles in finding this trick.





Guide

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
Change Unit Type - Change the setup unit back to it's normal form. In my example I would change the Oracle Hero back into Oracle Scout.
UNIT Clear Selection - When it's executed no unit is selected anymore
Select Unit Type or GROUP Select - This is the basic trigger, you select the main unit. In my example I would select the Militia with Unit Type - Militia. This is just the basic trigger, but if you are going to make a more complex system where the main unit changes type at some points, you should use GROUP Select. With GROUP Select write in the Group number of the main unit. If you ask me GROUP Select is by far better choice.
Fire Event This will be explained in the next point.



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.

____________
+|||AuroraP|||+
A Proud Member Of
0==[==========>
ValorStudios
<==========]==0

[This message has been edited by AuroraP (edited 10-30-2009 @ 08:25 AM).]

Replies:
posted 29 October 2009 08:59 AM EDT (US)     1 / 17  
Haven't read in depth yet - but one comment. It doesn't need to be atty - you can use norse vill -> ulf transformation as well (I learned this from invent00r).


Do you set the hotkeys back at the end of the game?

I saw a command called uiFindKeyMapping or something, but I couldn't seem to get results from it.

The best thing I can think of is to take the default key mapping and set it back, but it would be great if there was a way to read the game.con and save the mapping in a string qv.

But even then, you could only set it back when the game ends, not when someone drops, because they're gone before you know it.

[This message has been edited by HailToTheOboe (edited 10-29-2009 @ 09:05 AM).]

posted 29 October 2009 09:06 AM EDT (US)     2 / 17  
thanks Hail, totally forgot about that.
I thought you said yourself that this isn't needed with this method, i'm using groups.

____________
+|||AuroraP|||+
A Proud Member Of
0==[==========>
ValorStudios
<==========]==0
posted 29 October 2009 09:09 AM EDT (US)     3 / 17  
If you only use the number it's no concern.

But here, you're modifying their base hotkeys, and that will stay even after the game is over.
map("Your hotkey","game","uiSelectNumberGroup(The number of the group your setup unit is in) uiTransformSelectedUnit(\"The hero form of your setup unit\")"); 
posted 29 October 2009 09:12 AM EDT (US)     4 / 17  
yes, I mentioned it in the thread that you can only use numbers. And dunno hail, but I use it in my map and nothing has changed cause of this.

____________
+|||AuroraP|||+
A Proud Member Of
0==[==========>
ValorStudios
<==========]==0
posted 29 October 2009 09:26 AM EDT (US)     5 / 17  
If you're just using the number groups, then it's not too bad, because at the end of the scenario, you can map it right back to normal, because I'm pretty sure no one modifies those hotkeys.
Disconnection is still an issue.

However, using only number groups I believe you can avoid the key mapping all together.

1.
Condition - Unit Selected (unit already assigned to a group)
Effect - uiTransformToUnit

2.
Condition - Player Unit Count
Effect - desired effect, change unit type, etc

For multiplayer, you need the uiTransformToUnit (or other similar ui command) for auto-syncing, but it doesn't need to be linked to the same hotkey, it just needs to happen when that unit is selected.

Anyway, kudos for fleshing this trick out and writing the guide.
posted 29 October 2009 09:39 AM EDT (US)     6 / 17  
thanks Hail.

____________
+|||AuroraP|||+
A Proud Member Of
0==[==========>
ValorStudios
<==========]==0
posted 29 October 2009 10:00 AM EDT (US)     7 / 17  
would a wall long work? Since it can unittransform into a gate.

My Upcoming website!
The Black Hand RPG - Revived
Join my Facebook Group :P
Nazi Zombie Verukkt sound files
Mess With The BesT DiE LiKe ThE ReST
Argh!! It's EXOLAR not xEXOLARx get it right!!
posted 29 October 2009 01:55 PM EDT (US)     8 / 17  
dunno, you could try it though.

____________
+|||AuroraP|||+
A Proud Member Of
0==[==========>
ValorStudios
<==========]==0
posted 29 October 2009 04:11 PM EDT (US)     9 / 17  
This is SOV's secret isnt it. OH BABY YES!

"I NED MOAR RANGE" Pubby8
posted 29 October 2009 04:48 PM EDT (US)     10 / 17  
indeed, this is SoV's secret.

____________
+|||AuroraP|||+
A Proud Member Of
0==[==========>
ValorStudios
<==========]==0
posted 29 October 2009 08:24 PM EDT (US)     11 / 17  
This will make my infamous map, should i use this technique, awesome!

"I NED MOAR RANGE" Pubby8
posted 30 October 2009 03:43 AM EDT (US)     12 / 17  
oh yeah forgot to thank you and sov for finaly making it so I could use the hotkey triggers any of my maps now without carrying a massive shame burden on my shoulders.

My Upcoming website!
The Black Hand RPG - Revived
Join my Facebook Group :P
Nazi Zombie Verukkt sound files
Mess With The BesT DiE LiKe ThE ReST
Argh!! It's EXOLAR not xEXOLARx get it right!!
posted 30 October 2009 03:50 AM EDT (US)     13 / 17  
Yeah I got told about this a while ago. Not sure if I'll use, but great guide.

______________________________________ Yeebaagooon ______________________________________
____________________ AoMH Seraph ____________________
"You can't trust yeebaagooon to lead a rebelion, He would send everyone to steal mirrors so he could bask in his own brilliance." - Out Reach
"Yeebaagooon had never seen a more handsome man in all his life. He couldn't control himself, He needed to act. Gripping the mirror in his strong arms he kissed the figure before him..." - Out Reach
AoMH: Unfinished Scenarios|Singleplayer: Codename Ripto|Multiplayer: Minigames Z|CSC 7
Ex Seraphs Dictator, Spore Heaven Seraph
posted 30 October 2009 07:59 AM EDT (US)     14 / 17  
Credits
- Invent00r
- Nottud
- SwordOfValor
- HailToTheOboe
This... this, this... *cries*
If it wasn't for me nobody would know hotkeys existed!


Anyway, nice job, looks pretty good.

If we knew what it was we were doing, it would not be called research, would it? - Einstein, A.
Master XS - AoM Code Reference - Trigger Loader - Trigger Requests - Chess

Wow, I never thought that I would actually know something before nottud did... it's actually not all that satisfying ~ Steak
posted 30 October 2009 08:25 AM EDT (US)     15 / 17  
aww damn i'm sorry mythic. I asked around a little and seems nobody remembered. I'll add you right away.

____________
+|||AuroraP|||+
A Proud Member Of
0==[==========>
ValorStudios
<==========]==0
posted 30 October 2009 01:00 PM EDT (US)     16 / 17  
I was just kidding.

I made some similar thing, but it worked with chats so it was kinda ugly.

If we knew what it was we were doing, it would not be called research, would it? - Einstein, A.
Master XS - AoM Code Reference - Trigger Loader - Trigger Requests - Chess

Wow, I never thought that I would actually know something before nottud did... it's actually not all that satisfying ~ Steak
posted 01 November 2009 08:03 PM EDT (US)     17 / 17  
I tried to impliment this but it doesnt seem to work.

"I NED MOAR RANGE" Pubby8
Age of Mythology Heaven » Forums » Scenario Design » Guide: The Flawless Online Hotkeys Trick
Top
You must be logged in to post messages.
Please login or register
Hop to:    
Age of Mythology Heaven | HeavenGames