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: How to create floating buildings
posted 25 August 2020 03:40 PM EDT (US)   


Greetings friends! You may have noticed the record for tallest building in AoM was smashed in the design contest by the Yeebaapalace in my competition entry. This explains the various appendages of Zeus and other gods that were seen falling from the sky during the construction phase (sorry). So you may want to create a mega-structure of your own. Fear not, it's actually quite simple. This guide assumes a basic working knowledge of triggers and quest vars.

The building does take a little bit of work but once you understand the basics it's pretty easy. Making a large structure requires a lot of trial and error. We will need to understand:
  • Vectors
  • Attaching units
    That's it...

    The Yeebaapalace building was built relative to a small blueprint on the ground, so we must first understand some vectors. Each 1x1 terrain square in the editor counts as 2x2 in terms of vectors. This applies in everyday triggers - so if you have an arcus 2 units away from an anubite - the anubite will be on the adjacent square. Same thing applies when scaled up, so when you paint terrain using the 10x10 brush, you are painting an area 20x20 as far as vectors are concerned.
    Be very clear: From now on I will be referring to the 1x1 tile you can paint using a brush in the editor as editor squares. This is 2x2 vector units.
    The bottom of the map is always X0,Y0,Z0.
    Now we can be certain of our vectors using the ingame align tool which will snap a unit to the centre of an editor square.
    Y is height. X and Z are across.

    Building relative to something allows you the option of change later on so I would say it's important! If you create your structure relative to one unit you can move the entire thing across the map with ease.


    These are the following steps to creating a very basic floating building. We're going to stack three columns on top of each other.
    You will need a column on the ground to act as your anchor point (the other two will spawn on top of it), and 4 cinematic blocks.

    Step 1: Trigger loader required! Set it as the first trigger in the game, run immediately.
    Step 2: Change your cinematic blocks. We need two relics and two heroes (I will use Amanra).
    Step 3: Immediate garrison the relics in the amanras.
    Step 4: Transform your hero to wadjet spit, and transform your relic to the desired unit that will float (columns in this instance).
    Step 5: Unit position to QV vector (V1 to the first column)
    Reveal code for this trigger by clicking.
    <Effect name="Unit Position To QV Vector"> <Param name="SrcObject" dispName="Source Unit" VarType="unit">default</Param> <Param name="VQVName" dispName="Vector Name" VarType="string">V1</Param> <Command>trVectorQuestVarSet("%VQVName%", kbGetBlockPosition("%SrcObject%"));</Command> </Effect>

    Step 6: Teleport the wadjet spits (formerly hero amanra) to the desired location, modifying the vector each time. A column is 4 units high so we modify the vector by +4Y each time.

    To make step 6 simple I have create a custom trigger which combines vector modify and unit teleport all in one. So just set Y to +4 and select a different amanra each time and it will work.
    Reveal code for this trigger by clicking.
    <Effect name="Quest Var Vector Modify and teleport"> <Param name="VQVName" dispName="Vector Name" VarType="string">V1</Param> <Param name="Oper" dispName="$$23955$$Operator" VarType="string">+</Param> <Param name="X" dispName="Vector X" VarType="float">0</Param> <Param name="Y" dispName="Vector Y" VarType="float">0</Param> <Param name="Z" dispName="Vector Z" VarType="float">0</Param> <Param name="R" dispName="Round" varType="bool">false</Param> <Param name="SrcObject" dispName="$$22295$$Source Units" varType="unit">default</Param> <Command>trVectorQuestVarSet("%VQVName%", xsVectorSet(trVectorQuestVarGetX("%VQVName%") %Oper% %X%,trVectorQuestVarGetY("%VQVName%") %Oper% %Y%,trVectorQuestVarGetZ("%VQVName%") %Oper% %Z%));</Command> <Command>if(%R%) { for(a=0; >1){}for(b=0; >1){}for(c=0; >1){}</Command> <Command>a = trVectorQuestVarGetX("%VQVName%");b = trVectorQuestVarGetY("%VQVName%");c = trVectorQuestVarGetZ("%VQVName%");</Command> <Command>trVectorQuestVarSet("%VQVName%",xsVectorSet(a,b,c));}</Command> <Command>trUnitSelectClear();</Command> <Command loop="" loopParm="SrcObject">trUnitSelect("%SrcObject%");</Command> <Command>trUnitTeleport(trVectorQuestVarGetX("%VQVName%"),trVectorQuestVarGetY("%VQVName%"),trVectorQuestVarGetZ("%VQVName%"));</Command> </Effect>


    Here is a screenshot series of the steps:



    You will see once transformed correctly the wadjet spit appears to make the unit float a little bit. If you're having trouble make sure you have LOS to all objects, and you MUST use transform/mutate - do not use change unit type.

    Let's add some more units.
    Ok so you've managed to stack units, great! Let's have another three columns stacked on top of each other and have two fallen columns on top to create a kind of door.
    In the editor if you place the fallen column you will see it is 2 tiles long, therefore 4 units long. This means two of them are double this, so our second stack of upright columns should be 4 editor squares or 8 units away from each other. Use a second vector for the second column (V2).



    You will see in this picture my columns are actually 3 editor squares or 6 units apart, why? You can see the fallen columns perfectly take up two squares each. However if you imagine hoisting them into the air they start from the edge of the editor square rather than our columns which are in the centre - as I have illustrated. That is the reason for my offset.

    Now we can prepare the fallen columns for floating by using our previous 6 steps. You will have to now time the triggers differently as you cannot transform a unit to two different units in the same trigger. So I've created my 6 steps again but the original 6th step now fires the first step for the column building. No need to set any vectors this time though, we can just +4Y to V1 and V2 and the fallen columns should sit neatly on top of our columns.... But do they?


    So you will notice the angles are off! This is because the relic assumes the angle of the hero that is holding it. So you'll need to use the set unit heading trigger on the amanra that picks up the relic which will become our fallen columns (0 and 180).
    The position also appears to be off as well, this is due to the centre point of the fallen column. But we can correct this easily. We know it's 4 units long so we just need to halve this and offset by Z-2 in V1 and Z+2 in V2. Combined with unit heading we now have a sexy archway which units can walk through. They won't be able to walk through the sides since we put physical columns down to create our stack. If we stacked on a cinematic block then units would be able to walk through.





    So you have now learnt that the unit heading property of the hero will be applied to the relic. This applies to other properties as well such as animation.
    Let's recreate a classic scene from the crystal maze and finally get a unit to walk over the bridge AoM provides!



    Our setup will be the bridge unit, with two cinematic blocks at each end. We will need to use our first six steps, but our unit of choice is a militia. This won't do - if you try it the unit will be idle. We need our militia in the walking animation when he is transformed to a relic.
    So have your militia in the editor. Use move to unit (block 1) to get him to run in the same direction of the bridge. One second later we do the transform and garrison trick, changing block 2 to amanra and using immediate garrison in the same trigger.
    If this has worked correctly you will have a militia in the walking animation suspended slightly above ground. We do not create a relic for this - we transform the militia into a relic, garrison and then transform back.
    Add another militia and use the same trick so we have a stationary militia and a walking one.

    We can now set V1 to block 3, and modify the Y height. This part takes trial and error! I'll save you some work and ask you to set the height to +12.2Y. You now have a militia standing on the bridge with the walking animation. He may be floating slightly, as the value I have given you is for the centre of the bridge since the unit dips slightly at each end.

    Now that we've done that - we must simulate walking. In my setup the distance between the two cine blocks on the bridge is 11 editor squares, so I want my militia to move 22 vector units.
    This is done with a very simple trigger. Add a new trigger for our movement. Fire the movement trigger from the trigger where your militia is put onto the bridge, and set a quest var. Let's call it 'Distance' and set it to 22.

    In our movement trigger (this must be looped), condition is QV check for distance being greater than 0. Also we have a timer ms accurate on there of 50. The effects are to QV modify 'Distance' by -0.2, modify QV Vector of V1 by -0.2Z and teleport the amanra to V1.
    This will create a smooth movement so our unit will walk across the bridge and then freeze at the end! Animation cannot be changed by modifying the original unit.

    At the end he's still walking, so add a final trigger where when Distance is equal to or less than 0, our moving militia is teleported off screen and our stationary militia is teleported to V1 (this is handy - exactly where our walking unit was!).




    You can now take this to the next level. Using these principles you too can have a unit walk the misc stairs!
    You can create pathways out of thin air and maybe even automaton bases as stairs and have your units walk up them.

    Interestingly, stretch and scale is also preserved with transform so with 2.8 making this so easy you can do some proper whacky builds. I look forward to seeing what you can make. It's even possible to do this trick online.


    ______________________________________ 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
  • Replies:
    posted 25 August 2020 06:03 PM EDT (US)     1 / 4  
    Beautiful! Beats the old Hammer of Thor building technique by a mile.

    I would have never guessed transform and attach both preserved unit animation. What kind of witchcraft is this? Truly the Editor is still filled with mysteries.

    Also, how was it to build entire structures on a map using vectors only? That much back-and-forth between playtesting and trigger editor would certainly have given me nausea!

    𝓎𝑒𝓈, 𝒾 𝓁𝒾𝓀𝑒 𝓅𝑒𝓅𝑒
    posted 25 August 2020 06:57 PM EDT (US)     2 / 4  
    Yea I am not sure how I would have the patience to do flying cities but clearly the awesomeness helped you persevere!

    A few things to add that might be helpful - patch 2.8 you can now override unit animations (With patch 2.8 trigger pack: https://steamcommunity.com/sharedfiles/filedetails/?id=2110063347). This can be used to make units "walk" without making them actually walk (This might making walking easier as you can simply apply the walking animation and tell the spit to move). These triggers also allow for the stretching mentioned in the main article during the game without using Kronny.

    [This message has been edited by nottud (edited 08-25-2020 @ 07:05 PM).]

    posted 26 August 2020 02:46 AM EDT (US)     3 / 4  
    Excellent point ^.
    Also, how was it to build entire structures on a map using vectors only?
    Really not as bad as you'd think. I had a solid blueprint layout for it so when I was building straight up I could set a vector to one of the walls, and if it was just walls I'd use modify and teleport multiple times to build around the square. Had two testing modes of playing the game vs building and camera cut to the palace so I could check important parts were working and lining up.
    Could use play in editor to make my camera tracks perfect and then copy them over to the main file.

    ______________________________________ 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 06 September 2020 06:43 AM EDT (US)     4 / 4  
    Simply genius.

    "Blunt do I make my enemy's blade, nor bites his sword or staff"
    - The Poetic Edda
    Age of Mythology Heaven » Forums » Scenario Design » Guide: How to create floating buildings
    Top
    You must be logged in to post messages.
    Please login or register
    Hop to:    
    Age of Mythology Heaven | HeavenGames