1. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  2. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still havn't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. The Lich King demands your service! We've reached the 19th edition of the Icon Contest. Come along and make some chilling servants for the one true king.
    Dismiss Notice
  4. The 4th SFX Contest has started. Be sure to participate and have a fun factor in it.
    Dismiss Notice
  5. The poll for the 21st Terraining Contest is LIVE. Be sure to check out the entries and vote for one.
    Dismiss Notice
  6. The results are out! Check them out.
    Dismiss Notice
  7. Don’t forget to sign up for the Hive Cup. There’s a 555 EUR prize pool. Sign up now!
    Dismiss Notice
  8. The Hive Workshop Cup contest results have been announced! See the maps that'll be featured in the Hive Workshop Cup tournament!
    Dismiss Notice
  9. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

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

Discussion in 'World Editor Help Zone' started by cj2006, Nov 4, 2007.

  1. cj2006

    cj2006

    Joined:
    Nov 2, 2007
    Messages:
    14
    Resources:
    0
    Resources:
    0
    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
     
  2. NoobMapmaker

    NoobMapmaker

    Joined:
    Oct 17, 2007
    Messages:
    550
    Resources:
    0
    Resources:
    0
    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.
     
  3. Lord_T

    Lord_T

    Joined:
    Oct 27, 2004
    Messages:
    928
    Resources:
    42
    Models:
    33
    Icons:
    7
    Packs:
    2
    Resources:
    42
    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: Nov 4, 2007
  4. nosebaer

    nosebaer

    Joined:
    Oct 13, 2007
    Messages:
    61
    Resources:
    1
    Tools:
    1
    Resources:
    1
    uhmm, a question on this, Lord_T;
    what to do, if the locations of enemies are randomly selected (the map is always visible), that the spawned units attack the enemy base?
     
    Last edited: Nov 4, 2007
  5. Lord_T

    Lord_T

    Joined:
    Oct 27, 2004
    Messages:
    928
    Resources:
    42
    Models:
    33
    Icons:
    7
    Packs:
    2
    Resources:
    42
    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.
     
  6. cj2006

    cj2006

    Joined:
    Nov 2, 2007
    Messages:
    14
    Resources:
    0
    Resources:
    0
    thanks for the teaching
    i'll try
    if my map success
    please support my map
    and give comments
     
  7. cj2006

    cj2006

    Joined:
    Nov 2, 2007
    Messages:
    14
    Resources:
    0
    Resources:
    0
    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 ?
     
  8. wd40bomber7

    wd40bomber7

    Joined:
    Aug 25, 2006
    Messages:
    974
    Resources:
    0
    Resources:
    0
    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'
     
  9. cj2006

    cj2006

    Joined:
    Nov 2, 2007
    Messages:
    14
    Resources:
    0
    Resources:
    0
    and i got another bug
    when i use the Lord_T's trigger
    it success,but the buildings cannot upgrade
    why?
     
  10. DenZel94

    DenZel94

    Joined:
    Jun 4, 2006
    Messages:
    127
    Resources:
    5
    Maps:
    3
    Tutorials:
    2
    Resources:
    5
    Due to the fact that it automatically creates units with training, cancelling the upgrading..

    The best I can say is cancel the trigger of training when the building starts to upgrade..
     
  11. cj2006

    cj2006

    Joined:
    Nov 2, 2007
    Messages:
    14
    Resources:
    0
    Resources:
    0
    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
     
  12. DenZel94

    DenZel94

    Joined:
    Jun 4, 2006
    Messages:
    127
    Resources:
    5
    Maps:
    3
    Tutorials:
    2
    Resources:
    5
    Are you sure the owner of the tower is yours?

    And also, I am not a expert on this due to that I already forgot advanced spawning "techniques"..

    Sorry if I am not able to help more..
     
  13. NoobMapmaker

    NoobMapmaker

    Joined:
    Oct 17, 2007
    Messages:
    550
    Resources:
    0
    Resources:
    0
    well maybe u dont even need to make the building train the unit, use the Unit-Create action then u can always upgrade whenever.
     
  14. Lord_T

    Lord_T

    Joined:
    Oct 27, 2004
    Messages:
    928
    Resources:
    42
    Models:
    33
    Icons:
    7
    Packs:
    2
    Resources:
    42
    To upgrade the building, just cancel the unit being trained. If the unit doesnt finish training, it won't auto-build a second unit.
     
  15. cj2006

    cj2006

    Joined:
    Nov 2, 2007
    Messages:
    14
    Resources:
    0
    Resources:
    0
    i cancel already
    but also cannot upgrade
    never mind
    i use another way
     
  16. cj2006

    cj2006

    Joined:
    Nov 2, 2007
    Messages:
    14
    Resources:
    0
    Resources:
    0
    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?