Boy, coming up even with a title for this was a pain. XD The idea seems simple, but I'm having a lot of trouble figuring out how to execute this. Basically I'm making a mission map in which Dehaka has become stranded on a planet where no Zerg have ever gone before. Kerrigan senses his general location and sends Zagara to that same general chunk of land to start a hive cluster so they can help destroy the Terran presence on the planet and reunite Dehaka with the Swarm. One of the mission's primary objectives, therefore, is to locate Zagara's hive cluster.
Now, here's where my problem comes in. In the campaign, when Dehaka dies, he respawns at your main base after so-and-so length of time (30 seconds or something like that.) In this mission, I want it to work like that only AFTER he finds the friendly hive cluster. In short I want it to work like this. Once you have discovered the friendly hive cluster, if Dehaka dies, he respawns after a certain length of time just like in the campaign. But before then, if Dehaka dies, the game is over and you lose.
Now, in my mind, I was picturing something like this:
Event: Unit (Dehaka) dies
Condition: AND Unit (Dehaka) has entered Region ZagaraHiveCluster
If the condition returns true, then:
Action: Run Respawn Dehaka trigger
If the condition returns false, then:
Action: End game in defeat for player 1
But of course there's no such option 'unit has entered'. Unit is IN region strikes me as a possible option, but then I'll have to phrase it differently - if you die while close to the friendly hive cluster, you respawn, but if you die far away, it's all over. This doesn't make much sense to me though given the nature of the respawning; he's basically being cloned from stored DNA samples. I can mentally justify Zagara not having any samples from him in that hive cluster until he arrives (as a Primal he probably resists sharing his essence with the Swarm as much as possible.) But once that happens, how far away he died is irrelevant, or ought to be.
So what's the best way to make this work the way I want it to - before Dehaka goes to a given region, his death ends the game, but after then, he respawns at the center of that region when he dies? Or should I just accept the unit-in-region concept and try to figure out some way to explain it so players don't go WTF, why does distance matter?
How would that actually work in practice? I think I understand what you're saying but I'm unsure of how to translate it into an actual trigger or set of triggers. Sorry if I'm being remarkably stupid. x.x I'm fascinated by mapmaking but I've never been very good at it and I have no programming background at all. XD I do know what a Boolean variable is. I'm just not sure how to actually structure the resulting trigger.
Boy, coming up even with a title for this was a pain. XD The idea seems simple, but I'm having a lot of trouble figuring out how to execute this. Basically I'm making a mission map in which Dehaka has become stranded on a planet where no Zerg have ever gone before. Kerrigan senses his general location and sends Zagara to that same general chunk of land to start a hive cluster so they can help destroy the Terran presence on the planet and reunite Dehaka with the Swarm. One of the mission's primary objectives, therefore, is to locate Zagara's hive cluster.
Now, here's where my problem comes in. In the campaign, when Dehaka dies, he respawns at your main base after so-and-so length of time (30 seconds or something like that.) In this mission, I want it to work like that only AFTER he finds the friendly hive cluster. In short I want it to work like this. Once you have discovered the friendly hive cluster, if Dehaka dies, he respawns after a certain length of time just like in the campaign. But before then, if Dehaka dies, the game is over and you lose.
Now, in my mind, I was picturing something like this:
Event: Unit (Dehaka) dies
Condition: AND Unit (Dehaka) has entered Region ZagaraHiveCluster
If the condition returns true, then:
Action: Run Respawn Dehaka trigger
If the condition returns false, then:
Action: End game in defeat for player 1
But of course there's no such option 'unit has entered'. Unit is IN region strikes me as a possible option, but then I'll have to phrase it differently - if you die while close to the friendly hive cluster, you respawn, but if you die far away, it's all over. This doesn't make much sense to me though given the nature of the respawning; he's basically being cloned from stored DNA samples. I can mentally justify Zagara not having any samples from him in that hive cluster until he arrives (as a Primal he probably resists sharing his essence with the Swarm as much as possible.) But once that happens, how far away he died is irrelevant, or ought to be.
So what's the best way to make this work the way I want it to - before Dehaka goes to a given region, his death ends the game, but after then, he respawns at the center of that region when he dies? Or should I just accept the unit-in-region concept and try to figure out some way to explain it so players don't go WTF, why does distance matter?
Check a boolean variable to see if he's returned or not (you set it to true when he enters a region around that area)
Still alive and kicking, just busy.
My guide to the trigger editor (still a work in progress)
How would that actually work in practice? I think I understand what you're saying but I'm unsure of how to translate it into an actual trigger or set of triggers. Sorry if I'm being remarkably stupid. x.x I'm fascinated by mapmaking but I've never been very good at it and I have no programming background at all. XD I do know what a Boolean variable is. I'm just not sure how to actually structure the resulting trigger.
trigger 1:
denaka entered region
action: set CLUSTER EXIST = true
trigger 2:
denaka dies
condisions: CLUSTER EXIST == true
action: respawn
ofc i assume you have created CLUSTER EXIST boolean variable first
Aha! I see now. Thanks very much!