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 havn't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. The 18th Icon Contest is ON! Choose any ingame unit and give him/her Hero abilities. Good luck to all.
    Dismiss Notice
  4. The Secrets of Warcraft 3 have revealed interesting works. The RESULTS for Abelhawk's Mini-Mapping Contest #15 have come out!
    Dismiss Notice
  5. Contestants are to create a scene set in the Stone Age. Come and see what you can come up with. We wish you the best of luck!
    Dismiss Notice
  6. Colour outside the lines! Techtree Contest #13 is a go. The contest is optionally paired.
    Dismiss Notice
  7. Night Rider gained several songs for his journey. The poll for the 12th Music Contest has started. Check it out!
    Dismiss Notice
  8. Greetings cerebrates, our Swarm needs new spawners that will have numerous children. Join the HIVE's 31st Modeling Contest - Spawners and Spawned! The contest is optionally paired.
    Dismiss Notice
  9. Join other hivers in a friendly concept-art contest. The contestants have to create a genie coming out of its container. We wish you the best of luck!
    Dismiss Notice
  10. 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.

how can i make a unit garrison inside a neutral building and change its owner

Discussion in 'World Editor Help Zone' started by andreasaspenberg, Mar 30, 2013.

  1. andreasaspenberg

    andreasaspenberg

    Joined:
    Mar 2, 2010
    Messages:
    3,016
    Resources:
    0
    Resources:
    0
    the owner of the building that is. i need a method to make buildings neutral when units arent inside and owned when there is units inside.
     
  2. Squiggy

    Squiggy

    Joined:
    Mar 25, 2008
    Messages:
    2,603
    Resources:
    18
    Maps:
    2
    Spells:
    15
    Tutorials:
    1
    Resources:
    18
    How do you even enter such structures?
    Do you use an ability based on load?
     
  3. andreasaspenberg

    andreasaspenberg

    Joined:
    Mar 2, 2010
    Messages:
    3,016
    Resources:
    0
    Resources:
    0
    it needs to be a system that enables multiple units to garrison inside the building but that change the owner of the building from neutral to the owner of the unit. removing all units from it or will cause it to become neutral again.
     
  4. deathismyfriend

    deathismyfriend

    Joined:
    Oct 24, 2012
    Messages:
    6,532
    Resources:
    14
    Spells:
    12
    Tutorials:
    2
    Resources:
    14
    Try this

    Trig1

    Events
    Unit in range of neutral building
    Conditions
    Actions
    Hide unit
    Add unit to garrison group 1
    Change owner of unit neutral building and change color if wanted
    Increase attack / speed per unit if wanted
     
  5. andreasaspenberg

    andreasaspenberg

    Joined:
    Mar 2, 2010
    Messages:
    3,016
    Resources:
    0
    Resources:
    0
    the unit needs to be ordered to garrison. i would prefer to use a garrison ability though if possible.
     
  6. MajorKaza

    MajorKaza

    Joined:
    Nov 19, 2011
    Messages:
    511
    Resources:
    1
    Maps:
    1
    Resources:
    1
    1st: give it tradeing skills like shop
    2nd: add garison skill (will be able to use by anyone near if unit is neutral)
    3rd: when skill is used change owner and use again by trigger.

    You can use custom data to control units count (0-4). If 0 then switch back.
     
  7. andreasaspenberg

    andreasaspenberg

    Joined:
    Mar 2, 2010
    Messages:
    3,016
    Resources:
    0
    Resources:
    0
    i tried that but i dont know the right target configuration needed to make it work. are you able to help me there.
     
  8. NightSkyAurora

    NightSkyAurora

    Joined:
    Mar 1, 2013
    Messages:
    528
    Resources:
    8
    Models:
    4
    Spells:
    4
    Resources:
    8
    Give the building devour (natural hostle), Devour cargo - (set devour cargo damage to 0) and unload. If your unit is close to a building and casts a 'enter' ability, order the building to devour the casting unit and make the building yours via triggers. to exit the building - unload.

    Targets allowed:
    devour (natural hostle) - enemy, friend, invulnerable, organic, vulnerable
    Devour cargo - enemy, friend, ground, invulnerable, natural, vulnerable
    unload - defult

    note: you can only have one unit inside at a time. Maby you can have more than one but I didn't find a way yet.
     
    Last edited: Mar 31, 2013
  9. andreasaspenberg

    andreasaspenberg

    Joined:
    Mar 2, 2010
    Messages:
    3,016
    Resources:
    0
    Resources:
    0
    what du you suggest for the enter ability.
     
  10. NightSkyAurora

    NightSkyAurora

    Joined:
    Mar 1, 2013
    Messages:
    528
    Resources:
    8
    Models:
    4
    Spells:
    4
    Resources:
    8
    there are many ways:
    -make a custom roar ability and modifi it to do nothing. if a unit is close enough to the building, use triggers to add the enter abilty, else remove the ability.
    a unit starts the effect of an ability
    ability being cast equal to roar
    order 'your building' to natural devour casting unit
    (no need to check range because nothing will happen when the casting unit is further than the casting range of devour)

    -OR-

    -give the building the abilty to buy a free unit (like travens on melee maps where you can buy heroes or hire units). Lets name the free unit 'enter' and go to triggers.
    If a unit comes within 100 range of your building.
    Entering unit equals to 'enter'
    Remove entering unit from the game.
    Pick every unit within 100 range of your building and do actions
    order 'your building' to natural devour picked unit.

    -OR-

    Use a target ability. Lets take a modified Acid bomb and call it 'enter'; your acid bomb or enter has 100 cast range
    A unit starts the effect of an ability
    Ability being cast equal to 'enter'
    order (target of ability being cast) to natural devour (casting unit)
     
    Last edited: Apr 1, 2013
  11. MajorKaza

    MajorKaza

    Joined:
    Nov 19, 2011
    Messages:
    511
    Resources:
    1
    Maps:
    1
    Resources:
    1
    There is Loading Unit pointer and unit custom value.

    Custom value should be equal to loaded units count.

    +1 per each loaded unit
    -1 per each unloaded unit

    And no need custom ability for this. Just script. Try in vJass section how to refer to easiest refer to loaded unit.