HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Get Unit starts Training Unit

08-10-2004, 06:13 PM#1
EvilShade
Okay, thats the problem:

I want to get the structure that startet Training a Footman. I startet making the trigger via 'Generic Unit Event - Get Unit started Training a Unit'. Then i wanted to make a condition, but there is no 'Get Structure that Triains Unit' variable.

Then i tried to make it with 'Get Last Trained Unit', but still, theres no way to get the building that trained the footman acually.

Can you help me out?
08-10-2004, 07:03 PM#2
wwsage
Code:
Melee Initialization
    Events
        Unit - A unit Finishes training a unit
    Conditions
        ((Triggering unit) is A structure) Equal to True
        (Unit-type of (Trained unit)) Equal to Footman
    Actions

I think that might work ;/ The triggering unit would have to be a structure due to the conditions, and anything you need based off of the structure that built the footman can be done by triggering unit.

At least I think so, might not work.
08-10-2004, 08:13 PM#3
EvilShade
Thanks, that worked.

Okay, another (and hopefully the last) problem: If he trys to train a footman the barrack should clear the training action. I checked the unit commands, but there is no 'Issue unit to stop training' or something. I made it so that the Barrack gets replaced if he clicks on the Barrack and try to train a footman, but there must be a simplier way. May someone tell me one? Thanks.
08-10-2004, 08:56 PM#4
wwsage
Do you want the footman to be just flat out un-trainable? You can do that via object editor I think.

Select the barracks you have that trains units in the object editor

Techtree - Units Trained

just take out footmen.

Otherwise Im not exactly sure ;/
08-10-2004, 09:02 PM#5
EvilShade
Well i need the otherwise. I know that i can take out the option to build footmans, but it should only be impossible for a few amount of time. And no, there must be the opportunity to build one, but if he trys, the barrack should stop the training immideatly.
08-10-2004, 09:15 PM#6
Anitarf
I have fiddled with your problem a bit and haven't found any solution for it. Cancelling a training of unit simply doesn't register as any kind of order, so it also cannot be given as an order, even through advanced means. The problem with replacing barracks is that it also cancles all other units on the training queue. The only alternative I see is removing footmen when trained, or asking some of the jass people for any help.
08-10-2004, 09:23 PM#7
wwsage
Yeah theres not way to do what you ask there ;/

Blizzard has the option of Event Response Trained Unit, but for some reason they dont have "Training Unit" or "Unit being Trained".

I still don't know why you want the barracks to be able to train footmen if you are going to cancel it anyway, if you want to limit the amount of footmen that you can train use

Player - Limit training of Footman to <What you want> for <Which Player>

Otherwise I have no idea unless theres some kind of jass command.

Ugh I wonder why blizzard didn't add a unit being trained or training unit under event response to go with all of their training events ._.