Snippet True Instant Tower Building

Exfyre

hmm...
Reaction score
60
I was making a TD, and I wanted everything to be able to be built instantly. The best the editor would let you do is one second, so here is what i came up with.

Code:
Instant Build
    Events
        Unit - A unit Begins construction
    Conditions
    Actions
        Unit - Remove (Triggering unit) from the game
        Set tempLoc = (Position of (Triggering unit))
        Unit - Create 1 (Unit-type of (Triggering unit)) for (Owner of (Triggering unit)) at tempLoc facing Default building facing (270.0) degrees
        Custom script:   call RemoveLocation(udg_tempLoc)

To make it work correctly, you must use a builder with Repair(human). Orc builders get stuck because they go inside the unit to build it and when the unit is removed, they stay that way. Summoners have that slow reaction time to shift-clicks, so it's not really instant (but can be bypassed by not using shift-clicks).

So, go with a human builder!

EDIT:
Rather than post a screenshot, i decided to upload the TD i was working on. (any bug-finds are welcome).
 

Attachments

  • Spawn TD v0.82.w3x
    256.6 KB · Views: 245

Exfyre

hmm...
Reaction score
60
Here is one way (in a TD, of course) i used.
This trigger adds the sell ability to each tower as it enters the game.

Code:
Add ability Copy
    Events
        Unit - A unit enters (Playable map area)
    Conditions
        (Owner of (Triggering unit)) Not equal to (!=) Player 11 (Dark Green)
        ((Triggering unit) is A structure) Equal to (==) True
    Actions
        Wait 0.10 seconds
        Unit - Add Sell Tower  to (Triggering unit)
        Set CustomValue[(Custom value of (Triggering unit))] = (CustomValue[(Custom value of (Triggering unit))] + (Point-value of (Triggering unit)))

Also Unit Begins construction refers to the constructing structure, not the unit performing the construction. Try the map. It will show you.
 

manofsteel

New Member
Reaction score
36
It's not really anything special about this, but could be useful for people who are new to the world editor.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top