Using Build On
Author: Temp (stardepot.org)Tags: beginner data unit  
Source: http://www.stardepot.orgAdded 13 years ago 

This tutorial will show you how to make a building that must be built on top of another building, eg a Refinery on a Vespene Geyser.

Creating the Bottom Unit
To create the base it is important to copy it from the original vespene geyser unit. To do so right click on the vespene geyser unit and click Duplicate Object. The reason we are duplicating the unit is so it will have a copy of the actor and so that it will already have the Gas (Raw Vespene Geyser) behaviour, both of which are essential. Click on the check box beside the actor and then click ok.

Now you may edit the unit to your needs but do not remove the Gas (Raw Vespene Geyser) behaviour or remove any events from the actor.

Creating the Top Unit
To create the top unit simply create any unit you wish (or modify an existing unit) and then give it the Harvestable Vespene Geyser Gas behavior and edit the Techtree - Built On property to have the bottom unit you created.

Notes:
If you do not want the bottom or top unit to show any resources you can edit the Stats - Flags property an uncheck Show Resources.

The reason the bottom unit needs to have the Gas (Raw Vespene Geyser) behavior is because currently in SC2 if you try to build on a unit that does not have that behavior the game will crash.

The reason the top unit should have the Harvestable Vespene Geyser Gas behavior is so that specific actor events will fire when the top unit is built on the bottom unit.

Advanced (Actor Events)
Behaviour.RawVespeneGas

This event has 3 useful sub names for the Built On property. They are Host Start, Host Finish and Host Clear. Host Start occurs when the top unit begins to build on top of the bottom unit. Host Finish is when the unit finishes constructing and Host Clear is when the unit is no longer on top of the bottom unit.

Signal.*.Covered and Signal.*.Uncovered

These events I have yet to find a way to make manually and this is why the actor must be copied. The covered event occurs when the top unit is finished being constructed. The uncovered event occurs when the top unit is no longer on the bottom unit.







Star Depot
Contact      Login