Auto spawning units from BUILT buildings.

WarToast

Active Member
Reaction score
3
Hello, I've been searching around a lot on this subject, but couldn't find anything that relates directly to my problem. ;)

As in the map Tech Wars Tournament (by oxYgen and Blu3), I'd like to be able to build buildings and make them spawn units. In TWT units are spawned as if there is a summon spell on auto-cast, but after reading around a bit, I've found that it is not possible.

So I need to make a trigger. I can't make the basic periodic spawner because I don't have a specific building already on the map - I need a constructed building to start periodically spawning units.

By the way, I have tried using this:

Code:
Events
    Time - Every 10.00 seconds of game time
Actions
    Unit Group - Pick every unit in (Units in (Playable map area) matching ((Unit-type of (Matching unit)) Equal to Barracks)) and do (Unit - Create 1 Footman for (Owner of (Picked unit)) at (Position of (Picked unit)) facing Default building facing degrees)

but that spawns units from the building as soon as I start constructing it, also I'd like buildings to have "individual" spawn times, and with a periodic event, units will be created at the same time, no matter when you build the building.

So to wrap this mess up: I need constructed buildings to spawn units, independant on some periodic event, maybe with an ability, auto-cast with triggers?

Thanks in advance guys :thup:
 

Squishy

You can change this now in User CP.
Reaction score
127
You could try setting every building's custom value to 10, and then every second, subtract 1 from every buildings custom value, then, when a building custom value reaches 0, you can create a unit for that building, and set the custom value to 10 again.
 

WarToast

Active Member
Reaction score
3
You could try setting every building's custom value to 10, and then every second, subtract 1 from every buildings custom value, then, when a building custom value reaches 0, you can create a unit for that building, and set the custom value to 10 again.

Woah, that's not really what I had in mind ;) Thanks for answering dude

I think that what I'm looking for is a summon spell that is made auto-cast by triggers.
 

martix

There is no spoon
Reaction score
49
The easy way:
Give each building a summon ability based on the same initial ability(the phoenix one?) and add them to a group, then at say 1 second intervals order each unit in the group to cast that ability. They may be diffrent abilites, but if they are based on the same OrderId(initial ability), all of them will respond to the summon order. Now of course add the proper cooldown, they won't summon anything unless the ability is ready anyway.
That way you don't monopolize the custom value field and have it free for other tasks. :)
The hard way:
JASS and attachments and stuff. :)
 

verdr3t

New Member
Reaction score
8
Or try something simpler like this...

Variables:
Footmen_Timer - Timer
Barracks_Spawn - Point

Code:
Barracks
    Events
        Unit - A unit Finishes construction
    Conditions
        (Unit-type of (Triggering unit)) Equal to Barracks
    Actions
        Countdown Timer - Start [COLOR="Red"]Footmen_Timer[/COLOR] as a Repeating timer that will expire in 30.00 seconds

Code:
Spawn Footmen
    Events
        Time - Footmen_Timer expires
    Conditions
    Actions
        Unit - Create 1 Footman for Player 1 (Red) at [COLOR="Red"]Barracks_Spawn[/COLOR] facing Default building facing degrees

Of course this is only the basics. You also need to consider that there my be
more Barracks, what happens when the Barracks are destroyed and stuff.

EDIT: You can optionally add a Dummy ability to the building which is being
cast when the timer expires but does nothing so you are able to judge by the
cooldown animation when the next waves starts.


Cheers
 

Squishy

You can change this now in User CP.
Reaction score
127
If taking up the custom value is a problem, there are methods to get multiple custom values.
 

Cokemonkey11

New Member
Reaction score
18
I'm not having the problem, and I know 5 other ways off the top of my head to fix the problem, but how do you get multiple custom values? substrings or something? like 1515 = 1, 5, 1, 5?

sorry for offtopic question
 

Squishy

You can change this now in User CP.
Reaction score
127
You can get multiple custom values through integer arrays. First make sure every units custom value is different. Then, make as many integer arrays as you want. Then you can use the arrays as custom values by using the custom value of units as the array number.
 

PureOwnage

Minecraft Server OP, Inactive.
Reaction score
72
By looking at the video, it runs off a auto cast summoning ability then orders the unit to go to the selected region.
 

martix

There is no spoon
Reaction score
49
By the looks of it - its a summoning ability, that is ordered to cast once cooldown is over...
So it can be done either with a universal periodic event as I suggested earlier - with a smaller interval(don't know how this will affect performance though) or, detect the event of casting that ability and start a repeating timer, that upon expiration casts it again.
So yea, not entirely different from what I already said.
 

verdr3t

New Member
Reaction score
8
I think it's just a dummy spell running off everytime a unit is spawned and the rest is triggered.
 

XxShadyxX

I abused the rep system.
Reaction score
81
Here is a simple way of spawning units
Code:
UnitSpawnBarracks
Events
Generic Unit Event: A building is constructed
Condition
Triggering Unit is a Barracks
Action
Issue order with no target: Issue triggering unit to Train a Footman

Trigger 2
Code:
Spawns
Events
A Unit is trained
Conditions
Actions
Issue triggering unit to issue Train of type of trained unit

I hope this helps!! for the First trigger you need to make one for each building that has spawns. To make it easier put them all into a If/then/else function for each building!

I hope this answers your question GL
 

WarToast

Active Member
Reaction score
3
Hey everyone

Certainly got a lot of suggestions in here! I contacted the maker of Tech Wars Tournament sometime ago and today I received an answer.

Well, it turns out that he based his summoning spells on the Archmage's Summon Water Elemental. Then, every 0,5 sec, he ordered all units to cast this ability... that simple.

Also, if anyone is interested, he mentioned that he posted a non-protected version of his map on his TWT blog http://techwarstournament.blogger.de/.

Link here: http://techwarstournament.blogger.de/getfile?name=tech+wars+tournament+1.1b.w3x


Really appreciate all your answers, and I'll look through them. Thanks guys :thup:
 
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

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top