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

Face Before Attack

Status
Not open for further replies.
Level 12
Joined
Mar 13, 2012
Messages
1,121
For the easiest solution set following values of the unit:

-"Movement - Speed Base" to 1
-"Movement - Turn Rate" to something between 0.1 and 3 as you wish
-"Movement - Type" to Float
 
For the easiest solution set following values of the unit:

-"Movement - Speed Base" to 1
-"Movement - Turn Rate" to something between 0.1 and 3 as you wish
-"Movement - Type" to Float

The solution was very smart but it didn't fit my case:
http://www.hiveworkshop.com/forums/models-530/serpent-158830/?prev=search=snake&d=list&r=20
This model used as serpent ward spell, but attacks are done without facing.
giving the unit 1 movement speed will give it the minimal 100 which I can't efford. serpent wards can't move.
Is there another way to do it?
 
Level 12
Joined
Mar 13, 2012
Messages
1,121
Well thats the reason why I said set "Movement - Type" to Float..

If you have any shallow water in your map though additionally use the JASS function SetUnitPropWindow(unit, 0)
 
Level 12
Joined
Mar 13, 2012
Messages
1,121
The value defines at which angle difference your unit will start moving when its given any kind of move order.

For example a value of 180 and the unit will start moving right after the command and do the turning while moving.

A value of 0 means the unit will in no case start moving.

Mind that you have to use the JASS function SetUnitPropWindow and not the GUI one, as the GUI function doesnt let you set 0 as argument.
 
The value defines at which angle difference your unit will start moving when its given any kind of move order.

For example a value of 180 and the unit will start moving right after the command and do the turning while moving.

A value of 0 means the unit will in no case start moving.

Mind that you have to use the JASS function SetUnitPropWindow and not the GUI one, as the GUI function doesnt let you set 0 as argument.

  • Summon Cobra
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Summon Cobra
    • Actions
      • Set A = (Player number of (Owner of (Triggering unit)))
      • Set EAbility_level[A] = (Level of (Ability being cast) for (Triggering unit))
      • Set p = (Target point of ability being cast)
      • Set real1 = (X of p)
      • Set real2 = (Y of p)
      • Custom script: call RemoveLocation (udg_p)
      • Set Integer = EAbility_level[A]
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Integer Equal to 1
        • Then - Actions
          • Set ut = Cobra (Level 1)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Integer Equal to 2
        • Then - Actions
          • Set ut = Cobra (Level 2)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Integer Equal to 3
        • Then - Actions
          • Set ut = Cobra (Level 3)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Integer Equal to 4
        • Then - Actions
          • Set ut = Cobra (Level 4)
        • Else - Actions
      • -------- create caster --------
      • Unit - Create 1 ut for (Player(A)) at (Point(real1, real2)) facing (Facing of (Triggering unit)) degrees
      • Unit - Add a 40.00 second Generic expiration timer to (Last created unit)
      • Unit - Add classification of Summoned to (Last created unit)
      • Animation - Change (Last created unit) prop window angle to 0.00
      • -------- create caster --------
^ snake still walks upon water

"If you have any shallow water in your map though additionally use the JASS function SetUnitPropWindow(unit, 0)"
My map is Hero War that fight on global sea...
 
Last edited:
You have to use the JASS function in Custom script.

What is JASS?
Edit: I converted the trigger and added your function now it looks like this:

function Trig_Summon_Cobra_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A0FT' ) ) then
return false
endif
return true
endfunction

function Trig_Summon_Cobra_Func008C takes nothing returns boolean
if ( not ( udg_Integer == 1 ) ) then
return false
endif
return true
endfunction

function Trig_Summon_Cobra_Func009C takes nothing returns boolean
if ( not ( udg_Integer == 2 ) ) then
return false
endif
return true
endfunction

function Trig_Summon_Cobra_Func010C takes nothing returns boolean
if ( not ( udg_Integer == 3 ) ) then
return false
endif
return true
endfunction

function Trig_Summon_Cobra_Func011C takes nothing returns boolean
if ( not ( udg_Integer == 4 ) ) then
return false
endif
return true
endfunction

function Trig_Summon_Cobra_Actions takes nothing returns nothing
set udg_A = GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))
set udg_EAbility_level[udg_A] = GetUnitAbilityLevelSwapped(GetSpellAbilityId(), GetTriggerUnit())
set udg_p = GetSpellTargetLoc()
set udg_real1 = GetLocationX(udg_p)
set udg_real2 = GetLocationY(udg_p)
call RemoveLocation (udg_p)
set udg_Integer = udg_EAbility_level[udg_A]
if ( Trig_Summon_Cobra_Func008C() ) then
set udg_ut = 'o001'
else
endif
if ( Trig_Summon_Cobra_Func009C() ) then
set udg_ut = 'o002'
else
endif
if ( Trig_Summon_Cobra_Func010C() ) then
set udg_ut = 'o003'
else
endif
if ( Trig_Summon_Cobra_Func011C() ) then
set udg_ut = 'o000'
else
endif
// create caster
call CreateNUnitsAtLoc( 1, udg_ut, ConvertedPlayer(udg_A), Location(udg_real1, udg_real2), GetUnitFacing(GetTriggerUnit()) )
call UnitApplyTimedLifeBJ( 40.00, 'BTLF', GetLastCreatedUnit() )
call UnitAddTypeBJ( UNIT_TYPE_SUMMONED, GetLastCreatedUnit() )
call SetUnitPropWindow( GetLastCreatedUnit(), 0.00 )
endfunction

//===========================================================================
function InitTrig_Summon_Cobra takes nothing returns nothing
set gg_trg_Summon_Cobra = CreateTrigger( )
call DisableTrigger( gg_trg_Summon_Cobra )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Summon_Cobra, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Summon_Cobra, Condition( function Trig_Summon_Cobra_Conditions ) )
call TriggerAddAction( gg_trg_Summon_Cobra, function Trig_Summon_Cobra_Actions )
endfunction

It works!!! +rep, thanks and I will tell you something funny: serpent wards are uncastable upon water by default so I had to make new skill cause of my special map.
Peace.
 
Level 12
Joined
Mar 13, 2012
Messages
1,121
Eh.. I meant you have to use
  • Custom script - SetUnitPropWindow(GetLastCreatedUnit(),0.00)
instead of
  • Animation - Change (Last created unit) prop window angle to 0.00
nothing else ^^
 
Status
Not open for further replies.
Top