• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Problems on auto unit train(train by building) and units trained auto move

Status
Not open for further replies.
Level 2
Joined
Nov 2, 2007
Messages
14
im creating a tech wars.
im on problems (title).
please teach me how to:
auto train unit(train by buildings)
units train by buildings auto move.

upload pictures so that i can learn easy
thank you
 
Level 9
Joined
Oct 17, 2007
Messages
547
I think u should try using triggers to create the unit then order it to move towards a specific point right after. NOt sure if its even possible to make building auto train units though, but u can always make a trigger that will "order" the buildign to do that.
 
Level 22
Joined
Oct 27, 2004
Messages
914
Ok.. This is really simple, I doubt that you'll need pictures...
The first thing you do is make a trigger to begin construction. You will need one for each type of building that you make.
So... Let's use barracks as an example. We first create a trigger called "TrainStart". The trigger should be:
Events: Unit: Generic unit Event: Finishes construction.
Conditions: Unit Type Comparison: Unit type of constructed structure equal to Barracks.
Actions: Unit: Issue Uprade/Train order. Order Triggering unit to create 1 footman.


-----------

That's trigger one, to begin the training. Then we have another trigger that will make it loop.
This is trigger "TrainLoop"
Events: Unit: Generic unit Event: Finishes training a unit
Conditions: Boolean Comparison: Owner of triggering unit is in player group ( good side, bad side)
Actions: Unit: Issue Uprade/Train order. Order Triggering unit to train (unit-type of (trained unit)).
Unit: Issue Order Targeting a point: Order Trained unit to Attack-Move to center of region: ( Region of enemy base. You will need two of this trigger, one for each team.)

-------

Soooo... We need one Trainstart for every building we want to auto train, but
Only two TrainLoop, because it makes every building, as soon as it finishes creating a unit, to make another one and orders the created unit to attack the enemy base. This system also makes it easier to cancel in order to upgrade the building, because it only builds another unit after it completes.
Good luck in your map, I hope i helped.
 
Last edited:
Level 22
Joined
Oct 27, 2004
Messages
914
Well, nosebaer, then you could set up the trigger differently, a little like this:
Order Trained unit to Attack-Move to position of unit (random unit from ( pick every unit within (playable map area matching condition (owner of triggering unit equal to (enemy player))))).
So, this way, When a unit is trained, it will attack a random enemy unit. Or you could create a target variable, which sets to a random unit from the enemy and changes every 2 minutes or so, so your units don't all go running after different enemies.
 
Level 2
Joined
Nov 2, 2007
Messages
14
thanks for the teaching
i'll try
if my map success
please support my map
and give comments
 
Level 2
Joined
Nov 2, 2007
Messages
14
Conditions: Boolean Comparison: Owner of triggering unit is in player group ( good side, bad side


don't have such condition
can you upload photo for me ?
 
Level 11
Joined
Aug 25, 2006
Messages
971
Its the default condition
Just click New--> Condition, and don't touch anything
You'll see it says 'Boolean Comparison'

Then there is a function you can choose called 'unit belongs to ally/enemy of player'
 
Level 2
Joined
Nov 2, 2007
Messages
14
and i got another bug
when i use the Lord_T's trigger
it success,but the buildings cannot upgrade
why?
 
Level 2
Joined
Nov 2, 2007
Messages
14
if like that means

units must click ourself
they can move automatically

this morning i test with my friend
when i spawn a unit
it attacks my towers
 
Level 2
Joined
Nov 2, 2007
Messages
14
erm
my units can auto train and auto spawn,auto move already
but if i playing with player
my units will changes to oppenent unit
how to fix this bug?
 
Status
Not open for further replies.
Top