• 💀 Happy Halloween! 💀 It's time to vote for the best terrain! Check out the entries to Hive's HD Terrain Contest #2 - Vampire Folklore.❗️Poll closes on November 14, 2023. 🔗Click here to cast your vote!
  • 🏆 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!
  • 🏆 HD Level Design Contest #1 is OPEN! Contestants must create a maze with at least one entry point, and at least one exit point. The map should be made in HD mode, and should not be openable in SD. Only custom models from Hive's HD model and texture sections are allowed. The only exceptions are DNC models and omnilights. This is mainly a visual and design oriented contest, not technical. The UI and video walkthrough rules are there to give everyone an equal shot at victory by standardizing how viewers see the terrain. 🔗Click here to enter!

Wc3 Editor Trigger

Status
Not open for further replies.
Level 2
Joined
Apr 5, 2015
Messages
6
Hi guys I was wondering if anybody possibly knows how I could do to make this work. I want to be able to write a chat command that makes a weapon in my inventory turn into another. I tried this:

EVENTS
Player - Player 1 (Red) types a chat message containing weapon1 as An exact match
CONDITIONS
((Hero manipulating item) has an item of type weapon2 Equal to True
ACTIONS
Item - Remove (Item carried by (Hero manipulating item) of type weapon2)
Hero - Create weapon1 and give it to (Hero manipulating item)

It looks right to me but when I type the message in-game, nothing happens.
 
Level 19
Joined
Jul 14, 2011
Messages
875
I think this should be in the World Editor Help Zone. Also, use [trigger]trigger[/trigger] tags.

  • Events
    • Player - Player 1 (Red) types a chat message containing weapon1 as An exact match
  • Conditions
    • ((Hero manipulating item) has an item of type weapon2 Equal to True
  • Actions
    • Item - Remove (Item carried by (Hero manipulating item) of type weapon2)
    • Hero - Create weapon1 and give it to (Hero manipulating item)
Much better! Now, to the point: there is no (Hero manipulating item) because the event doesnt involve any units (let alone items).

You can do something like this:

  • Set Hero = ...
(replace '...' with the hero you want)

Then the problematic trigger would look like this:
  • Events
    • Player - Player 1 (Red) types a chat message containing weapon1 as An exact match
  • Conditions
    • (Hero has an item of type weapon2 Equal to True
  • Actions
    • Item - Remove (Item carried by Hero of type weapon2)
    • Hero - Create weapon1 and give it to Hero
If you want 1 hero per player you can to the following:

  • Set Heroes[1] = ...
  • Set Heroes[2] = ...
  • Set Heroes[3] = ...
(replace '...' with the hero you want)

Then the trigger would look like this:
  • Events
    • Player - Player 1 (Red) types a chat message containing weapon1 as An exact match
    • Player - Player 2 (Blue) types a chat message containing weapon1 as An exact match
    • Player - Player 3 (Cyan) types a chat message containing weapon1 as An exact match
    • Player - Player 4 (Purple) types a chat message containing weapon1 as An exact match
    • Player - Player 5 (Yellow) types a chat message containing weapon1 as An exact match
    • Player - Player 6 (Orange) types a chat message containing weapon1 as An exact match
    • Player - Player 7 (Green) types a chat message containing weapon1 as An exact match
    • Player - Player 8 (Pink) types a chat message containing weapon1 as An exact match
    • Player - Player 9 (Grey) types a chat message containing weapon1 as An exact match
    • Player - Player 10 (Light Blue) types a chat message containing weapon1 as An exact match
    • Player - Player 11 (Dark Green) types a chat message containing weapon1 as An exact match
    • Player - Player 12 (Brown) types a chat message containing weapon1 as An exact match
  • Conditions
    • (Heroes[Player number of (Triggering player)] has an item of type weapon2 Equal to True
  • Actions
    • Item - Remove (Item carried by Heroes[Player number of (Triggering player) of type weapon2)]
    • Hero - Create weapon1 and give it to Heroes[Player number of (Triggering player)]
 
Level 2
Joined
Apr 5, 2015
Messages
6
Thanks man, that worked. I'm not very good at triggers and I just tried changing a recipe trigger into what I thought would work.
 
Status
Not open for further replies.
Top