What I wanted to happen is:
When someone jumps while on ice, they will slide while in the air.
When someone jumps while on normal, they wont slide while in the air.
Here's what I've got:
On my jumper, I did set
Code: Select all
udg_LastTerrain[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))] = GetTerrainType(x,y)
Code: Select all
if(GetUnitFlyHeight(u)<1)then
local integer t=GetTerrainType(x,y)
if(t==udg_Slide)or(t==udg_Slide2)or(t==udg_Slide4)then
call SetUnitX(u,x+udg_Speed[GetConvertedPlayerId(GetOwningPlayer(u))]*Cos(0.017453278*GetUnitFacing(u)))
call SetUnitY(u,y+udg_Speed[GetConvertedPlayerId(GetOwningPlayer(u))]*Sin(0.017453278*GetUnitFacing(u)))
//Delete this line for the cool Realistic Sliding Mode (Between START1 and END1)
//START1
call IssueImmediateOrder(u,"stop")
//END1
//Delete these two lines to remove terrainkill (Between START2 and END2)
//START2
elseif(t==udg_TerrainKill)and(GetUnitState(u,UNIT_STATE_LIFE)>0)and(GetUnitFlyHeight(u)<1)then
call KillUnit(u)
//END2
endif
if(t==udg_Slide3)then
call SetUnitX(u,x+udg_Speed2[GetConvertedPlayerId(GetOwningPlayer(u))]*Cos(0.017453278*GetUnitFacing(u)))
call SetUnitY(u,y+udg_Speed2[GetConvertedPlayerId(GetOwningPlayer(u))]*Sin(0.017453278*GetUnitFacing(u)))
//Delete this line for the cool Realistic Sliding Mode (Between START1 and END1)
//START1
call IssueImmediateOrder(u,"stop")
//END1
//Delete these two lines to remove terrainkill (Between START2 and END2)
//START2
elseif(t==udg_TerrainKill)and(GetUnitState(u,UNIT_STATE_LIFE)>0)and(GetUnitFlyHeight(u)<1)then
call KillUnit(u)
//END2
endif
elseif(udg_LastTerrain[GetConvertedPlayerId(GetOwningPlayer(u))]==udg_Slide)or(udg_LastTerrain[GetConvertedPlayerId(GetOwningPlayer(u))]==udg_Slide3)or(udg_LastTerrain[GetConvertedPlayerId(GetOwningPlayer(u))]==udg_Slide4)then
call SetUnitX(u,x+udg_Speed[GetConvertedPlayerId(GetOwningPlayer(u))]*Cos(0.017453278*GetUnitFacing(u)))
call SetUnitY(u,y+udg_Speed[GetConvertedPlayerId(GetOwningPlayer(u))]*Sin(0.017453278*GetUnitFacing(u)))
//Delete this line for the cool Realistic Sliding Mode (Between START1 and END1)
//START1
call IssueImmediateOrder(u,"stop")
//END1
elseif(udg_LastTerrain[GetConvertedPlayerId(GetOwningPlayer(u))]==udg_Slide2)then
call SetUnitX(u,x+udg_Speed2[GetConvertedPlayerId(GetOwningPlayer(u))]*Cos(0.017453278*GetUnitFacing(u)))
call SetUnitY(u,y+udg_Speed2[GetConvertedPlayerId(GetOwningPlayer(u))]*Sin(0.017453278*GetUnitFacing(u)))
endif
Any ideas? (3ICE has probably got heaps!

I'm pretty sure its all of those "elseif"'s... so if I can't do that, then how will I do what I was intending to do?
___________________________________________________________________________________________
Fixed it. Took me a whole though. - Holy shit! It actually works!