• 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.

Whats wrong with this trigger?

Status
Not open for further replies.
Level 2
Joined
Aug 29, 2007
Messages
12
Ok so Im making a game with the basic style of footman, a base town hall structure and units that spawn around it. All players have a wisp in their starting location, which is replaced by the town hall structure of the race they pick in a dialog box, i do that using this trigger:

  • Human Settler
    • Events
      • Dialog - A dialog button is clicked for Firstdiag
    • Conditions
      • (Clicked dialog button) Equal to Diagbutton[1]
    • Actions
      • Set OwnedUnits = (Units owned by (Triggering player))
      • Unit - Replace (Random unit from OwnedUnits) with a Town Hall using The new unit's default life and mana
A few times however, it seems this trigger doesnt even run, because the player still has the wisp, even though the dialog button was clicked. I was wondering if anyone could tell me how to fix this trigger, or give me a better suggestion without changing too much of the basic mechanics.

Thank you in advance
 
Level 5
Joined
Sep 11, 2004
Messages
73
  • Human Settler
    • Events
      • Dialog - A dialog button is clicked for Firstdiag
    • Conditions
      • (Clicked dialog button) Equal to Diagbutton[1]
    • Actions
      • Set OwnedUnits = (Units owned by (Triggering player))
      • Unit - Replace (Random unit from OwnedUnits) with a Town Hall using The new unit's default life and mana

I can see one problem so far, when you do Set OwnedUnits = (Units owned by (triggering player)) a couple things are probably happening, that makes the next action not work.

When you set this variable your setting all currently owned units within the playable map area into this unit group, Unit - Replace may be replacing a random unit somewhere else, instead of your wisp.

My suggestion, because i'm still unsure about what i just said considering i dont' have enough info, is to just assign your wisp to its own unit variable.

Set "Wisp 001" w/e, or Last Created unit, where the wisp is created if its done through triggers, to Wisp (unit variable)

Then when you get to this trigger, you can remove the Set variable action, and replace "Wisp" with a town hall, and then the "Wisp" variable will become unused and may be deleted or w/e.

This will be much simpler and most likey easier, and should make this trigger work properly.

I hope i explained that well enough, if you have any questions i'll check back later. Enjoy :D
 
Level 9
Joined
Jun 26, 2007
Messages
659
"Wisp 001" doesn't work with random start location

if player have random location, this wisp can be owned by any player
so the trigger can perform a player choice from another one

that's probably the reason he use something so complex
"create town hall at player's starting position" is more simple and work with random starting location
 
Status
Not open for further replies.
Top