• 🏆 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] Malfunctionning Trigger (Death Note)

Status
Not open for further replies.
Level 7
Joined
Jul 14, 2006
Messages
292
I made a trigger im my game called Titan Land for a item called the death note. The item uses trigger to work and I will write below its use and its decription ingame. Then I will write down the 2 triggers and the problem. I wish I will get help fast enough so I can fix that trigger. Thanks a lot! ^^


How it is used:
If a hero is in possession of the item (Death Note), the player can type in -DeathNote 'Unit name' and the unit that has that name will die after 40 seconds. To prevent multiple units with the same name from dying, the targeted unit must also be selected by the player that has the Death Note. Some unit such as buildings and other specific units won't die.


Its description:
Artifact
This is the Death Note of a Death God. It has several rules written in.
The one whose name is written in this note shall die.
(Type -DeathNote "The unit's name")
This note will not take effect unless the writer has the subject unit selected. Therefore, people sharing the same name will not be affected.
The subject will simply die of a heart attack after 40 seconds his name was written in the Death Note.
The Death Note won't affect Divines.



That first trigger is the one who do the entire effect, it is it who see if the units typing the command has a hero with the Death Note in his possession. (There is only 1 Death Note in the entire game), it is also it who check if the written name matches with the name of the unit the player has selected.

  • Death Note
    • Events
      • Player - Player 1 (Red) types a chat message containing -DeathNote as A substring
      • Player - Player 2 (Blue) types a chat message containing -DeathNote as A substring
      • Player - Player 3 (Teal) types a chat message containing -DeathNote as A substring
      • Player - Player 4 (Purple) types a chat message containing -DeathNote as A substring
      • Player - Player 5 (Yellow) types a chat message containing -DeathNote as A substring
      • Player - Player 6 (Orange) types a chat message containing -DeathNote as A substring
      • Player - Player 7 (Green) types a chat message containing -DeathNote as A substring
      • Player - Player 8 (Pink) types a chat message containing -DeathNote as A substring
      • Player - Player 9 (Gray) types a chat message containing -DeathNote as A substring
      • Player - Player 10 (Light Blue) types a chat message containing -DeathNote as A substring
      • Player - Player 11 (Dark Green) types a chat message containing -DeathNote as A substring
      • Player - Player 12 (Brown) types a chat message containing -DeathNote as A substring
    • Conditions
      • (Substring((Entered chat string), 1, 10)) Equal to -DeathNote
    • Actions
      • Set DeathNoteOwnerGroup = (Units owned by (Triggering player))
      • Unit Group - Pick every unit in DeathNoteOwnerGroup and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) is A Hero) Equal to True
              • ((Picked unit) has an item of type |cff333333Death Note|r) Equal to True
            • Then - Actions
              • Set DeathNoteOwner = (Picked unit)
            • Else - Actions
              • Do nothing
      • Custom script: call DestroyGroup(udg_DeathNoteOwnerGroup)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • DeathNoteOwner Not equal to No unit
          • (DeathNoteOwner is alive) Equal to True
        • Then - Actions
          • Floating Text - Create floating text that reads (Substring((Entered chat string), 12, 32)) above DeathNoteOwner with Z offset 0.00, using font size 10.00, color (70.00%, 70.00%, 70.00%), and 0.00% transparency
          • Set ArtCastText = (Last created floating text)
          • Floating Text - Change ArtCastText: Disable permanence
          • Floating Text - Show ArtCastText for (All players)
          • Floating Text - Change the lifespan of ArtCastText to 5.00 seconds
          • Floating Text - Change the fading age of ArtCastText to 4.00 seconds
          • Set DeathNoteOwnerGroup = (Units currently selected by (Triggering player))
          • Unit Group - Pick every unit in DeathNoteOwnerGroup and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Substring((Entered chat string), 12, 32)) Equal to (Name of (Picked unit))
                  • ((Picked unit) is A structure) Equal to False
                  • ((Picked unit) is Mechanical) Equal to False
                  • (Unit-type of (Picked unit)) Not equal to Angel of Creation
                  • (Unit-type of (Picked unit)) Not equal to Super-Dimensional Life Form
                  • (Unit-type of (Picked unit)) Not equal to Titan of Cosmos (Mortal Form)
                  • (Unit-type of (Picked unit)) Not equal to Titan of Cosmos (Titan Form)
                  • (Unit-type of (Picked unit)) Not equal to Grim Reaper (Mortal Form)
                  • (Unit-type of (Picked unit)) Not equal to Keg
                  • (Unit-type of (Picked unit)) Not equal to Archaeologist Dag'Tharom (Quest)
                  • (Unit-type of (Picked unit)) Not equal to Culter of Doom Exiram (Quest)
                  • (Unit-type of (Picked unit)) Not equal to Geomancer Andrew (Quest)
                  • (Unit-type of (Picked unit)) Not equal to Methor (Quest)
                  • (Unit-type of (Picked unit)) Not equal to Power : Forest
                  • (Unit-type of (Picked unit)) Not equal to Power : Gold
                  • (Unit-type of (Picked unit)) Not equal to Power : Hostile
                  • (Unit-type of (Picked unit)) Not equal to Power : Level Down
                  • (Unit-type of (Picked unit)) Not equal to Power : Level Up
                  • (Unit-type of (Picked unit)) Not equal to Power : Life
                  • (Unit-type of (Picked unit)) Not equal to Power : Mana
                  • (Unit-type of (Picked unit)) Not equal to Power : Mind
                  • (Unit-type of (Picked unit)) Not equal to Power : Neutral
                  • (Unit-type of (Picked unit)) Not equal to Power : Remove
                  • (Unit-type of (Picked unit)) Not equal to Power : Rot
                  • (Unit-type of (Picked unit)) Not equal to Priest of the Gods Eibert (Quest)
                  • (Unit-type of (Picked unit)) Not equal to Priestess of the Sun Elieri (Quest)
                  • (Unit-type of (Picked unit)) Not equal to Trader (Orb)
                  • (Unit-type of (Picked unit)) Not equal to Trader (Potion)
                  • (Unit-type of (Picked unit)) Not equal to Trader (Scroll)
                  • (Unit-type of (Picked unit)) Not equal to Trader (Things)
                  • (Unit-type of (Picked unit)) Not equal to Trader (Weapon and Armor) (low level)
                  • (Unit-type of (Picked unit)) Not equal to Waterlord Hydrolix (Quest)
                  • (Unit-type of (Picked unit)) Not equal to Fire Titan
                  • (Unit-type of (Picked unit)) Not equal to Goddess
                  • (Unit-type of (Picked unit)) Not equal to Ice Titan
                • Then - Actions
                  • Unit - Add a 40.00 second Generic expiration timer to (Picked unit)
                  • Unit Group - Add (Picked unit) to DeathNoteVictimGroup
                • Else - Actions
                  • Do nothing
          • Custom script: call DestroyGroup(udg_DeathNoteOwnerGroup)
        • Else - Actions
          • Do nothing
      • Set DeathNoteOwner = No unit

That second trigger is only to put a soud and visual effect when a unit die from the death note.

  • Death Note Kill
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Dying unit) is in DeathNoteVictimGroup) Equal to True
    • Actions
      • Cinematic - Fade out and back in over 0.50 seconds using texture White Mask and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
      • Set DeathNotePoint = (Position of (Dying unit))
      • Sound - Play HeartAttack <gen> at 100.00% volume, located at DeathNotePoint with Z offset 0.00
      • Custom script: call RemoveLocation(udg_DeathNotePoint)
      • Unit Group - Remove (Dying unit) from DeathNoteVictimGroup


The problem:
Well the Death Note seems to work perfectly on single games, when I tested it myself. However, it seem that it works 33% of the time on multiplayer games. When I tried it on multiplayer games, I noticed that when the command is done, the selected units are automatically unselected. And I bet that when they're unselected, the trigger don't work as there are no unit selected so the written name won't work with any unit since ther unit group has nothing in. I don't know what cause the trigger to make the player unselect his units. And I'd like to know if you can help me with that trigger, thanks a lot ^^.

~MetalWarrior
 

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,195
Not so sure about the deselection thing but I can tell you one thing.

Remove all the "DoNothing"s from the trigger as they are absolutly unneeded and like the name says, they do nothing. Using them in any situation but to make lag is pointless and thus they should be avoided at all times.
 
Status
Not open for further replies.
Top