• Check out the results of the Techtree Contest #19!
  • 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.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

Trigger help for custom kingdoms / abilities

Status
Not open for further replies.
Level 1
Joined
May 8, 2019
Messages
2
Ok, so i started working on a map, using the warcraft world editor since i heard JNGP is causing issues since updates. My goal here is to create all units/ abilities under 1 "faction" and swap them in and out via bonuses through triggers. i can get basic functions to work but the moment i add conditions or use one trigger to trigger another trigger it stops working properly or at all. also for the life of me i cant stop getting double spawns with units. i guess my question is : can i do this or are trigger functions broken? and what am i doing wrong?? appreciate any help ill attach examples (also theese are the only two i have left after waisting a day trying to add conditions and rework the more advanced ones i ended up with nothing and deleted them)
 

Attachments

  • Capture.PNG
    Capture.PNG
    5.9 KB · Views: 39
  • Capture2.PNG
    Capture2.PNG
    7 KB · Views: 34
  • Capture2.PNG
    Capture2.PNG
    7 KB · Views: 37
Rather than having a bunch of triggers like that you can use a bunch of boolean variables as a switch:

  • Events
    • Unit - A unit finishes research
  • Conditions
    • Set P = (Triggering Player) //this works as owner of triggering unit for most unit event triggers
    • Set PN = (Player number of P)
    • If (conditions) then (actions) else (actions)
      • If - Conditions
        • (Researched Tech type) equal to Frost Enchanting
      • Then - Actions
        • Set FrostReseach[PN] = true
      • Else - Actions
    • If (conditions) then (actions) else (actions)
      • If - Conditions
        • (Researched Tech type) equal to Fire Enchanting
      • Then - Actions
        • Set FireReseach[PN] = true
      • Else - Actions
    • If (conditions) then (actions) else (actions)
      • If - Conditions
        • (Researched Tech type) equal to Lightning Enchanting
      • Then - Actions
        • Set LightningReseach[PN] = true
      • Else - Actions
  • Events
    • Unit - A unit enters (Playable map area)
  • Conditions
    • (Unit-type of (Triggering Unit)) equal to Footman
  • Actions
    • Set U = (Triggering Unit)
    • Set PN = Player number of (Owner of U)
    • If (conditions) then (actions) else (actions)
      • If - Conditions
        • FrostReseach[PN] equal to true
      • Then - Actions
        • Unit - Add Frost Enchantment to U
      • Else - Actions
    • If (conditions) then (actions) else (actions)
      • If - Conditions
        • FireReseach[PN] equal to true
      • Then - Actions
        • Unit - Add Fire Enchantment to U
      • Else - Actions
    • If (conditions) then (actions) else (actions)
      • If - Conditions
        • Lightning Reseach[PN] equal to true
      • Then - Actions
        • Unit - Add Lightning Enchantment to U
      • Else - Actions
  • etc...
You could get even more data-driven and do it this way:

  • Events
    • Time - Elapsed game time is 0.50 seconds
  • Conditions\
    • Set EnchCount = 3
    • Set Ench[1] = Frost Enchantment
    • Set Ench[2] = Fire Enchantment
    • Set Ench[3] = Lightning Enchantment
    • Set EnchRsch[1] = Frost Enchanting
    • Set EnchRsch[2] = Fire Enchanting
    • Set EnchRsch[3] = Lightning Enchanting
  • Events
    • Unit - A unit finishes research
  • Conditions
    • Set P = (Triggering Player)
    • Set PN = (Player number of P)
    • For each (Integer A) from 1 to EnchCount do (Actions)
      • Loop - Actions
        • If (conditions) then (actions) else (actions)
          • If - Conditions
            • (Researched Tech type) equal to EnchResch[1]
          • Then - Actions
            • Set EnchResch[(PN x EnchCount) + (IntegerA)] = true
          • Else - Actions
  • Events
    • Unit - A unit enters (Playable map area)
  • Conditions
    • (Unit-type of (Triggering Unit)) equal to Footman
  • Actions
    • Set U = (Triggering Unit)
    • Set PN = Player number of (Owner of U)
    • For each (Integer A) from 1 to EnchCount do (Actions)
      • Loop - Actions
        • If (conditions) then (actions) else (actions)
          • If - Conditions
            • EnchResch[(PN x EnchCount) + (Integer A)] equal to true
          • Then - Actions
            • Unit - Add Ench[(Integer A)] to U
          • Else - Actions
 
Last edited:
Status
Not open for further replies.
Back
Top