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

[Solved] Text shows two times in game!

Status
Not open for further replies.
Level 2
Joined
May 30, 2011
Messages
5
Text shows two times in game! - SOLVED

Hello,

i have a problem with this trigger. It works good, but the text message is always shown two times (for example: you take a sword with less than 15 strength and you got 2 Textlines in game:

You need a minimum of 15 strength to use this weapon

You need a minimum of 15 strength to use this weapon)

I changed the messagetype for the first function the hint, but the problem is the same.

Can someone tell me what is wrong?

:vw_wtf:

  • weapon
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Item-class of (Item being manipulated)) Equal to Permanent
      • ((Triggering unit) is A Hero) Equal to True
    • Actions
      • For each (Integer A) from 1 to 6, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Item-class of (Item carried by (Triggering unit) in slot (Integer A))) Equal to Permanent
              • (Item carried by (Hero manipulating item) in slot (Integer A)) Not equal to (Item being manipulated)
            • Then - Actions
              • Quest - Display to (Player group((Owner of (Hero manipulating item)))) the Hint message: You can carry only ...
              • Set WrongItem = (Item being manipulated)
              • Unit - Order (Triggering unit) to drop WrongItem at (Position of (Triggering unit))
            • Else - Actions
              • Do nothing
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Item level of (Item being manipulated)) Equal to 2
          • (Strength of (Hero manipulating item) (Exclude bonuses)) Less than 15
        • Then - Actions
          • Game - Display to (Player group((Owner of (Hero manipulating item)))) the text: You need a minimum ...
          • Set WrongItem = (Item being manipulated)
          • Unit - Order (Triggering unit) to drop WrongItem at (Position of (Triggering unit))
        • Else - Actions
          • Do nothing
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Item level of (Item being manipulated)) Equal to 4
          • (Strength of (Hero manipulating item) (Exclude bonuses)) Less than 25
        • Then - Actions
          • Game - Display to (Player group((Owner of (Hero manipulating item)))) the text: You need a minimum ...
          • Set WrongItem = (Item being manipulated)
          • Unit - Order (Triggering unit) to drop WrongItem at (Position of (Triggering unit))
        • Else - Actions
          • Do nothing
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Item level of (Item being manipulated)) Equal to 6
          • (Strength of (Hero manipulating item) (Exclude bonuses)) Less than 50
        • Then - Actions
          • Game - Display to (Player group((Owner of (Hero manipulating item)))) the text: You need a minimum ...
          • Set WrongItem = (Item being manipulated)
          • Unit - Order (Triggering unit) to drop WrongItem at (Position of (Triggering unit))
        • Else - Actions
          • Do nothing
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Item level of (Item being manipulated)) Equal to 12
          • (Agility of (Hero manipulating item) (Exclude bonuses)) Less than 15
        • Then - Actions
          • Game - Display to (Player group((Owner of (Hero manipulating item)))) the text: You need a minimum ...
          • Set WrongItem = (Item being manipulated)
          • Unit - Order (Triggering unit) to drop WrongItem at (Position of (Triggering unit))
        • Else - Actions
          • Do nothing
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Item level of (Item being manipulated)) Equal to 14
          • (Agility of (Hero manipulating item) (Exclude bonuses)) Less than 25
        • Then - Actions
          • Game - Display to (Player group((Owner of (Hero manipulating item)))) the text: You need a minimum ...
          • Set WrongItem = (Item being manipulated)
          • Unit - Order (Triggering unit) to drop WrongItem at (Position of (Triggering unit))
        • Else - Actions
          • Do nothing
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Item level of (Item being manipulated)) Equal to 16
          • (Agility of (Hero manipulating item) (Exclude bonuses)) Less than 50
        • Then - Actions
          • Game - Display to (Player group((Owner of (Hero manipulating item)))) the text: You need a minimum ...
          • Set WrongItem = (Item being manipulated)
          • Unit - Order (Triggering unit) to drop WrongItem at (Position of (Triggering unit))
        • Else - Actions
          • Do nothing
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Item level of (Item being manipulated)) Equal to 22
          • (Intelligence of (Hero manipulating item) (Exclude bonuses)) Less than 15
        • Then - Actions
          • Game - Display to (Player group((Owner of (Hero manipulating item)))) the text: You need a minimum ...
          • Set WrongItem = (Item being manipulated)
          • Unit - Order (Triggering unit) to drop WrongItem at (Position of (Triggering unit))
        • Else - Actions
          • Do nothing
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Item level of (Item being manipulated)) Equal to 24
          • (Intelligence of (Hero manipulating item) (Exclude bonuses)) Less than 25
        • Then - Actions
          • Game - Display to (Player group((Owner of (Hero manipulating item)))) the text: You need a minimum ...
          • Set WrongItem = (Item being manipulated)
          • Unit - Order (Triggering unit) to drop WrongItem at (Position of (Triggering unit))
        • Else - Actions
          • Do nothing
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Item level of (Item being manipulated)) Equal to 26
          • (Intelligence of (Hero manipulating item) (Exclude bonuses)) Less than 50
        • Then - Actions
          • Game - Display to (Player group((Owner of (Hero manipulating item)))) the text: You need a minimum ...
          • Set WrongItem = (Item being manipulated)
          • Unit - Order (Triggering unit) to drop WrongItem at (Position of (Triggering unit))
        • Else - Actions
          • Do nothing
 
Last edited:
Remove all those 'Do nothing's because all they do is slow down the game.
Also, you have leaks (Position of (Triggering unit)), etc..
To solve this problem, you should utilize the 'Else' block.

Instead of having seperate if/then/else blocks, you should merge them like this:

  • weapon
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Item-class of (Item being manipulated)) Equal to Permanent
      • ((Triggering unit) is A Hero) Equal to True
    • Actions
      • Set TempUnit = (Triggering unit)
      • Set TempForce = (Player group(Owner of TempUnit))
      • Set TempLoc = (Position of TempUnit)
      • Set TempItem = (Item being manipulated)
      • Set Level = (Item level of TempItem)
      • Set Strength = (Strength of TempUnit (Exclude Bonuses))
      • Set Intel = (Intelligence of TempUnit (Exclude Bonuses))
      • Set Agi = (Agility of TempUnit (Exclude Bonuses))
      • For each Int from 1 to 6, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Item-class of (Item carried by TempUnit in slot Int)) Equal to Permanent
              • (Item carried by TempUnit in slot Int) Not equal to TempItem
            • Then - Actions
              • Quest - Display to TempForce the Hint message: You can carry only ...
              • Unit - Order TempUnit to drop TempItem at TempLoc
            • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Level Equal to 2
          • Strength Less than 15
        • Then - Actions
          • Game - Display to TempForce the text: You need a minimum ...
          • Unit - Order TempUnit to drop TempItem at TempLoc
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Level Equal to 4
              • Strength Less than 25
            • Then - Actions
              • Game - Display to TempForce the text: You need a minimum ...
              • Unit - Order TempUnit to drop TempItem at TempLoc
            • Else - Actions
              • // YOUR TRIGGER WOULD GO ON AND ON AND ON LIKE THIS
  • // FINALLY:
    • Custom script: call RemoveLocation(udg_TempLoc)
    • Custom script: call DestroyForce(udg_TempForce)
That's what your trigger should look like
 
Level 2
Joined
May 30, 2011
Messages
5
Thanks for looking over the trigger (your's is much more clearly arranged so i will use it... and change much of my other triggers) but my problem is not solved.

Every time i pick up a weapon which i can't use, i get my game message two times:

 
Level 2
Joined
May 30, 2011
Messages
5
I tested it with all itemlevels... and all the same. The 15 Strength is for level 2. And the problem is the same with my trigger and the trigger from Magtheridon96.

To make it clear: the trigger works perfectly! The only problem is, that any game message will be shown twice!



Yay... problem solved! It was another trigger (an item stacking trigger) that caused the problem...
 
Last edited:
Status
Not open for further replies.
Top