Jump to content

can't disable collision box


Eluwil

Recommended Posts

I can't disable a collision box that I have previously disabled in a startup script and enabled again in this script. I basically want the player to land upon the collision box and then disable it so that the player will fall into a lake of water. If I simply teleport the player in the air then the player will end up in the water without the fall. So that's why I need to enable and disable this collision box. The first disable works and and enabling it works as well but I cannot disable it again, so I end up standing in the sky.

 

Here is the script, it's the part under the ( DoOnce == 3 ) section that doesn't work. The particular line that does not seem to work is: "ABE_FelthasCollisionBox"->disable. It worked in my other disable script and I copy pasted it into here, so the line should not be faulty.

 

Begin ABE_FelthasUlthinScript

short DoOnce
float timer

if ( DoOnce == 0 )
DisablePlayerControls
FadeOut, 1
"ABE_DoorUlthinDome1"->disable
"ABE_DoorUlthinDome2"->enable
"ABE_FelthasCollisionBox"->enable
PlaySound "mysticism hit"
set DoOnce to 1
endif

if ( DoOnce == 1 )
Set timer to ( timer + GetSecondsPassed )
if ( timer > 1 )
Player->PositionCell, -11285, -5436, 1997, 245, "West Gash Region (-2, -1)"
set DoOnce to 2
endif
endif

if ( DoOnce == 2 )
if ( GetPCCell "West Gash Region" == 1 )
Set timer to ( timer + GetSecondsPassed )
if ( timer > 3 )
FadeIn, 1
set timer to 0
set DoOnce to 3
endif
endif
endif

if ( DoOnce == 3 )
Set timer to ( timer + GetSecondsPassed )
if ( timer > 1 )
"ABE_FelthasCollisionBox"->disable
EnablePlayerControls
set DoOnce to 4
endif
endif

if ( DoOnce == 4 )
Stopscript "ABE_FelthasUlthinScript"
endif

End

Link to comment
Share on other sites

 

The first disable works and and enabling it works as well but I cannot disable it again, so I end up standing in the sky.

 

according to this you have set "Reference Persists" but just to get the obvious out of the way xD

 

does "EnablePlayerControls" work at the DoOnce == 3 stage ? if so it would appear to not be a timer issue?

 

in a MW script they comment on "Set timer to ( timer + GetSecondsPassed )" to have it outside if statements, because it can cause problems, but i made scripts with it inside if statements that worked, so i don't know when it's ok or not ok, or if it's never ok to do so.

 

so with my current understanding this is how i would change the script, but keep in mind i'm no expert not by a long shot....! and i believe if you have a timer you should always have a menumode return. (hope someone stops by and can give some detail on timer + getSecondsPassed inside if statements)

Begin ABE_FelthasUlthinScript

short DoOnce
float timer

if ( menumode == 1 )
    return
endif

if ( DoOnce == 0 )
    DisablePlayerControls
    FadeOut, 1
    "ABE_DoorUlthinDome1"->disable
    "ABE_DoorUlthinDome2"->enable        
    "ABE_FelthasCollisionBox"->enable
    PlaySound "mysticism hit"
    set DoOnce to 1        
endif

if ( DoOnce == 1 )
    if ( timer >= 1 )
        Player->PositionCell, -11285, -5436, 1997, 245, "West Gash Region (-2, -1)"
        set DoOnce to 2
    endif
endif

if ( DoOnce == 2 )
    set timer to 0
    if ( GetPCCell "West Gash Region" == 1 )
        if ( timer >= 3 )
            FadeIn, 1
            set DoOnce to 3
        endif
    endif
endif

if ( DoOnce == 3 )
    Set timer to 0
    if ( timer >= 1 )
        "ABE_FelthasCollisionBox"->disable
        EnablePlayerControls
        Stopscript "ABE_FelthasUlthinScript"
    endif
endif

Set timer to ( timer + GetSecondsPassed )

End
Edited by FIMzzZzz
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...