• 🏆 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!

Dying Unit = Cancelled Structure?

Status
Not open for further replies.
Level 4
Joined
Aug 1, 2008
Messages
42
I'm currently making a trigger that occurs whenever a certain type of unit dies. The game I'm creating involves you building something for your main headquarters for the game, and if that building dies, you lose. The problem is, if you where to cancel the structure during its construction, warcraft 3 assumes the structure has died (not cancelled). That results in the player losing simply for possibly changing their mind on where to set up camp. Anyone know how to trigger myself around this problem?

There is only the event...
Unit - A unit Dies
I wish Blizzard had made a (Unit - A unit kills an unit) trigger.
 
Level 9
Joined
Jan 14, 2008
Messages
366
or simply use an integer switch like you did in staredit.

use two triggers and an integer array called "switch" with a size of 12


E -unit finishes construction
C -unit type of triggering unit equal to (your building)
A - set switch[(player number of (owner of triggering unit))] to 1


E -unit dies
C -unit type of dying unit equal to (your building)
A
- if switch[(player number of (owner of triggering unit))] equal to 1
do action: player death actions

-else
do action: nothing



did you understand the idea? the death trigger will only fire, once the building has finished construction, because that is when the switch is set to 1. once the switch is set to 1 however, the player can not lose the building anymore.


this should solve your problem, if i understood it correctly.
 
Status
Not open for further replies.
Top