• 🏆 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] Why Doesnt This Trigger Work?

Status
Not open for further replies.
Level 5
Joined
Jan 11, 2006
Messages
110
  • Reload SIG
    • Events
      • Unit - A unit Uses an item
    • Conditions
      • (Unit-type of (Hero manipulating item)) Equal to Soldier With SIG
      • (Item-type of (Item being manipulated)) Equal to "SIG" SG 550
      • (Charges remaining in (Item carried by (Hero manipulating item) of type Rifle Ammo)) Greater than 0
      • (Charges remaining in (Item being manipulated)) Greater than 0
      • (Charges remaining in (Item being manipulated)) Less than 24
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
        • Then - Actions
          • Item - Set charges remaining in (Item carried by (Hero manipulating item) of type Rifle Ammo) to ((Charges remaining in (Item carried by (Hero manipulating item) of type Rifle Ammo)) - ((24 - ((Charges remaining in (Item being manipulated))
          • Item - Set charges remaining in (Item being manipulated) to 24
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Charges remaining in (Item carried by (Hero manipulating item) of type Rifle Ammo)) Equal to 0
            • Then - Actions
              • Item - Remove (Item carried by (Hero manipulating item) of type Rifle Ammo)
            • Else - Actions
Im trying to make a trigger where you reload your gun. The huge line of code is a constant that always ends up with the exact number of charges no matter what but it doesnt want to remove the charges from the ammo box after adding it to the gun. Any Ideas Why?
 
Last edited by a moderator:
Level 5
Joined
Jun 23, 2004
Messages
126
You seem to have no conditions under your first If-Then-Else action.

Spacing the stuff out makes it much easier to read, try this:

Instead of copying the crap out line by line or whatever you do...

1) Select your trigger over in the list of triggers on the left hand side of the Trigger Editor.
2) In the box with all of your trigger data, there is a white sheet of paper with your trigger name, an Events area, a Conditions area, and an Actions area.
3) Right-click the white sheet of paper with your trigger name, and click Copy As Text.
4) Paste it into a trigger tag.

This will make it include tab-spacing to add readability.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,201
He did you fool, its a bug if you have not read that some users can not make the TRIGGER tags to indent. For example, if i edit (do nothing) and click save, perfectly working trigger tags mess up and become like above. Equally, if purplepoot goes to one of thoes posts and does the same, they unmess up and are normal. I think it is some option in account settings.
 
Level 6
Joined
Feb 2, 2005
Messages
205
Well i worked on an map with an similar system here is my Trigger:

9mm Rounds = Ammo Box

The Weapon has maximum 7 Charges

  • Item - Set charges remaining in (Item carried by (Hero manipulating item) of type 9mm Rounds) to ((Charges remaining in (Item carried by (Hero manipulating item) of type 9mm Rounds)) + (Charges remaining in (Item being manipulated)))
  • If ((Charges remaining in (Item carried by (Hero manipulating item) of type 9mm Rounds)) Less than 7) then do (Item - Set charges remaining in (Item being manipulated) to (Charges remaining in (Item carried by (Hero manipulating item) of type 9mm Rounds))) else do (Item - Set charges remaining in (Item being manipulated) to 7)
  • Item - Set charges remaining in (Item carried by (Hero manipulating item) of type 9mm Rounds) to ((Charges remaining in (Item carried by (Hero manipulating item) of type 9mm Rounds)) - (Charges remaining in (Item carried by (Hero manipulating item) of type Firestar 9mm)))
 
Level 4
Joined
Apr 29, 2007
Messages
88
I think you can learn the trigger just by download an spells at HIVE, the spells name is weapon system... Sorry, don't know how to put a link
 
Level 5
Joined
Jun 23, 2004
Messages
126
He did you fool, its a bug if you have not read that some users can not make the TRIGGER tags to indent. For example, if i edit (do nothing) and click save, perfectly working trigger tags mess up and become like above. Equally, if purplepoot goes to one of thoes posts and does the same, they unmess up and are normal. I think it is some option in account settings.

Please do not call me a fool, sir. I am perfectly aware that when you go to edit your post, spaces are cut down and so indentations are removed. I experienced this many times while I was supplying trigger help to someone, using the tag for the first time ever.

If it is true that some users can't get it to indent, then I was simply not aware of this and should not be chastised for attempting to help him learn how to do it properly, rather than simply yelling at him for poor formatting.

On the other hand, if he edited and didn't bother to put the spaces back in or simply re-copy the trigger text in, then that's just him being lazy and making it annoyingly hard to read for everyone else.

Edit: @ Believer, to add links, go to your User Control Panel (the User CP link near the top). On the left hand side go to Edit Options. Scroll all the way down to the bottom of that page, you will see the Miscellaneous Options section. Under Message Editor Interface, go to Standard or Enhanced Interface. Then when you post, you should see various options (including Bold, Italic, Underline...). In those options is a button with a globe and a metallic link, you can click that button and paste your link into the prompt box.
 
Last edited:

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,201
Actually the bug is with internet explorer if you did not read the bug section.
Users with fire fox get it to work easily yet Internet Explorer does not indent.
A solution is being worked on so do not complain since even if you edit your post it MAKES NO difference whether it indents or not.
 
Level 5
Joined
Jun 23, 2004
Messages
126
Actually the bug is with internet explorer if you did not read the bug section.
Users with fire fox get it to work easily yet Internet Explorer does not indent.
A solution is being worked on so do not complain since even if you edit your post it MAKES NO difference whether it indents or not.


It's not a habit of mine to read the Bug Section and I don't think anyone should be expected to, good to know that Internet Explorer has that bug, no particular surprise.

Do note that I never complained about anything.

I am a little confused by what you mean, from what I saw when I edited my post, the indents were gone (at least while I was editing, I re-indented though so it's possible the indents would have remained when I saved, without any action on my part).

As for the weapon system, in case you haven't found it yet it's here.

http://hiveworkshop.com/resources_new/spells/893/
 
Status
Not open for further replies.
Top