• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Trigger] Hm why this isnt multi player compatible ?

Status
Not open for further replies.
Level 11
Joined
Jul 28, 2007
Messages
920
Works for 1st player only, why ?
It gives 1 skill point every 2 levels, 3,5,7,9,11...

Hero_Spell_level_pre - integral
Hero_Spell_level - integral


  • Actions
    • -------- init level --------
    • Set Hero_Spell_level_pre[(Player number of (Owner of (Leveling Hero)))] = (Hero_Spell_level_pre[(Player number of (Owner of (Leveling Hero)))] + 1)
    • -------- set skip level --------
      • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Hero_Spell_level_pre[(Player number of (Owner of (Leveling Hero)))] Equal to (==) 2
        • Then - Actions
          • Set Hero_Spell_level[(Player number of (Owner of (Leveling Hero)))] = (Hero_Spell_level[(Player number of (Owner of (Leveling Hero)))] + 2)
          • Set Hero_Spell_level_pre[(Player number of (Owner of (Leveling Hero)))] = 0
        • Else - Actions
    • -------- add skill --------
      • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Hero level of (Leveling Hero)) Not equal to (!=) Hero_Spell_level[(Player number of (Owner of (Leveling Hero)))]
        • Then - Actions
          • Hero - Modify unspent skill points of (Leveling Hero): Subtract 1 points
        • Else - Actions
 
Level 10
Joined
Jun 16, 2007
Messages
415
Why not just do:

  • Events
    • Unit - A unit Gains a level
  • Conditions
    • ((Hero level of (Triggering unit)) mod 2) Equal to 1
  • Actions
    • Hero - Modify unspent skill points of (Triggering unit): Subtract 1 points
This trigger would work perfectly, is a lot shorter and makes more sense.
I am not sure however, whether the event is triggered before or after the unit is leveled up. Because it might return the previous level instead of the new one, in which case you have to change the condition to:

  • Conditions
    • ((Hero level of (Triggering unit)) mod 2) Equal to 0
 
Status
Not open for further replies.
Top