• Check out the results of the Techtree Contest #19!
  • 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.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

Creep Aggression System

Status
Not open for further replies.

AllGhilliedUp

A

AllGhilliedUp

I'm curious on how to make it so that when you attack a creep, it'll turn aggressive, then after some time, while not being attacked, turn back to a passive unit.

Example:
You attack Enemy A.
Enemy A goes from Neutral Passive to Neutral Hostile.
You run away.
After 5 seconds of not being attacked, Enemy A turns back to Neutral Passive.

Currently, I've got something that makes it so when a unit's attacked, it turns to its aggressive state, but not something so that after a set time, it reverts back.

Thanks if you can help me.
 
Yeah, there's going to be lots of creeps. They're supposed to be wandering about, so they you could encounter more than one at once. My main issue is that I can't find anything so that I could use something like,"Unit is not attacked" or "Unit is still not attacked", or something along those lines.
 
JASS:
function Trig_blahblahblah takes nothing returns nothing
    call SetUnitOwner( GetTriggerUnit(), Player(PLAYER_NEUTRAL_AGGRESSIVE), true )
    call TriggerSleepAction(5.00)
    call SetUnitOwner(GetTriggerUnit(), Player((PLAYER_NEUTRAL_PASSIVE), true)
endfunction

//===========================================================================
function InitTrig_blahblahblah takes nothing returns nothing
    set gg_trg_blahblahblah = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_blahblahblah, EVENT_PLAYER_UNIT_ATTACKED )
    call TriggerAddAction( gg_trg_blahblahblah, function Trig_blahblahblah )
endfunction
make a trigger, call it blahblahblah, convert to custom text, delete verything, and convert that into it.
 
Change your units' acquisition range to 0. Then, it will not attack until provoked. Neutrals return to their camp automatically if they move 500 range from it, so if you need them to stop, you'll just have to run :)
 
Status
Not open for further replies.
Back
Top