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

[Unsolved] How to make a player lose the game?

Status
Not open for further replies.
Level 10
Joined
Nov 5, 2008
Messages
536
Hello,

I have a mod-file where I plan to keep all Melee Initialization triggers, because they are needed on all maps the mod is played on.

The only thing I need to change is the losing condition. Normally, a player loses the game when he/she has 0 structures. Instead I want to make the player lose the game when he/she has 0 of a specific type of unit.

How can just the losing condition be changed, while all other Melee Initialization triggers remain?
 
Level 25
Joined
May 11, 2007
Messages
4,650
Remove the action called "Defeat players at bla bla" that is in the melee init.

Then create a new trigger, call it what you want.

Events - A Unit dies
Condition: (UnitType of triggering unit equal to "your unit" == true)
Actions:
Set tempGroup = "Your Unit" owned by player(Owner of Triggering Unit)
If (number of units in tempGroup == 0)
then
Game - Defeat(Owner of triggering unit) with message "Your farms are all gone!"
Custom script: call DestroyGroup(udg_tempGroup)
 
Level 10
Joined
Nov 5, 2008
Messages
536
Thank you.

A mod-file typically has no Melee Initialization trigger. Instead each individual map file has it.

Is it possible to create the Melee Initialization trigger inside the mod-file and just add your adjustment? Or do I need to add your adjustement into every individual map?

Dont want the two triggers to collide - one in the mod file, one in the individual map. Easiest would just be if the mod-file had all triggers, and the melee map had no triggers.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,258
You could overwrite the default melee initialization action I think. It is declared in some mod so logic states that if you overwrite it at a higher level mod it will not be loaded. This would allow you to keep the standard melee initialization and still do whatever you want.

Might not be so simple sadly. Your mod may need to duplicate the entire trigger library/script of a lower down mod in your mod to overwrite it.
 
Status
Not open for further replies.
Top