• 🏆 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!

A question about share-able buildings.

Status
Not open for further replies.
Level 15
Joined
Nov 26, 2005
Messages
1,151
Hello forum.

I have a question:
Have you ever played survival/troll tribes? Well I need the same idea for the buildings.

I need this: When a player builds a building his allies can use all the spells the building has (even when far away from the building) and remove/place items inside the building inventory.

How's that done?

10x and +rep for answers!
 
Level 11
Joined
Aug 6, 2009
Messages
697
Hello forum.

I have a question:
Have you ever played survival/troll tribes? Well I need the same idea for the buildings.

I need this: When a player builds a building his allies can use all the spells the building has (even when far away from the building) and remove/place items inside the building inventory.

How's that done?

10x and +rep for answers!
Heres my idea,add the ability select user to the building you want to be able to be shared.
 
Level 7
Joined
Jun 6, 2010
Messages
224
  • Windu
    • Events
      • Unit - A unit Finishes construction
    • Conditions
    • Actions
      • Set MyForce = (All allies of (Owner of (Triggering unit)))
      • Player Group - Pick every player in MyForce and do (Actions)
        • Loop - Actions
          • Player - For (Owner of (Triggering unit)), turn Shared units On toward (Picked player)
      • Player Group - Remove all players from MyForce
Make sure the building has also the following abilities:

Unit Inventory
Select Unit/Hero (Select range should also be global if you wanna do things from afar)

since you get ownership of the unit, you can use any of its abilities, cast its spells, train its units etc.
 
Prince.Zero, you create a player group, but you never destroy it. If you destroy it, you won't be able of referring to it again; if you just remove the players, you won't be able of cleaning the leak. To prevent that, refer to those players by their index:
  • Trigger
  • Events
    • Unit - A unit Finishes construction
  • Conditions
  • Actions
    • For each (IntegerA) from 1 to 12, do (Actions)
      • Loop - Actions
        • If (All conditions are true) then do (Actions) else do (Actions)
          • If - Conditions
            • (Player(IntegerA) is an ally of (Owner of (Triggering unit)) Equal to True //Boolean comparison
          • Then - Actions
            • Player - For (Owner of (Triggering unit)), turn Shared units On toward (Player(IntegerA))
          • Else - Actions
:]

By the way, Windu, long time no see, what's up?
 
Status
Not open for further replies.
Top