Seeking confirmation on a condition

Ormagon

New Member
Reaction score
1
will this condition work or dooes the or function not work this way??


Code:
Spellbook
    Events
        Unit - A unit Gains a level
    Conditions
        ((Unit-type of (Triggering unit)) Equal to Warrior 1) or (((Unit-type of (Triggering unit)) Equal to Warrior 2) or (((Unit-type of (Triggering unit)) Equal to Warrior 3) or (((Unit-type of (Triggering unit)) Equal to Warrior 4) or (((Unit-type of (Triggering unit)) Equal to Warrior 5) or (((Unit-type of (Triggering
    Actions
        If ((Level of (Triggering unit)) Equal to 9) then do (Unit - Replace (Triggering unit) with a Warrior 2 using The old unit's relative life and mana) else do (Do nothing)
        If ((Level of (Triggering unit)) Equal to 15) then do (Unit - Replace (Triggering unit) with a Warrior 3 using The old unit's relative life and mana) else do (Do nothing)
        If ((Level of (Triggering unit)) Equal to 21) then do (Unit - Replace (Triggering unit) with a Warrior 4 using The old unit's relative life and mana) else do (Do nothing)
        If ((Level of (Triggering unit)) Equal to 30) then do (Unit - Replace (Triggering unit) with a Warrior 5 using The old unit's relative life and mana) else do (Do nothing)
        If ((Level of (Triggering unit)) Equal to 36) then do (Unit - Replace (Triggering unit) with a Warrior 6 using The old unit's relative life and mana) else do (Do nothing)
        If ((Level of (Triggering unit)) Equal to 40) then do (Unit - Replace (Triggering unit) with a Warrior 7 using The old unit's relative life and mana) else do (Do nothing)
        If ((Level of (Triggering unit)) Equal to 45) then do (Unit - Replace (Triggering unit) with a Warrior 8 using The old unit's relative life and mana) else do (Do nothing)
 

ManyTimes

I'm so lonesome I could cry...
Reaction score
293
Works
Code:
Conditions
    Or - Any (Conditions) are true
        Conditions
            (Unit-type of (Triggering unit)) Equal to Footman
            (Unit-type of (Triggering unit)) Equal to Knight
Just next time, you can put the conditions like this. It is hell of a lot easier, if you in later versions want to add another unit/remove ...
 

Flare

Stops copies me!
Reaction score
662
thatll work. 'Or' only requires one of the given conditions to be true. Also, use Or, Multiple Conditions instead, its so much easier to read and construct (since if you made a mistake somewhere, you don't need to remake a huge line of conditions, just the one that was wrong). If it's a unit group matching condition, then there's no other choice
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top