Custom Unit Training

†ALPHA†

New Member
Reaction score
3
I'm working on a fairly basic campaign and am using custom models. I tried writing a trigger that would train and "group" a custom unit for the computer opponent. The trigger fails to train the custom unit, however. I've read that the AI editor (which I've never used) is the only way to use custom races, but I want to highly control who and when the computer trains and attacks - I don't want it "doing its own thing".

This is my code:
Code:
Training
    Events
        Time - Elapsed game time is 5.00 seconds
    Conditions
    Actions
        Unit - Order Barracks 0012 <gen> to train/upgrade to a Man-at-Arms
        Unit Group - Add (Trained unit) to StormwindAttackers

Coincidentally, when the event was a periodic time it wouldn't work at all - even with a standard unit (footman). Your help on both my issues would be greatly appreciated!
 

DrEvil

FCRI Associate!
Reaction score
111
I think this is what you need ;

Code:
Barracks
    Events
        Time - Every 5.00 seconds of game time
    Conditions
    Actions
        Unit - Order <Barrack's #> to train/upgrade to a Man-at-Arms
Code:
Barracks gain
    Events
        Unit - A unit Finishes training a unit
    Conditions
    Actions
        Unit Group - Add (Trained unit) to <StormWindAttackers>
 

istar

New Member
Reaction score
31
you could directly deduct gold and create the unit instead of training if thats applicable
 

†ALPHA†

New Member
Reaction score
3
DrEvil > I tried that - doesn't work. Any other ideas?

istar > I thought of that and actually set it up for that earlier but I would still like to do an actual "training" if possible.
 

Schyy

New Member
Reaction score
5
did u set up everything correctly in the object editor ? ... cause the trigger should work ^^

check ur barracks and the unit in the object editor
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      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