• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 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