• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

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 20
Joined
Jul 14, 2011
Messages
877
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