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

Breeding and Reproduction Trigger

Status
Not open for further replies.
Level 5
Joined
Oct 7, 2005
Messages
102
Ok ive searched ALL over the web looking for this kind of trigger, a trigger that can make male units mate with female units = baby inside the mothers womb = then a child is born.

I was inspired by the map "Sheep Farmer" where the sheep reproduce on there own, and you have a slowly growing population, i thought this would be great to put on a map where you can slowly make a city from only a thew couples of men and women.

Ive already tried to deprotect the sheep map, but i don't understand the text the triggers came in, and i cant restore the GUI triggers (i think thats what they are).

Here is the text that was extracted from the map for the mating trigger, both auto mate and manual, the way i said that sounded dodgy.

//===========================================================================
// Trigger: Auto Mate
//===========================================================================
function Trig_Auto_Mate_Conditions takes nothing returns boolean
if ( not ( IsUnitType(udg_TempUnit, UNIT_TYPE_SAPPER) == false ) ) then
return false
endif
return true
endfunction

function Trig_Auto_Mate_Func002002001003001 takes nothing returns boolean
return ( IsUnitType(GetFilterUnit(), UNIT_TYPE_ANCIENT) == true )
endfunction

function Trig_Auto_Mate_Func002002001003002 takes nothing returns boolean
return ( IsUnitType(GetFilterUnit(), UNIT_TYPE_SAPPER) == true )
endfunction

function Trig_Auto_Mate_Func002002001003 takes nothing returns boolean
return GetBooleanAnd( Trig_Auto_Mate_Func002002001003001(), Trig_Auto_Mate_Func002002001003002() )
endfunction

function Trig_Auto_Mate_Actions takes nothing returns nothing
set udg_TempUnitB = GroupPickRandomUnit(GetUnitsInRangeOfLocMatching(1000.00, GetUnitLoc(udg_TempUnit), Condition(function Trig_Auto_Mate_Func002002001003)))
call IssueTargetOrderBJ( udg_TempUnit, "heal", udg_TempUnitB )
endfunction

//===========================================================================
function InitTrig_Auto_Mate takes nothing returns nothing
set gg_trg_Auto_Mate = CreateTrigger( )
call TriggerAddCondition( gg_trg_Auto_Mate, Condition( function Trig_Auto_Mate_Conditions ) )
call TriggerAddAction( gg_trg_Auto_Mate, function Trig_Auto_Mate_Actions )
endfunction


----------------------------------------------------------

And heres the manual mate.


//===========================================================================
// Trigger: Mate
//===========================================================================
function Trig_Mate_Func002C takes nothing returns boolean
if ( ( GetSpellAbilityId() == 'A001' ) ) then
return true
endif
if ( ( GetSpellAbilityId() == 'A00C' ) ) then
return true
endif
return false
endfunction

function Trig_Mate_Conditions takes nothing returns boolean
if ( not Trig_Mate_Func002C() ) then
return false
endif
return true
endfunction

function Trig_Mate_Actions takes nothing returns nothing
call PlaySoundOnUnitBJ( gg_snd_Sheep1, 100, GetSpellTargetUnit() )
call CreateNUnitsAtLocFacingLocBJ( 1, 'n001', GetOwningPlayer(GetSpellTargetUnit()), GetUnitLoc(GetSpellTargetUnit()), GetUnitLoc(GetSpellTargetUnit()) )
call IssueTargetOrderBJ( GetLastCreatedUnit(), "board", GetSpellTargetUnit() )
call GroupAddUnitSimple( GetLastCreatedUnit(), udg_Fetuses )
endfunction

//===========================================================================
function InitTrig_Mate takes nothing returns nothing
set gg_trg_Mate = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Mate, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Mate, Condition( function Trig_Mate_Conditions ) )
call TriggerAddAction( gg_trg_Mate, function Trig_Mate_Actions )
endfunction


So if anyone could possibly figure out this trigger for me? Else invent a new one for me? I would be so grateful! Thanks!
 
Status
Not open for further replies.
Top