Item unit spawn

Avaleirra

Is back. Probably.
Reaction score
128
Hi, in my map each player has a special unit with an inventory. I want this unit to buy items from stores, the items spawn units in a region.

How can I make the items spawn units? Items can be stacked too.




I also want to make it so that the units created can be selected, but you the player can't control them. e.g, you can't order it to move to a point, can't order it to cast a spell, can't order it to attack, etc...





Thanks, +rep for solution
 

Joccaren

You can change this now in User CP.
Reaction score
54
For buying the units, make a tome that does nothing. Then, make a trigger like this:
Trigger:
  • Buy unit
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to Your Tome
    • Actions
      • Unit - Create Your Number Your Unit for (Owner of (Hero manipulating item)) at (Center of (Your Region)) facing Default building facing degrees


To stop a player from controlling a unit. Swap the bought units owner to an AI that does nothing. (I assume you want it like Hero Line).

Or you could constantly clear all units of that type from the players selection Using this trigger:

Trigger:
  • No Select
    • Events
      • Time - Every 0.01 seconds of game time
    • Conditions
    • Actions
      • Selection - Remove (Random unit from (Units of type Your Unit)) from selection for Your Player
 

Avaleirra

Is back. Probably.
Reaction score
128
For my first issue:
that doesn't work because I want it to be a periodic timer

for my second issue:
I still want it to be owned by the player with the item
 

Joccaren

You can change this now in User CP.
Reaction score
54
1. What do you mean, they buy an item and then it spawns a unit every X seconds once that item has been bought?

2. Editted above, try selection option
 

Avaleirra

Is back. Probably.
Reaction score
128
1: yes

2: what does removing selection do? Units still need to be able to be selected, just not controlled
 

Joccaren

You can change this now in User CP.
Reaction score
54
1. Is the item a power-up where you only buy it once then the units spawn or do you have to be holding the item for the units to spawn. Also, do you want more units to spawn the more items you have?

2. Constantly order them to move to where you want them to with this:
Trigger:
  • Move
    • Events
      • Time - Every 0.01 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units in (Playable map area) matching ((Unit-type of (Matching unit)) Equal to Your Unit)) and do (Actions)
        • Loop - Actions
          • Unit - Order (Picked unit) to Move To (Center of (Your Region))
 

Avaleirra

Is back. Probably.
Reaction score
128
1. The unit has to be holding the item, and each player can have more than one (up to 6)

2. I actually would prefer the area where all the commands are given to be hidden.
 

Joccaren

You can change this now in User CP.
Reaction score
54
1. Here:

Spawning Trigger:
Trigger:
  • Spawn
    • Events
      • Time - Every 30.00 seconds of game time
    • Conditions
    • Actions
      • Unit - Create ItemNumber Footman for Your Player at (Center of (Your Region)) facing Default building facing degrees

Increasing Item held Trigger:
Trigger:
  • Increase Number
    • Events
      • Unit - A unit Acquires an item
    • Conditions
    • Actions
      • Set ItemNumber = (ItemNumber + 1)


Decreasing Item Held Number:
Trigger:
  • Decrease Number
    • Events
      • Unit - A unit Loses an item
    • Conditions
    • Actions
      • Set ItemNumber = (ItemNumber - 1)


To make MUI, create Variable Arrays for Item Number Instead of Variables.

2. Try Soul Burning to remove abilities and Unselect the 'Show UI' option in the attack section for your unit.
 

Avaleirra

Is back. Probably.
Reaction score
128
1. What if a player has 2 different items that spawn units? Would I have to create a trigger for each one? (there are 50 units...)

2. Soul burn removes abilities?
 

Joccaren

You can change this now in User CP.
Reaction score
54
1. Yes, create different triggers for each unit
2.No, not remove, disable. (Now that I think of it, problem)
 

Avaleirra

Is back. Probably.
Reaction score
128
1. K I will try it out +rep for now

2. How can I hide them so that they can be cast, but a player can't tell the unit when to cast it.


EDIT: nvm gotta spread rep
 

Joccaren

You can change this now in User CP.
Reaction score
54
2. You could cheat and create just a black square .blp file, import it then use that as the icon for the abilities. Then Just give the Abilities spacebar tooltips (Might not Work). This should hopefully Hide them from a player who doesn't know what your doing.
1. Don't worry, just add it when you can.
 

Hellohihi

New Member
Reaction score
42
1. K I will try it out +rep for now

2. How can I hide them so that they can be cast, but a player can't tell the unit when to cast it.


EDIT: nvm gotta spread rep

Put the abilities on a hidden dummy unit instead.

And when you want to cast the abilities, use the dummy unit to cast it instead.

Alternatively, you could use a trigger-player-disabled spell-book ability to hide passive abilities.
BUT I am not sure if the spell book ability will work for active abilities or not.
 

Admit

New Member
Reaction score
25
Joccaren, Your tigger needs 1 trigger for every unit (If the player has more than 1 unit).

Here is a easy MUI Trigger:

Trigger:
  • ItemUcreate
    • Events
      • Time - Every 30.00 seconds of game time
    • Conditions
    • Actions
      • Set Temp_UnitGroup = (Units in (Playable map area))
      • Set Temp_Point = (Position of (Picked unit))
      • Unit Group - Pick every unit in Temp_UnitGroup and do (Actions)
        • Loop - Actions
          • For each (Integer A) from 1 to 6, do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Item-type of (Item carried by (Picked unit) in slot (Integer A))) Equal to "Your Item"
                • Then - Actions
                  • Unit - Create 1 Footman for (Owner of (Picked unit)) at (Position of (Picked unit)) facing Default building facing degrees
                • Else - Actions
      • Custom script: call DestroyGroup (udg_Temp_UnitGroup)
      • Custom script: call RemoveLocation (udg_Temp_Point)
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      • Ghan
        Administrator - Servers are fun

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top