1. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  2. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still haven't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. Ride into the sunset with the 32nd Modeling Contest.
    Dismiss Notice
  4. This adventure has come to an end. Congratulate our heroes in the 16th Mini Mapping Contest Results.
    Dismiss Notice
  5. From the gates of hell, the 5th Special Effect Contest Results have emerged.
    Dismiss Notice
  6. Race against the odds and Reforge, Don't Refund. The 14th Techtree Contest has begun!
    Dismiss Notice
  7. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

[General] Building Refunds and Putting rally points on a building

Discussion in 'World Editor Help Zone' started by Waves, Feb 11, 2014.

  1. Waves

    Waves

    Joined:
    Jul 10, 2013
    Messages:
    59
    Resources:
    0
    Resources:
    0
    1st Topic:

    If a building is destroyed mid-construction, you get no gold back.

    I thought of a simple fix, to refund if a building of that type is destroyed, but that would also refund fully completed versions of a buildings. So I'm a bit stumped, how do I make it construction only?

    2nd Topic:
    How do I give buildings rally point?
     
  2. DysfunctionaI

    DysfunctionaI

    Joined:
    Mar 6, 2006
    Messages:
    281
    Resources:
    1
    Tutorials:
    1
    Resources:
    1
    Edited**

    Trigger 1:

    • Untitled Trigger 001
      • Events
        • Unit - A unit Finishes construction
      • Conditions
      • Actions
        • Unit - Set the custom value of (Triggering unit) to 1


    Trigger 2:

    • Untitled Trigger 001
      • Events
        • Unit - A unit Dies
      • Conditions
        • ((Triggering unit) is A structure) Equal to True
        • (Custom value of (Triggering unit)) Equal to 0
      • Actions
        • Remove the resources that were refunded.


    To get the resource cost of the building, you probably need to use a hashtable. I also think that there's a system for getting the resource cost of something, lemme see if I can find it.

    • Unit - Order No unit to Set Rally Point To (Center of (Playable map area))
     
    Last edited: Feb 11, 2014
  3. Adiktuz

    Adiktuz

    Joined:
    Oct 16, 2008
    Messages:
    9,674
    Resources:
    23
    Models:
    2
    Packs:
    1
    Maps:
    1
    Spells:
    16
    Tutorials:
    1
    JASS:
    2
    Resources:
    23
    or in case you don't want to use CV,

    you can add the buildings to a unit group upon construction, and remove them if it finishes construction