Jump to content

[LE] Need help to make a retractable bridge just change position by 45 degrees instead of 90


Recommended Posts

So I’m doing a dungeon where I want a NorRetractableBridge01 to first work as a ceiling for the lower level of a dungeon, but then after you pull the leaver on the upper level fall down just 45 degrees (and not the default 90) and then function like a ramp that works as a shortcut between the two.

I thought this would be a simple thing to do in the default script in NorRetractableBridge01 but I can’t figure it out so now I wonder if some hero in here can point me in the right direction.

A warning though: If you know a solution please know that I do not possesses a good understanding of Papyrus (or scripting in general) so if you can, try to explain in a way that you would to a child. :wink:

If it helps, here is the existing properties that exist in the default script:

 

 

Link to comment
Share on other sites

The default script you mentioned is that:

 

NorRetractableBridgeSCRIPT

 

scriptName NorRetractableBridgeSCRIPT extends ObjectReference

import debug
import utility

bool isOpen = false                        ;Is the portcullis already open


bool property isAlreadyLowered    ;Set "isOpen" to same as property "isAlreadyOpen"
{
True = Bridge is already lowered
False = Bridge is raised (default)
}
    bool Function Get ()
        return isOpen
    endFunction
    
    Function Set(bool value)
        isOpen = value
    endFunction
endProperty

EVENT OnInit()
    if (isOpen == false)
            gotostate ("LoweredPosition")    ;Portcullis Start Closed
        else
            playAnimation("Raised")        ;Portcullis Starts Opened
            gotostate ("RaisedPosition")
    endif
endEVENT

STATE LoweredPosition    ; This is the state I am in when open and at rest
    EVENT onActivate (objectReference triggerRef)
        gotoState ("busy")
        ;trace("Portcullis Opening")
        playAnimationandWait("lower","trans02") ; Animate Open
        ;trace("Portcullis Opened")
        isOpen = true
        gotoState("RaisedPosition")
    endEVENT
endState

STATE RaisedPosition    ; This is the state I'm in when i'm closed and at rest
    EVENT onActivate (objectReference triggerRef)
        gotoState ("busy")
        ;trace("Portcullis Closing")
        playAnimationandWait("raise","trans01") ; Animate Closed
        ;trace("Portcullis Closed")
        isOpen = false
        gotoState("LoweredPosition")
    endEVENT
endState

STATE busy
    ; This is the state when I'm busy animating
        EVENT onActivate (objectReference triggerRef)
            ;trace ("Portcullis Busy")
        endEVENT
endSTATE

 

 

 

As you can see there is no option to change the fall down degree.

Maybe you should look for other objects similar to NorRetractableBridge01, which have 45° instead of 90°. If not existing you have to change the mesh-file related to NorRetractableBridge01.

Edited by ReDragon2013
Link to comment
Share on other sites

TranslateToRef? lel

 

not gonna explain you everything cause i have only 5 min left and i leave home << epic english xD

 

but

 

1) Place any item *Bridge or something* in every possible possition you want to have this object

2) select all those objects but left one unselected

3) replace them with XMarker ( CTRL + F )

4) Edit Base of this one left and copy Mesh src.

5) copy this mesh and edit it in NifScope to make collision box move

6) create new object ( ofc. Movable object ) and replace with this one "position" you left lel...

7) create script OnActivate for example Dwemer Lever and move object from position to position

 

maybe if i will have some time ill paste you working script but like i said i can't do it right now :c...

 

 

with script you can even rotate object by selected by user degrees :tongue:

 

//Edit:

hey, here you have Tutorial:

https://www.youtube.com/watch?v=1lkrX3HYSDc

 

just watch it and make your own script for your bridge :P

 

TranslateToRef is PoseToPose thats mean you can place one object in RenderWindow in one position

with own Rotation and Position and other object with own Rotation and Position and then use this function

to nice and smooth move to other position :x

Edited by TobiaszPL
Link to comment
Share on other sites

First, thank you all for taking the time to answer. Appreciate it a lot!

The default script you mentioned is that:

 

NorRetractableBridgeSCRIPT

 

scriptName NorRetractableBridgeSCRIPT extends ObjectReference

import debug
import utility

bool isOpen = false                        ;Is the portcullis already open


bool property isAlreadyLowered    ;Set "isOpen" to same as property "isAlreadyOpen"
{
True = Bridge is already lowered
False = Bridge is raised (default)
}
    bool Function Get ()
        return isOpen
    endFunction
    
    Function Set(bool value)
        isOpen = value
    endFunction
endProperty

EVENT OnInit()
    if (isOpen == false)
            gotostate ("LoweredPosition")    ;Portcullis Start Closed
        else
            playAnimation("Raised")        ;Portcullis Starts Opened
            gotostate ("RaisedPosition")
    endif
endEVENT

STATE LoweredPosition    ; This is the state I am in when open and at rest
    EVENT onActivate (objectReference triggerRef)
        gotoState ("busy")
        ;trace("Portcullis Opening")
        playAnimationandWait("lower","trans02") ; Animate Open
        ;trace("Portcullis Opened")
        isOpen = true
        gotoState("RaisedPosition")
    endEVENT
endState

STATE RaisedPosition    ; This is the state I'm in when i'm closed and at rest
    EVENT onActivate (objectReference triggerRef)
        gotoState ("busy")
        ;trace("Portcullis Closing")
        playAnimationandWait("raise","trans01") ; Animate Closed
        ;trace("Portcullis Closed")
        isOpen = false
        gotoState("LoweredPosition")
    endEVENT
endState

STATE busy
    ; This is the state when I'm busy animating
        EVENT onActivate (objectReference triggerRef)
            ;trace ("Portcullis Busy")
        endEVENT
endSTATE

 

 

 

As you can see there is no option to change the fall down degree.

Maybe you should look for other objects similar to NorRetractableBridge01, which have 45° instead of 90°. If not existing you have to change the mesh-file related to NorRetractableBridge01.

 

I think I hoped that you simply could change the animation, or value of it, in closeAnim /openAnim, or maybe that you could add a simple script that was activated when the open / close-animation started and that it would rotate the bridge with a -45 degrees in the opposite direction. But that doesn’t seem to bee the case.

On a related note, does it exist a way to be able to se all the possible values that you can put on a property or do you need to know them yourselt? Like does it somewere exist something like a dropdown menu that shows all the acceptable values?

 

The only animated objects in CK with 45 degree, are the wall traps. They have 45 - 90 - 180 - 360 degree.

 

Thanks for letting me know about this. It makes me wonder if would be a nice and original idea to use the wall-trap as a ramp or if people would think it was weird and it would break their immersion? (Me now just taking it for granted that you can remove the closing animation on them)

 

TranslateToRef? lel

 

not gonna explain you everything cause i have only 5 min left and i leave home << epic english xD

 

but

 

1) Place any item *Bridge or something* in every possible possition you want to have this object

2) select all those objects but left one unselected

3) replace them with XMarker ( CTRL + F )

4) Edit Base of this one left and copy Mesh src.

5) copy this mesh and edit it in NifScope to make collision box move

6) create new object ( ofc. Movable object ) and replace with this one "position" you left lel...

7) create script OnActivate for example Dwemer Lever and move object from position to position

 

maybe if i will have some time ill paste you working script but like i said i can't do it right now :c...

 

 

with script you can even rotate object by selected by user degrees :tongue:

 

//Edit:

hey, here you have Tutorial:

https://www.youtube.com/watch?v=1lkrX3HYSDc

 

just watch it and make your own script for your bridge :tongue:

 

TranslateToRef is PoseToPose thats mean you can place one object in RenderWindow in one position

with own Rotation and Position and other object with own Rotation and Position and then use this function

to nice and smooth move to other position :x

 

I think this is what I feared, that it would exist a good solution but that it would require a lot more steps and better understanding of the editor than I feel that I possess :tongue:

I just skimmed through the youtube-tutorial and I don’t know if I understand it well enough to be able to execute it but I will try it out and hopefully it will make more sense when I’m not as tired as I am right now and have access to the CK.

But anyhow, thank you all for helping me out! I love how folks here always take their time and tries to help! :D

Edited by DuringTheSaga
Link to comment
Share on other sites

One easy and quick solution that does not involves deep knowledge of CK or NifSkope or some other external program, is :
1a) Place and activator, for example a lever or a pull chain > go to its menu and on the scripts add an enable/disable script.
1b) Place near the lever an xMarker.
This script will help you :


Scriptname aXMDLightSwitchOnOff extends ObjectReference  
{Light Switch on/off XMarker or lights}
 
ObjectReference Property MainLight Auto
 
Event OnActivate(ObjectReference akActionRef)
   If (MainLight.IsEnabled())
       MainLight.disable()
  Else
      MainLight.enable()
EndIf
EndEvent

 

 

 

2) You will need to add and create "New Script" (to the Lever or Pull Chain) then edit source the Script (right click on your new created script and choose the "edit source" option). Now copy the content from this script and paste it, then save and you are done. (copy from the - ObjectReference Property MainLight Auto - and bellow)
Now go to properties and Link Ref the "MainLight' option of the script to the xMarker.
3) Now place two bridges in the position you desire.
- One in an ANGLE 45 degrees.
- One horizontal
4) Go to the 45 degree bridge's menu (Referece Window - Double cklick) and on the "Enable Parent" menu "CHECK the box that writtes Set Enable State to Opposite of Parent" (in the left down corner).
In the same menu "ENABLE PARENT" click on the "Select Reference in Render Window" and select the xMarker.
* This object will be in a "Disable state" until the Lever gets Activated, then after the Lever's Activation will go to an "Enable state".
5) Go to the horizontal bridge's menu that is named "ENABLE PARENT" and click on the "Select Reference in Render Window" and select the xMarker. (Do NOT CHECK with this one the Set Enable State to Opposite of Parent option - as you did with the 45 degree bridge)
* This object will be in a "Enable state" until the Lever gets Activated, then after the Lever's Activation will go to an "Disable state".
Now you are done !
Every time you activate the Lever one will appear and the othe will disappear.
* There is also a "pop up" option in the enable parent menu to make an object suddenly appear or fade in/out.
...................................................................
* I forgot to mention that the bridges won't have animation because you won't "ACTIVATE PARENT" neither of them (you won't linked them to the lever to be activated).
This approach is just to resolve the 45 degree issue by using the two bridges as NON ANIMATED STATIC objects.
Hope it helps....
......................................................................
Update :
Small mistake (sorry) in Number 4 - important for this to work correctly :
- First you select the xMarker then you Set Enable State to Opposite of Parent.
Edited by maxarturo
Link to comment
Share on other sites

That'd be more or less my approach. As long as the lever is placed in such a way that the player can't see the bridge, the lack of animation won't matter. I'm not up on the modelling or animation side of things so I don't know how difficult it'd be to go in and make a proper 45-degree moving bridge, though.

Link to comment
Share on other sites

That'd be more or less my approach. As long as the lever is placed in such a way that the player can't see the bridge, the lack of animation won't matter. I'm not up on the modelling or animation side of things so I don't know how difficult it'd be to go in and make a proper 45-degree moving bridge, though.

It's not that difficult but it does required well knowledge of 3d studio Max (optional) & NifSkope (necessary).
If you don't, you will encounter issues with the most common been COLLISION.
Link to comment
Share on other sites

  • Recently Browsing   0 members

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