| 06-30-2006, 02:46 PM | #1 |
Hey, does anyone know if its possible to have a units footsteps be imprinted in the snow each step, as opposed to the default every few steps. Also, is it possible to maybe make the footsteps larger and stay imprinted for a longer amount of time? Thanks everyone |
| 06-30-2006, 08:05 PM | #2 |
footsteps are hardcoded in the unit's model file |
| 06-30-2006, 09:39 PM | #3 | |
Try this trigger; it's something quick I came up with for creating destructables as footprints based on something I saw Panto do a couple years ago. Of course be sure that your destructable doesn't block line of sight or pathing. Note: It uses KaTTaNa's local handle variable functions, which is in the hidden section if you need it, and requires a global gamecache variable.
Footstep Stuff:// Footstep stuff function Feet_FootstepDistance takes nothing returns real return 15.0 endfunction function Feet_FootstepDestructableId takes nothing returns integer return [DestructableRawcode] endfunction function Feet_UnitWithFootsteps takes nothing returns integer return [UnitRawcode] endfunction function Feet_FootstepDuration takes nothing returns real return 3.00 endfunction function Feet_Conditions takes nothing returns boolean local unit u = GetFilterUnit() if( GetUnitTypeId( u ) == Feet_UnitWithFootsteps() ) then return true endif return false endfunction function Feet_CleanDestructable takes nothing returns nothing local timer t = GetExpiredTimer() call KillDestructable( GetHandleDestructable( t, "Feet_Destructable" )) call FlushHandleLocals( t ) call DestroyTimer( t ) set t = null endfunction function Feet_Actions takes nothing returns nothing local rect r = GetEntireMapRect() local group g = CreateGroup() local boolexpr bx = Condition( function Feet_Conditions ) local location unitLoc local location previousLoc local unit tempUnit local timer dTimer call GroupEnumUnitsInRect( g, r, bx ) call DestroyBoolExpr(bx) set bx = null loop set tempUnit = FirstOfGroup( g ) exitwhen tempUnit == null set previousLoc = GetHandleLocation( tempUnit, "Feet_PreviousLoc" ) set unitLoc = GetUnitLoc( tempUnit ) if( DistanceBetweenPoints( unitLoc, previousLoc ) > Feet_FootstepDistance() ) then set dTimer = CreateTimer() if( GetHandleBoolean( tempUnit, "Feet_Right" ) ) then call SetHandleHandle( dTimer, "Feet_Destructable", CreateDestructable(Feet_FootstepDestructableId(), GetLocationX(unitLoc) + (-20.00 * SinBJ(GetUnitFacing(tempUnit))), GetLocationY(unitLoc) + (-20.00 * CosBJ(GetUnitFacing(tempUnit))), GetUnitFacing(tempUnit), 1, 1) ) call TimerStart( dTimer, Feet_FootstepDuration(), false, function Feet_CleanDestructable ) else call SetHandleHandle( dTimer, "Feet_Destructable", CreateDestructable(Feet_FootstepDestructableId(), GetLocationX(unitLoc) + (20.00 * SinBJ(GetUnitFacing(tempUnit))), GetLocationY(unitLoc) + (20.00 * CosBJ(GetUnitFacing(tempUnit))), GetUnitFacing(tempUnit), 1, 1) ) call TimerStart( dTimer, Feet_FootstepDuration(), false, function Feet_CleanDestructable ) endif call SetHandleBoolean( tempUnit, "Feet_Right", not GetHandleBoolean(tempUnit, "Feet_Right") ) endif call RemoveLocation( previousLoc ) call SetHandleHandle( tempUnit, "Feet_PreviousLoc", unitLoc ) call GroupRemoveUnit( g, tempUnit ) endloop call DestroyGroup( g ) set g = null set tempUnit = null call RemoveRect( r ) set r = null set previousLoc = null set unitLoc = null set dTimer = null endfunction //=========================================================================== function InitTrig_Feet takes nothing returns nothing set gg_trg_Feet = CreateTrigger() call TriggerRegisterTimerEventPeriodic( gg_trg_Feet, 0.50 ) call TriggerAddAction( gg_trg_Feet, function Feet_Actions ) endfunction |
