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

Change the time for a spell or effect to resolve?

Status
Not open for further replies.
Level 10
Joined
Nov 5, 2008
Messages
536
Is it possible to change the time it takes for a spell or effect to resolve?

For example, when I click burrow on a lurker, it burrows immediately. Can a 2 sec delay be added? When I press burrow, it takes 2 seconds before it begins it´s burrow order, OR it burrows 2 seconds slower, so it looks like it burrows in slow motion?

The same goes with the spider mine. When a target comes close to the mine, it pops up from the ground, waits 2 seconds, and then follows it´s target and blows up.

How can this be done? I can´t really find any field to edit it.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,258
For example, when I click burrow on a lurker, it burrows immediately. Can a 2 sec delay be added? When I press burrow, it takes 2 seconds before it begins it´s burrow order, OR it burrows 2 seconds slower, so it looks like it burrows in slow motion?

Yes this is possible. Just add a duration to the burrow morph. That way it will be stuck in borrowing morph for a period of time and not be able to do anything during that time. Animations might need some actor changes to match the delay though.

The field is part of the morph information (where you specify morphs the unit is allowed to make and the appropiate stats that accompany them).

The same goes with the spider mine. When a target comes close to the mine, it pops up from the ground, waits 2 seconds, and then follows it´s target and blows up.
Look into the mechanics of how a spider mine opperates. You will probably need to add an extra effect with the purpose of just delaying the actions of the mine.
 
Level 10
Joined
Nov 5, 2008
Messages
536
The same goes with the spider mine. When a target comes close to the mine, it pops up from the ground, waits 2 seconds, and then follows it´s target and blows up.

How can this be done? I can´t really find any field to edit it.

I have found a way to make the spider mine pop up from the ground slower. For some reason the spider mine won´t follow it´s target if the target gets to far away.

For example, a fast zergling runs past the mine. The Mine unburrows at a slower pace. Since the zergling is to far away when the mine has unburrowed, the mine burrows back again.


Anyone knows how to change how far the spider mine can follow an enemy?
 
Last edited:
JASS:
// Unit behaviors

// Behavior categories
const int c_unitBehaviorFlagPermanent           = 0;
const int c_unitBehaviorFlagRestorable          = 1;
const int c_unitBehaviorFlagTemporary           = 2;
// Behavior buff flags
const int c_unitBehaviorFlagChanneled           = 3;
const int c_unitBehaviorFlagChanneling          = 4;
const int c_unitBehaviorFlagCountdown           = 5;
const int c_unitBehaviorFlagExtend              = 6;
const int c_unitBehaviorFlagDisableBuilding     = 7;
const int c_unitBehaviorFlagRemoveDamageResponseExhausted = 8;
const int c_unitBehaviorFlagRefreshStack        = 9;
// Behavior info flags
const int c_unitBehaviorFlagHidden              = 10;
// Behavior count
const int c_unitBehaviorCountAll                = -1;

native void     UnitBehaviorAdd (unit inUnit, string inBehavior, unit inCaster, int inCount);
native void     UnitBehaviorAddPlayer (unit inUnit, string inBehavior, int inPlayer, int inCount);
native int      UnitBehaviorCountAll (unit inUnit);
native int      UnitBehaviorCount (unit inUnit, string inBehavior);
native fixed    UnitBehaviorDuration (unit inUnit, string inBehavior);
native void     UnitBehaviorSetDuration (unit inUnit, string inBehavior, fixed inDuration);
native bool     UnitBehaviorEnabled (unit inUnit, string inBehavior);
native string   UnitBehaviorGet (unit inUnit, int inIndex);
native bool     UnitHasBehavior (unit inUnit, string inBehavior);
native void     UnitBehaviorRemove (unit inUnit, string inBehavior, int inCount);
native void     UnitBehaviorRemovePlayer (unit inUnit, string inBehavior, int inPlayer, int inCount);
native void     UnitBehaviorTransfer (unit inSource, unit inDest, string inBehavior, int inCount);
native bool     UnitBehaviorHasFlag (string inBehavior, int inCategory);
native void     UnitBehaviorRemoveCategory (unit inUnit, int inCategory);

native void     UnitBehaviorAddChargeRegen (unit inUnit, string inBehavior, string inCharge, fixed inVal);
native fixed    UnitBehaviorGetChargeRegen (unit inUnit, string inBehavior, string inCharge);
native void     UnitBehaviorAddChargeUsed (unit inUnit, string inBehavior, string inCharge, fixed inVal);
native fixed    UnitBehaviorGetChargeUsed (unit inUnit, string inBehavior, string inCharge);

native void     UnitBehaviorAddCooldown (unit inUnit, string inBehavior, string inCooldown, fixed inVal);
native fixed    UnitBehaviorGetCooldown (unit inUnit, string inBehavior, string inCooldown);

native void     UnitXPGainEnable (unit inUnit, string inBehavior, bool inEnable);

// Unit markers
native marker   UnitMarker (unit inUnit, int inIndex);
native void     UnitMarkerAdd (unit inUnit, marker inMarker);
native int      UnitMarkerCount (unit inUnit, marker inMarker);
native void     UnitMarkerRemove (unit inUnit, marker inMarker);

Notice this line:
JASS:
native void     UnitBehaviorSetDuration (unit inUnit, string inBehavior, fixed inDuration);

You use that line for example,
JASS:
UnitBehaviorSetDuration(lv_u, "BroodlingFate", 1.0);

Doing that would, assuming you have this behavior applied to the unit, set it to last 1.0 seconds before the broodling meets its fate. I've used this for applying a timed life to projectiles.
 
Status
Not open for further replies.
Top