Page 1 of 1

Lol at me! (need help)

Posted: Tue Aug 18, 2009 8:55 am
by manstie
Okay, so I tried to do something sexy with my jumpers.
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)
Then I added to your sliding system:

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
Basically, I failed miserably.
Any ideas? (3ICE has probably got heaps! :lol: )
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!

Re: Lol at me! (need help)

Posted: Tue Aug 18, 2009 11:39 am
by 3ICE
What you tried to achieve is the default behavior of my system. You broke it by making that edit.
manstie wrote:When someone jumps while on ice, they will slide while in the air.
By default, units will slide on ice.
manstie wrote:When someone jumps while on normal, they wont slide while in the air.
By default, units will not slide on ground.

This is what my system does with jumpers/fly heights:
  • Ignore
  • Discard
  • Do not care
Just because the units do not touch the ground, doesn't mean they are not on it.
manstie wrote:When someone jumps while on ice, they will slide while in the air.
By default, flying units will slide above ice.
manstie wrote:When someone jumps while on normal, they wont slide while in the air.
By default, flying units will not slide above normal ground.

EDIT: If you want units to continue sliding above ground if they jumped from ice, you should have said so.

Re: Lol at me! (need help)

Posted: Sun Aug 23, 2009 5:43 am
by manstie
I find what I did is a really cool addition to your sliding system. I was planning to make "3ICE Sliding System Ultimate Jumpers Add on".

Re: Lol at me! (need help)

Posted: Sun Aug 23, 2009 6:53 am
by 3ICE
You can use my system however you want, but please don't release unofficial modifications.

Feel free to write a tutorial on how to add boosters though.

Re: Lol at me! (need help)

Posted: Sun Aug 23, 2009 7:17 am
by manstie
Come on...