Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

Load 2 specific unit-types

Discussion in 'Triggers & Scripts' started by CaptainHero, Jul 6, 2015.

  1. CaptainHero

    CaptainHero

    Joined:
    Sep 30, 2012
    Messages:
    197
    Resources:
    1
    Spells:
    1
    Resources:
    1
    I want that a unit can only load two specific unit types..

    So abort the order "load" doesn't seem to happen fast enough.
    And instantly unloading the unit isn't very smooth either..

    Any ideas?

    Giving a unit two times "Battle Station" is of course buggy - only one will work.

    Thanks in advance

    Unload
    • Untitled Trigger 001
      • Events
        • Unit - A unit Is loaded into a transport
      • Conditions
      • Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • Or - Any (Conditions) are true
              • Conditions
                • (Unit-type of (Triggering unit)) Equal to Archer
                • (Unit-type of (Triggering unit)) Equal to Militia
            • Or - Any (Conditions) are true
              • Conditions
                • (Unit-type of (Transporting unit)) Equal to Town Hall
                • (Unit-type of (Transporting unit)) Equal to Keep
                • (Unit-type of (Transporting unit)) Equal to Castle
          • Then - Actions
          • Else - Actions
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • Or - Any (Conditions) are true
                  • Conditions
                    • (Unit-type of (Transporting unit)) Equal to Town Hall
                    • (Unit-type of (Transporting unit)) Equal to Keep
                    • (Unit-type of (Transporting unit)) Equal to Castle
              • Then - Actions
                • Set TempUnit = (Triggering unit)
                • Set TempUnit2 = (Transporting unit)
                • Set TempPoint = (Position of TempUnit)
                • Game - Display to (Player group((Triggering player))) the text: |cffffcc00Can't loa...
                • Unit - Order (Transporting unit) to Unload All At TempPoint
                • Set TempUnit2 = No unit
                • Set TempUnit = No unit
                • Custom script: call RemoveLocation( udg_TempPoint )
              • Else - Actions



    Abort
    • rdd
      • Events
        • Unit - A unit Is issued an order targeting an object
      • Conditions
      • Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Issued order) Equal to (Order(load))
            • (Unit-type of (Triggering unit)) Equal to Town Hall
          • Then - Actions
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • Or - Any (Conditions) are true
                  • Conditions
                    • (Unit-type of (Target unit of issued order)) Equal to Milita
                    • (Unit-type of (Target unit of issued order)) Equal to Archer
                    • (Unit-type of (Target unit of issued order)) Equal to Peasant
              • Then - Actions
              • Else - Actions
                • Set TempUnit = (Triggering unit)
                • Set TempUnit2 = (Target unit of issued order)
                • Set TempPoint = (Position of TempUnit2)
                • Unit - Order TempUnit to Stop
                • Unit - Order TempUnit2 to Move To TempPoint
                • Unit - Order TempUnit2 to Stop
                • Game - Display to (Player group((Triggering player))) the text: |cffffcc00Can't loa...
                • Set TempUnit = No unit
                • Set TempUnit2 = No unit
                • Custom script: call RemoveLocation( udg_TempPoint )
          • Else - Actions

     
  2. Maker

    Maker

    Joined:
    Mar 6, 2006
    Messages:
    9,174
    Resources:
    17
    Maps:
    2
    Spells:
    14
    Tutorials:
    1
    Resources:
    17
    Pause unit
    Stop order
    Unpause unit

    That should do it.
     
  3. CaptainHero

    CaptainHero

    Joined:
    Sep 30, 2012
    Messages:
    197
    Resources:
    1
    Spells:
    1
    Resources:
    1
    thx

    that did do it

    u rock!