• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

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: 29
  • Capture2.PNG
    Capture2.PNG
    7 KB · Views: 22
  • Capture2.PNG
    Capture2.PNG
    7 KB · Views: 26
Level 39
Joined
Feb 27, 2007
Messages
5,011
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:
Level 1
Joined
May 8, 2019
Messages
2
i appreciate the advice, ill try some of those when i get off of work :D
 
Status
Not open for further replies.
Top