• 🏆 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] Custom Crafting system// doing nothing

Status
Not open for further replies.
Level 7
Joined
Sep 19, 2012
Messages
204
Hey Guys...

I recently started working on a map prototype and for some reason my selfmade Crafting system stopped working for all recipes except one (Gunpowder). The Triggers are practically the same and i cant figure out why it doesnt work. some ideas?

  • Recipes
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Ability being cast) Equal to Crafting Station
          • And - All (Conditions) are true
            • Conditions
              • ((Triggering unit) has an item of type Tools) Equal to True
          • And - All (Conditions) are true
            • Conditions
              • ((Triggering unit) has an item of type Wood) Equal to True
              • (Charges remaining in (Item carried by (Triggering unit) of type Wood)) Greater than or equal to 10
          • And - All (Conditions) are true
            • Conditions
              • ((Triggering unit) has an item of type Stone) Equal to True
              • (Charges remaining in (Item carried by (Triggering unit) of type Stone)) Greater than or equal to 10
        • Then - Actions
          • Item - Set charges remaining in (Item carried by (Triggering unit) of type Wood) to ((Charges remaining in (Item carried by (Triggering unit) of type Wood)) - 10)
          • Item - Set charges remaining in (Item carried by (Triggering unit) of type Stone) to ((Charges remaining in (Item carried by (Triggering unit) of type Stone)) - 10)
          • Hero - Create Crafting Station and give it to (Triggering unit)
          • Special Effect - Create a special effect attached to the overhead of (Triggering unit) using Abilities\Spells\Orc\AncestralSpirit\AncestralSpiritCaster.mdl
          • Sound - Play Craftingsound <gen> at 100.00% volume, attached to (Triggering unit)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Charges remaining in (Item carried by (Triggering unit) of type Wood)) Equal to 0
            • Then - Actions
              • Item - Remove (Item carried by (Triggering unit) of type Wood)
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Charges remaining in (Item carried by (Triggering unit) of type Stone)) Equal to 0
            • Then - Actions
              • Item - Remove (Item carried by (Triggering unit) of type Stone)
            • Else - Actions
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Ability being cast) Equal to Storage
          • And - All (Conditions) are true
            • Conditions
              • ((Triggering unit) has an item of type Stone) Equal to True
              • (Charges remaining in (Item carried by (Triggering unit) of type Stone)) Greater than or equal to 10
          • And - All (Conditions) are true
            • Conditions
              • ((Triggering unit) has an item of type Wood) Equal to True
              • (Charges remaining in (Item carried by (Triggering unit) of type Wood)) Greater than or equal to 5
        • Then - Actions
          • Item - Set charges remaining in (Item carried by (Triggering unit) of type Stone) to ((Charges remaining in (Item carried by (Triggering unit) of type Stone)) - 10)
          • Item - Set charges remaining in (Item carried by (Triggering unit) of type Wood) to ((Charges remaining in (Item carried by (Triggering unit) of type Wood)) - 5)
          • Hero - Create Storage and give it to (Triggering unit)
          • Special Effect - Create a special effect attached to the overhead of (Triggering unit) using Abilities\Spells\Orc\AncestralSpirit\AncestralSpiritCaster.mdl
          • Sound - Play Craftingsound <gen> at 100.00% volume, attached to (Triggering unit)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Charges remaining in (Item carried by (Triggering unit) of type Stone)) Equal to 0
            • Then - Actions
              • Item - Remove (Item carried by (Triggering unit) of type Stone)
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Charges remaining in (Item carried by (Triggering unit) of type Wood)) Equal to 0
            • Then - Actions
              • Item - Remove (Item carried by (Triggering unit) of type Wood)
            • Else - Actions
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Ability being cast) Equal to Windmill
          • And - All (Conditions) are true
            • Conditions
              • ((Triggering unit) has an item of type Stone Blocks) Equal to True
              • (Charges remaining in (Item carried by (Triggering unit) of type Stone Blocks)) Greater than or equal to 10
          • And - All (Conditions) are true
            • Conditions
              • ((Triggering unit) has an item of type Wood) Equal to True
              • (Charges remaining in (Item carried by (Triggering unit) of type Wood)) Greater than or equal to 5
          • And - All (Conditions) are true
            • Conditions
              • ((Triggering unit) has an item of type Wooden Planks) Equal to True
              • (Charges remaining in (Item carried by (Triggering unit) of type Wooden Planks)) Greater than or equal to 4
        • Then - Actions
          • Item - Set charges remaining in (Item carried by (Triggering unit) of type Wood) to ((Charges remaining in (Item carried by (Triggering unit) of type Wood)) - 5)
          • Item - Set charges remaining in (Item carried by (Triggering unit) of type Stone Blocks) to ((Charges remaining in (Item carried by (Triggering unit) of type Stone Blocks)) - 10)
          • Item - Set charges remaining in (Item carried by (Triggering unit) of type Wooden Planks) to ((Charges remaining in (Item carried by (Triggering unit) of type Wooden Planks)) - 4)
          • Hero - Create Windmill and give it to (Triggering unit)
          • Special Effect - Create a special effect attached to the overhead of (Triggering unit) using Abilities\Spells\Orc\AncestralSpirit\AncestralSpiritCaster.mdl
          • Sound - Play Craftingsound <gen> at 100.00% volume, attached to (Triggering unit)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Charges remaining in (Item carried by (Triggering unit) of type Wood)) Equal to 0
            • Then - Actions
              • Item - Remove (Item carried by (Triggering unit) of type Wood)
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Charges remaining in (Item carried by (Triggering unit) of type Stone Blocks)) Equal to 0
            • Then - Actions
              • Item - Remove (Item carried by (Triggering unit) of type Stone Blocks)
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Charges remaining in (Item carried by (Triggering unit) of type Wooden Planks)) Equal to 0
            • Then - Actions
              • Item - Remove (Item carried by (Triggering unit) of type Wooden Planks)
            • Else - Actions
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Ability being cast) Equal to Gunpowder
          • And - All (Conditions) are true
            • Conditions
              • ((Triggering unit) has an item of type Coal) Equal to True
              • (Charges remaining in (Item carried by (Triggering unit) of type Coal)) Greater than or equal to 5
          • And - All (Conditions) are true
            • Conditions
              • ((Triggering unit) has an item of type Stone) Equal to True
              • (Charges remaining in (Item carried by (Triggering unit) of type Stone)) Greater than or equal to 5
        • Then - Actions
          • Item - Set charges remaining in (Item carried by (Triggering unit) of type Coal) to ((Charges remaining in (Item carried by (Triggering unit) of type Coal)) - 5)
          • Item - Set charges remaining in (Item carried by (Triggering unit) of type Stone) to ((Charges remaining in (Item carried by (Triggering unit) of type Stone)) - 5)
          • Hero - Create Gun Powder and give it to (Triggering unit)
          • Item - Set charges remaining in (Last created item) to 5
          • Special Effect - Create a special effect attached to the overhead of (Triggering unit) using Abilities\Spells\Orc\AncestralSpirit\AncestralSpiritCaster.mdl
          • Sound - Play Craftingsound <gen> at 100.00% volume, attached to (Triggering unit)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Charges remaining in (Item carried by (Triggering unit) of type Coal)) Equal to 0
            • Then - Actions
              • Item - Remove (Item carried by (Triggering unit) of type Coal)
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Charges remaining in (Item carried by (Triggering unit) of type Stone)) Equal to 0
            • Then - Actions
              • Item - Remove (Item carried by (Triggering unit) of type Stone)
            • Else - Actions
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Ability being cast) Equal to Ammo
          • And - All (Conditions) are true
            • Conditions
              • ((Triggering unit) has an item of type Gun Powder) Equal to True
              • (Charges remaining in (Item carried by (Triggering unit) of type Gun Powder)) Greater than or equal to 10
          • And - All (Conditions) are true
            • Conditions
              • ((Triggering unit) has an item of type Iron Plate) Equal to True
              • (Charges remaining in (Item carried by (Triggering unit) of type Iron Plate)) Greater than or equal to 5
        • Then - Actions
          • Item - Set charges remaining in (Item carried by (Triggering unit) of type Gun Powder) to ((Charges remaining in (Item carried by (Triggering unit) of type Gun Powder)) - 10)
          • Item - Set charges remaining in (Item carried by (Triggering unit) of type Iron Plate) to ((Charges remaining in (Item carried by (Triggering unit) of type Iron Plate)) - 5)
          • Hero - Create Ammo and give it to (Triggering unit)
          • Item - Set charges remaining in (Last created item) to 5
          • Special Effect - Create a special effect attached to the overhead of (Triggering unit) using Abilities\Spells\Orc\AncestralSpirit\AncestralSpiritCaster.mdl
          • Sound - Play Craftingsound <gen> at 100.00% volume, attached to (Triggering unit)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Charges remaining in (Item carried by (Triggering unit) of type Gun Powder)) Equal to 0
            • Then - Actions
              • Item - Remove (Item carried by (Triggering unit) of type Gun Powder)
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Charges remaining in (Item carried by (Triggering unit) of type Iron Plate)) Equal to 0
            • Then - Actions
              • Item - Remove (Item carried by (Triggering unit) of type Iron Plate)
            • Else - Actions
        • Else - Actions
 
Last edited:
Level 7
Joined
Sep 19, 2012
Messages
204
Well...

When a unit casts an ability it should check for what ability it is and then reduce the charges of the corresponding items while creating a new one and giving it to the Caster....what it does: Nothing.

I removed the condition that checks for the ability and it worked, but then it works whatever ability i use.

Edit: Fixed the trigger post..sry was confused by the new website design ^^
 
Seperate the triggers. Best is to make one for each ability, so you don't need to filter out each ability in a code mass.

Use "Unit Starts Effect of an ability" as event.

One possible confusion is the condition layer. If you simply add conditions to your condition list then they are all treated like they are connected with a logical "and".
So:
Code:
Conditions:
    - Condition 1
    - Coniditon 2
Does require both condtions to be true to pass.

Your condition looks like this:
Code:
Conditions:
    - Condition 1
    - And All:
        - Condition 2
        - Condition 3
    - And All:
        - Condition 4
        - Condition 5
Which would result in the same as:
Code:
Conditions:
    - Condition 1
    - Condition 2
    - Condition 3
    - Condition 4
    - Condition 5

Furtherore if nothing still works try out to display information on screen which help you out to see what works and what not.
 
Status
Not open for further replies.
Top