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.
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    New recipe is another summer dessert Berry and Peach Cheesecake - https://www.thehelper.net/threads/recipe-berry-and-peach-cheesecake.194169/

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top