• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[GUI] BunkerSystem V1.4

Multy-UnitBunkerSystem
by Nedio95


Description

Allows the creation of starcraft-like bunkers

Pluses

-Works with multiple bunker types
-Units-of-type can be set to fire from 1 bunker type and not from other
-Garisoned units can be ordered to atack specified unit
-Garisoned units can use autocast abilites

Minuses

-Doesnt support heroes (In next version)
-Doesnt support melee units (Working on it)
-Max of 10 units in a single bunker


Credits

To SonicFlare101 for requesting this system
To Bribe for his Unit Indexing System and Unit Event System
To rulerofiron99 for finding a way to keep the dummy in the bunker and exchanging ideas

Triggers
  • Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Visibility - Create an initially Enabled visibility modifier for Player 1 (Red) emitting Visibility across (Entire map)
      • -------- ^ ^ ^PURELY FOR MAP TESTING ^ ^ ^ --------
      • -------- ----------------------------------------------------------------------------------------------------- --------
      • -------- ---------------------------------------------------------------------UNIT TYPE 1------------------------------------------------------------------------------------------- --------
      • -------- This is the Unit-Type which can enter the bunker --------
      • Set TempUnitType = Archer
      • -------- ----------------------------------------------------------------------------------------------------- --------
      • -------- And its coresponding dummy --------
      • Set TempUnitType2 = Archer (Dummy)
      • -------- ----------------------------------------------------------------------------------------------------- --------
      • -------- The next line runs the UnitRegister trigger which registers the Unit-Type to the system --------
      • Trigger - Run UnitRegister <gen> (ignoring conditions)
      • -------- ----------------------------------------------------------------------------------------------------- --------
      • -------- ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------
      • -------- ---------------------------------------------------------------------UNIT TYPE 2------------------------------------------------------------------------------------------- --------
      • -------- And now the second Unit-Type --------
      • Set TempUnitType = Advanced Archer
      • -------- ----------------------------------------------------------------------------------------------------- --------
      • -------- And its coresponding dummy --------
      • Set TempUnitType2 = Advanced Archer (Dummy)
      • -------- ----------------------------------------------------------------------------------------------------- --------
      • -------- And again we register the unit. --------
      • Trigger - Run UnitRegister <gen> (ignoring conditions)
      • -------- ----------------------------------------------------------------------------------------------------- --------
      • -------- ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------
      • -------- ---------------------------------------------------------------------UNIT TYPE 3------------------------------------------------------------------------------------------- --------
      • -------- And now the third Unit-Type --------
      • Set TempUnitType = Fire Archer
      • -------- ----------------------------------------------------------------------------------------------------- --------
      • -------- And its coresponding dummy --------
      • Set TempUnitType2 = Fire Archer (Dummy)
      • -------- ----------------------------------------------------------------------------------------------------- --------
      • -------- And again we register the unit. --------
      • Trigger - Run UnitRegister <gen> (ignoring conditions)
      • -------- ----------------------------------------------------------------------------------------------------- --------
      • -------- ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------
      • -------- ---------------------------------------------------------------------You can continue to 8192 unit types but I doubt you'd need that much------------------------------------------------------------------------------------------- --------
  • BunkerUnitRegister
    • Events
    • Conditions
    • Actions
      • -------- This sets the index of the unit-type and the number of unit-types which can shoot from a bunker, each time +1 --------
      • Set BunkerMaxUnits = (BunkerMaxUnits + 1)
      • -------- ----------------------------------------------------------------------------------------------------- --------
      • -------- This registers the unit-type to the system --------
      • Set BunkerUnits[BunkerMaxUnits] = TempUnitType
      • -------- ----------------------------------------------------------------------------------------------------- --------
      • -------- This registers its coresponding dummy to the system --------
      • Set BunkerDummies[BunkerMaxUnits] = TempUnitType2
      • -------- ----------------------------------------------------------------------------------------------------- --------
  • BunkerLoad
    • Events
      • Unit - A unit Is loaded into a transport
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Unit-type of (Transporting unit)) Equal to Bunker
          • (Unit-type of (Transporting unit)) Equal to Bunker Wooden
    • Actions
      • -------- Setting the entering unit and the bunker to variable --------
      • Set TempUnit = (Triggering unit)
      • Set TempUnit2 = (Transporting unit)
      • -------- ----------------------------------------------------------------------------------------------------- --------
      • -------- Setting the unit-type of the entering unit and the bunker to variable --------
      • Set TempUnitType = (Unit-type of TempUnit)
      • Set TempUnitType2 = (Unit-type of TempUnit2)
      • -------- ----------------------------------------------------------------------------------------------------- --------
      • -------- This makes the fire archer unable to fire form wooden bunker. --------
      • If ((TempUnitType Equal to Fire Archer) and (TempUnitType2 Equal to Bunker Wooden)) then do (Skip remaining actions) else do (Do nothing)
      • -------- ----------------------------------------------------------------------------------------------------- --------
      • -------- Custom values of the entering unit and the bunker --------
      • Set TempInteger = (Custom value of TempUnit)
      • Set TempInteger2 = (Custom value of TempUnit2)
      • -------- ----------------------------------------------------------------------------------------------------- --------
      • -------- The number of units who can enter the bunker --------
      • For each (Integer TempInteger3) from 1 to BunkerMaxUnits, do (Actions)
        • Loop - Actions
          • -------- ----------------------------------------------------------------------------------------------------- --------
          • -------- Then check if the unit can fire from the bunker --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • TempUnitType Equal to BunkerUnits[TempInteger3]
            • Then - Actions
              • -------- ----------------------------------------------------------------------------------------------------- --------
              • -------- The point of the bunker --------
              • Set TempPoint = (Position of TempUnit2)
              • -------- ----------------------------------------------------------------------------------------------------- --------
              • -------- Creating a dummy unit --------
              • Unit - Create 1 BunkerDummies[TempInteger3] for (Triggering player) at TempPoint facing Default building facing degrees
              • -------- ----------------------------------------------------------------------------------------------------- --------
              • -------- This makes the dummy not to run after the targes and stay in the bunker --------
              • Custom script: call SetUnitPropWindow(bj_lastCreatedUnit, 0)
              • -------- ----------------------------------------------------------------------------------------------------- --------
              • -------- Set variable for the dummy unit so we can destroy it in the unload trigger --------
              • Set BunkerDummy[TempInteger] = (Last created unit)
              • -------- ----------------------------------------------------------------------------------------------------- --------
              • -------- Add the unit to unit group so we can issue it an atack order --------
              • Unit Group - Add BunkerDummy[TempInteger] to BunkerUnitGroup[TempInteger2]
              • -------- ----------------------------------------------------------------------------------------------------- --------
              • -------- Mooving the dummy to the center of the bunker --------
              • Unit - Move BunkerDummy[TempInteger] instantly to TempPoint
              • -------- ----------------------------------------------------------------------------------------------------- --------
              • -------- Setting the mana of a unit if it has (as the fire archer here) --------
              • Unit - Set mana of BunkerDummy[TempInteger] to (Mana of TempUnit)
              • -------- ----------------------------------------------------------------------------------------------------- --------
              • -------- Clearing Leaks --------
              • Custom script: call RemoveLocation(udg_TempPoint)
              • -------- ----------------------------------------------------------------------------------------------------- --------
              • -------- Skiping all reamining actions so it dont repeat and make more unneeded units :) --------
              • Skip remaining actions
              • -------- ----------------------------------------------------------------------------------------------------- --------
            • Else - Actions
  • Unload
    • Events
      • Game - CargoEvent becomes Equal to 2.00
    • Conditions
    • Actions
      • -------- Custom values of the entering unit and the bunker --------
      • -------- For more information check Unit Event System --------
      • Set TempInteger = (Custom value of UDexUnits[UDex])
      • Set TempInteger2 = (Custom value of CargoTransportUnit[UDex])
      • -------- ----------------------------------------------------------------------------------------------------- --------
      • -------- Setting the mana of a unit if it has (as the fire archer here) --------
      • Unit - Set mana of UDexUnits[UDex] to (Mana of Dummy[TempInteger])
      • -------- ----------------------------------------------------------------------------------------------------- --------
      • -------- Removing the dummy from the game --------
      • Unit - Remove Dummy[TempInteger] from the game
      • -------- ----------------------------------------------------------------------------------------------------- --------
  • Atack
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Atack !
    • Actions
      • -------- Setting the bunker and the atack target into variables --------
      • Set TempUnit = (Casting unit)
      • Set TempUnit2 = (Target unit of ability being cast)
      • -------- ----------------------------------------------------------------------------------------------------- --------
      • -------- Setting the custom value of the bunker --------
      • Set TempInteger = (Custom value of TempUnit)
      • -------- ----------------------------------------------------------------------------------------------------- --------
      • -------- Picking all the units in the bunker and ordering them to atack --------
      • Unit Group - Pick every unit in BunkerUnitGroup[TempInteger] and do (Actions)
        • Loop - Actions
          • Unit - Order (Picked unit) to Attack TempUnit2
      • -------- ----------------------------------------------------------------------------------------------------- --------
Changelog

- Turned into mini-game and uploaded


- Updated documentation
- GetLastCreatedUnit() -> bj_lastCreatedUnit
- Added Wooden Bunker from which Fire Archers cant fire
- Fixed the scaling value as rulerofiron99 said
- Added different missiles for different dummiees and changed atack speed so you can see the difference


- Added register trigger and simplified initialization trigger
- Minor changes
- Updated documentation


- Reduced calls
- Fixed typos in the documentation



Keywords:
bunker,bunker system, starcraft bunker, garison, multy-unit bunker
Contents

BunkerSystem vB4 (Map)

Reviews
02:25, 30th Aug 2012 Magtheridon96: Approved. Well done. The comments make it very readable too.

Moderator

M

Moderator

02:25, 30th Aug 2012
Magtheridon96:

Approved.
Well done.
The comments make it very readable too.
 
Level 25
Joined
Jul 10, 2006
Messages
3,315
Nice, you uploaded it.

Only problem I have with it so far: I sometimes have to re-order a unit to enter the bunker, possibly because of the pathing map/range you're using?

In all other ways strictly superior to my system.

-Units-of-type can be set to fire from 1 bunker type and not from other
How is this configured? There was nothing about it in the triggers.

EDIT: Because the dummy units have a scaling value of 0.00, their missiles appear "wrong" - all the particles etc are rendered in exactly the same place. Either turn off Art - Scale Projectiles, or leave the units at normal scaling and set their vertex colouring to 100% transparency in the load trigger.
 
Level 12
Joined
Mar 24, 2011
Messages
1,082
I was in a rush when making the documentation :) Will update soon. Will add examples too.

Edit// Btw why noone thought of making a bunker system before ? And now voila - 2 of em :)

Edit2//
In all other ways strictly superior to my system.
Whrong :) Max number of garrisoned units is 10 in my system.
 
Last edited:
Top