• 🏆 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!

Can't find a way to initialize trigger

Status
Not open for further replies.
Level 4
Joined
Mar 12, 2008
Messages
83
In my map, at start, triggers generate items and animals in random places in map. Of course i want them to respawn when killed/used. To animals respawn i use that:

  • animal respawn
    • Events
      • Unit - A unit Dies
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • ((Dying unit) is in (Units of type Elk)) equal to TRUE
          • ((Dying unit) is in (Units of type Poison frog)) equal to TRUE
    • Actions
      • Set Temp_loc = (Random point in po ehhe <gen>)
      • Unit - Create 1 (Unit-type of (Dying unit)) for Neutral - passive at Temp_loc facing default building ehm something degrees
        • Custom script: call RemoveLocation(udg_Temp_loc)
But when i started to make item respawn trigger i realised that there is no such event like "Item is being removed" or something. So i put item respawn in item craft trigger. And when hero crafts item, items used to craft are removed from his eq, and such items are also spawned at random places on map. Overall this is for example axe crafting trigger:

  • craft axe
    • Events
      • Unit - A unit starts using skill
    • Conditions
      • (Ability being cast) equal to Craft an axe
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Or - Any (Conditions) are true
            • Conditions
              • (Item-type of (Item carried by (Casting unit) in slot 1)) Equal to Stone
              • (Item-type of (Item carried by (Casting unit) in slot 2)) Equal to Stone
              • (Item-type of (Item carried by (Casting unit) in slot 3)) Equal to Stone
              • (Item-type of (Item carried by (Casting unit) in slot 4)) Equal to Stone
              • (Item-type of (Item carried by (Casting unit) in slot 5)) Equal to Stone
              • (Item-type of (Item carried by (Casting unit) in slot 6)) Equal to Stone
        • Then - Actions
          • Set slot1 = TRUE
        • Or - Actions
          • Set slot1 = FALSE
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Or - Any (Conditions) are true
            • Conditions
              • (Item-type of (Item carried by (Casting unit) in slot 1)) Equal to Stick
              • (Item-type of (Item carried by (Casting unit) in slot 2)) Equal to Stick
              • (Item-type of (Item carried by (Casting unit) in slot 3)) Equal to Stick
              • (Item-type of (Item carried by (Casting unit) in slot 4)) Equal to Stick
              • (Item-type of (Item carried by (Casting unit) in slot 5)) Equal to Stick
              • (Item-type of (Item carried by (Casting unit) in slot 6)) Equal to Stick
        • Then - Actions
          • Set slot2 = TRUE
        • Or - Actions
          • Set slot2 = FALSE
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Or - Any (Conditions) are true
            • Conditions
              • (Item-type of (Item carried by (Casting unit) in slot 1)) equal to Creeper
              • (Item-type of (Item carried by (Casting unit) in slot 2)) equal to Creeper
              • (Item-type of (Item carried by (Casting unit) in slot 3)) equal to Creeper
              • (Item-type of (Item carried by (Casting unit) in slot 4)) equal to Creeper
              • (Item-type of (Item carried by (Casting unit) in slot 5)) equal to Creeper
              • (Item-type of (Item carried by (Casting unit) in slot 6)) equal to Creeper
        • Then - Actions
          • Set slot3 = TRUE
        • Or - Actions
          • Set slot3 = FALSE
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • slot1 equal to TRUE
          • slot2 equal to TRUE
          • slot3 equal to TRUE
        • then - Actions
          • Set slot1 = FALSE
          • Set slot2 = FALSE
          • Set slot3 = FALSE
          • Item - Remove (Item carried by (Casting unit) of type Stone)
          • Item - Remove (Item carried by (Casting unit) of type Stick)
          • Item - Remove (Item carried by (Casting unit) of type Creeper)
          • Set Temp_loc = (Random point in po ehhe <gen>)
          • Item - Create Stick at Temp_loc
          • Custom script: call RemoveLocation(udg_Temp_loc)
          • Set Temp_loc = (Random point in po ehhe <gen>)
          • Item - Create Stone at Temp_loc
          • Custom script: call RemoveLocation(udg_Temp_loc)
          • Set Temp_loc = (Random point in po ehhe <gen>)
          • Item - Create Creeper at Temp_loc
          • Custom script: call RemoveLocation(udg_Temp_loc)
          • Hero - Create Axe and give it to (Casting unit)
        • Or - Actions
          • Do nothing
Uh, if i find anything more in polish ill fix that :S

This is single trigger for creating 1 item and spawning items used on map. For every item i need such trigger. So if it would be like 20 triggers like this running every time someone tries to craft something. Will it affect the game? Lags or something? Are there any leaks?


Ps: @down
I think i could try a system like in Jungle Troll Tribes, its much easier and still little simmilar to mine (spellbooks with clickable recipes) just there you need to have items in correct order, and in mine system u dont and u can have other items in EQ too which is i think very comfortable, but more complicated too as you see. I think that if i make such system all items craft could be in one trigger. Ill make such system now.
 
Last edited:
Status
Not open for further replies.
Top