• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Building over cliffs

Status
Not open for further replies.
Level 24
Joined
Feb 28, 2007
Messages
3,480
Hello

I want to make shipyards in my map buildable over cliffs, like this:

example.png

So basically, if you have a worker on the cliffs, he should be able to build shipyards on the water just below the cliffs. This should only work if the worker is on cliff level 1, quite obviously.
I know Strategy_Master this something similar for his Wc2 mod, so it should definitely be doable.

Oh while I got your attention, is it also possible to make transports able to unload troops over cliffs?

Any help is appreciated, thanks.
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
The building order is "goblinshipyard".

You could check the height between the two locations.
And then you could create a dummy peasant (flying so he can get over the cliff) to actually build it.
I know my method is quite stupid, but at the moment it is all I can think of (while still retaining the natural build progress).

  • Build
    • Events
      • Unit - A unit Is issued an order targeting a point
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Peasant
      • (String((Issued order))) Equal to goblinshipyard
    • Actions
      • Set Loc1 = (Position of (Triggering unit))
      • Set Loc2 = (Target point of issued order)
      • Custom script: set udg_Z1 = GetLocationZ(udg_Loc1)
      • Custom script: set udg_Z2 = GetLocationZ(udg_Loc2)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Z1 - Z2) Greater than or equal to 89.00
          • (Z1 - Z2) Less than or equal to 90.00
        • Then - Actions
          • Unit - Create 1 Flying Peasant for (Owner of (Triggering unit)) at Loc1 facing 0.00 degrees
          • Custom script: call IssuePointOrderLoc(bj_lastCreatedUnit, "goblinshipyard", udg_Loc2)
          • Unit - Order (Triggering unit) to Move To Loc2
        • Else - Actions
      • Custom script: call RemoveLocation(udg_Loc1)
      • Custom script: call RemoveLocation(udg_Loc2)
It does create the building over the cliff (only when the cliff is 1 high), the peasant still moves to it, but it doesn't build it itself (maybe you could order the peasant to use repair on the building once construction has started though).
Another problem is that you can build it at any range. A simple solution would be to progressively increase the range from the peasant to the target and check the height at each itteration (like a shockwave-movement), then you can relatively easily see how far the target is away from the cliff.
 
Level 2
Joined
Apr 21, 2008
Messages
18
To change the transport problem, all you have to do is change the Range value in the Object Editor for the correct Unload ability the ship is using. IE. Unload (Ship).

For the height problem with the shipyard, you might be able to make triggers and "dummy" units to make it work. To make a dummy unit, simply create a new unit based off of any one (In your case the unit you want to train over the cliff); give it the Locust ability and change the Model File to ".mdl" in the Custom Path text field.

Make the structure build the dummies; then create a trigger that makes it so whenever a unit (the building structure) finishes training a certain unit (unit defined in Conditions) it deletes the trained unit and creates the "real" unit in a region you place adjacent to the shipyard in the water.

It looks semi-complicated but you'll figure it out just fine. You'll find that map-making, like all things, becomes easier with practice.
 
Last edited:
Status
Not open for further replies.
Top