Jump to content

I need advice and help with a script


Tasheni

Recommended Posts

Dear fellows, I have implemented a big ship into my isles mod I want to use as a player's home and to transport followers. I used the same script I have already attached to my trading boat, but I can't get it to work the way I want. I used the script from the mod Sailable Ships and changed it to my needings and it works fine for my boats. But this solution maybe not the best for what I want to do now: Sail a big ship, move followers onboard, use two doors for getting into interior, a ladder as activator at the outer shipwall to being teleported from water onto the ship. What I have so far:

Ship is sailable and the wheel activator and the doors move to the right place, when player toggles the anchor. Two ship interior cells I can enter, but not exit anymore.

1: I can toggle sails and anchor and start sailing. Sometimes when I exit sailing with the e key, player gets stuck and nothing but quit the game helps - it worked fine, but suddenly stops working.

2:There are problems with SetVehicle. I placed an XMarker in front of the shipswheel, but player is always attached outside the ship. When I start to sail. player is moved to the middle of the ship. When I exit sailing and activate the shipswheel again, player is positioned right. How can I get the player fixed? I don't really understand how SetVehicle works, because the XMarker is not moving with the ship?

3: I can enter my ship interior, but there is no activator to leave the cell. I guess this is due to the system the whole thing is setup.

If you have any ideas, please read on. I explain now the setup and will post the used script:

Setup: A dummy cell that includes the static ship with furled sails, an XMarker as movement point, two invisible actors and two load doors.

On water: the movable ship with unfurled sails, an XMarker to attach the player to the ship with SetVehicle, and invisible activator at the shipswheel.

If player activates the wheel, a messagebox pops up: Toggle sail and anchor or start/stop sailing. If player toggles the anchor, the static ship spawns from the dummy cell at the exact place of the movable ship, the doors are moved to the right place at the ship, the movable ship moves to dummy cell marker. Sails are furled and player can now go inside.

If player starts sailing, the doors and the wheel activator are moved to the dummy cell. Player gets attached to the movable ship. When pressing e key, sailing stops, the activator moves from dummy cell back to the wheel.

If there is a better solution to achieve my goals, please tell me. And if you want to help me scripting, this is much appreciated. :hug:

Here comes the script:

Scriptname _Tash_ShipRedguardActivatorScript extends ObjectReference

;-- Properties --------------------------------------
static property StaticShip auto            ; static ship in dummy cell
ObjectReference property MyBoat auto    ;actually used ship
idle property SitAnim auto                
actor property BackActor auto            ;swimming invisible actor in dummy cell - they are used to detect if ship crashes on land or against an obstacle
sound property WaterChurn auto            ;ship's noise
sound property CollisionSound auto        ;if ship crashes on land or obstacle
ObjectReference property SpawnedStaticShip auto    ;static ship spawned from reference ship in dummy cell
sound property BoatSound auto            ;ship's second noise
message property LongBoatMenu auto        ;activation menu for sailing or toggling anchor and sails
actor property FrontActor auto            ;swimming invisible actor in dummy cell
ObjectReference property SeatVehicle auto    ;XMarker to attach player to the ship for translation
actor property PlayerRef auto
ObjectReference property StaticShipMarker auto    ;XMarker in dummy cell where the ships are moved
ObjectReference property ShipDoorCabin Auto        ;Load door for cabin interior
ObjectReference property ShipDoorBase Auto        Load door for basement interior

;-- Variables ---------------------------------------
Int DefLef = 30    ;left
Float MaxReverseSpeed
Float ZBoatPosition
Int DefBac = 31    ;back
Bool ToggleAnchor
Float CurrentSpeed
Int DefRig = 32    ;right
Float FrontOffset
Bool Activated
Float YBoatPosition
Float DefaultTiltAngle
Int n
Float BoatAngleSpeed
Float BoatTiltAngle
Float MenDepthOffset    ;depth of swimming actors
Float dir    ;movement direction
Float BoatAngle
Float FrontBackMenOffset  ;swimming actors distance from boat
Float DefaultAngleSpeed
Bool ToggleDrive
Float XBoatPosition
Int WaterChurnInstanceID
Int BoatCreakSoundID
Int DefFor = 17    ;forward
Float MaxSpeed

;-- Functions ---------------------------------------

function OnUpdate() ;get ship position, movement direction and speed. Invisible swimming actors simulate the collision with land
                    ;I need to adjust the values to get it right for this big ship

    XBoatPosition = MyBoat.GetPositionX()
    YBoatPosition = MyBoat.GetPositionY()
    ZBoatPosition = MyBoat.GetPositionZ()
    BoatAngleSpeed = DefaultAngleSpeed
    
    if input.IsKeyPressed(DefFor) || input.IsKeyPressed(DefBac)
        if input.IsKeyPressed(DefFor) && FrontActor.IsSwimming()
            if CurrentSpeed > 0 as Float && dir == -1 as Float
                CurrentSpeed -= 10 as Float
                dir = -1 as Float
            elseIf CurrentSpeed < MaxSpeed
                CurrentSpeed += 10 as Float
                dir = 1 as Float
            endIf
        elseIf input.IsKeyPressed(DefBac) && BackActor.IsSwimming()
            if CurrentSpeed > 0 as Float && dir == 1 as Float
                CurrentSpeed -= 10 as Float
                dir = 1 as Float
            elseIf CurrentSpeed < MaxReverseSpeed
                CurrentSpeed += 10 as Float
                dir = -1 as Float
            endIf
        elseIf !FrontActor.IsSwimming() || !BackActor.IsSwimming()
            CollisionSound.play(PlayerRef as ObjectReference)
            CurrentSpeed = 0 as Float
        endIf
    elseIf CurrentSpeed > 0 as Float
        CurrentSpeed -= 5 as Float
    else
        MyBoat.StopTranslation()
        game.GetPlayer().StopTranslation()
        if !ToggleDrive
            self.UnregisterForUpdate()
        endIf
    endIf
    if CurrentSpeed > 0 as Float
        if input.IsKeyPressed(DefLef)
            BoatAngle += -BoatAngleSpeed
            if BoatAngle <= -360 as Float
                BoatAngle = 0 as Float
            endIf
            BoatTiltAngle = 2 as Float
        endIf
        if input.IsKeyPressed(DefRig)
            BoatAngle += BoatAngleSpeed
            if BoatAngle >= 360 as Float
                BoatAngle = 0 as Float
            endIf
            BoatTiltAngle = -2 as Float
        endIf
    endIf
    sound.SetInstanceVolume(WaterChurnInstanceID, CurrentSpeed / MaxSpeed)
    YBoatPosition += dir * -CurrentSpeed * math.Sin(BoatAngle)
    XBoatPosition += dir * CurrentSpeed * math.Cos(BoatAngle)
    Float YPlayerPos = YBoatPosition - (-400*math.sin(BoatAngle)) ;400 being the players displacement from the centre of the boat
    Float XPlayerPos = XBoatPosition - (400* math.cos(BoatAngle)) ;y direction is negative
    MyBoat.TranslateTo(XBoatPosition, YBoatPosition, ZBoatPosition, BoatTiltAngle, 0 as Float, BoatAngle + FrontOffset, CurrentSpeed, 0 as Float)
    game.GetPlayer().TranslateTo(XPlayerPos, YPlayerPos, ZBoatPosition + 580 as Float, 0 as Float, 0 as Float, BoatAngle, CurrentSpeed, 0 as Float)
    FrontActor.MoveTo(MyBoat, FrontBackMenOffset * math.Sin(MyBoat.GetAngleZ()), FrontBackMenOffset * math.Cos(MyBoat.GetAngleZ()), -MenDepthOffset, true)
    BackActor.MoveTo(MyBoat, -FrontBackMenOffset * math.Sin(MyBoat.GetAngleZ()), -FrontBackMenOffset * math.Cos(MyBoat.GetAngleZ()), -MenDepthOffset, true)
    if ToggleDrive
        self.RegisterForSingleUpdate(0 as Float)
    endIf
endFunction

function RebindKeys(Int KeySel, Int Code)    ;unused

    if KeySel == 0
        DefFor = Code
        debug.Notification("Forward key has been rebound")
    elseIf KeySel == 1
        DefBac = Code
        debug.Notification("Back key has been rebound")
    elseIf KeySel == 2
        DefRig = Code
        debug.Notification("Right key has been rebound")
    elseIf KeySel == 3
        debug.Notification("Left key has been rebound")
        DefLef = Code
    else
        debug.Notification("Keys reset to default arrow keys")
        DefFor = 17
        DefBac = 31
        DefLef = 30
        DefRig = 32
    endIf
endFunction

function MenuActivated() ;player can unfurl the sails and lift the anchor for sailing or drop the anchor and furl the sails for docking

    Int MenuValue = LongBoatMenu.Show(0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000)
    if MenuValue == 0
        ToggleDrive = !ToggleDrive

        if ToggleDrive as Bool && !ToggleAnchor ;if anchor is lifted and sailing is activated
            ShipDoorCabin.Disable()
            ShipDoorBase.Disable()
            game.ForceFirstPerson()
            game.DisablePlayerControls(true, false, true, false, false, false, true, false, 0)
            PlayerRef.SetVehicle(SeatVehicle)    ;xmarker (SeatVehicle) on ship not working? player is never fixed there
            PlayerRef.SetGhost(True)
            WaterChurnInstanceID = WaterChurn.play(PlayerRef as ObjectReference)
            BoatCreakSoundID = BoatSound.play(PlayerRef as ObjectReference)
            sound.SetInstanceVolume(BoatCreakSoundID, 1.00000)
            self.MoveTo(StaticShipMarker, 0.000000, 0.000000, 0.000000, true) ; activator is moved to dummy cell
            PlayerRef.PlayIdle(SitAnim)    ;not working
            self.UnregisterForUpdate()
            self.RegisterForKey(DefFor)
            self.RegisterForKey(DefLef)
            self.RegisterForKey(DefRig)
            self.RegisterForKey(DefBac)
            self.RegisterForKey(18)
            self.RegisterForSingleUpdate(0 as Float)

        elseIf !ToggleDrive && !ToggleAnchor ;player did exit sailing with e key
            ShipDoorCabin.Enable()
            ShipDoorBase.Enable()
            game.EnablePlayerControls(true, true, true, true, true, true, true, true, 0)
            self.UnregisterForAllKeys()
            self.UnregisterForUpdate()
            PlayerRef.StopTranslation()
            PlayerRef.SetVehicle(none)
            PlayerRef.SetGhost(False)
            sound.StopInstance(WaterChurnInstanceID)
            sound.StopInstance(BoatCreakSoundID)
            CurrentSpeed = 0 as Float
            
            ;player has toggled the anchor: move activator and doors to static ship
            self.MoveTo(MyBoat, 700 as Float * math.Sin(MyBoat.GetAngleZ()), 700 as Float * math.Cos(MyBoat.GetAngleZ()), 580 as Float, true)
            ShipDoorCabin.MoveTo(SpawnedStaticShip, 640 as Float * math.Sin(SpawnedStaticShip.GetAngleZ()), 640 as Float * math.Cos(SpawnedStaticShip.GetAngleZ()), 340 as Float, true)
            ShipDoorBase.MoveTo(SpawnedStaticShip, 0 as Float * math.Sin(SpawnedStaticShip.GetAngleZ()), 0 as Float * math.Cos(SpawnedStaticShip.GetAngleZ()), 340 as Float, true)
        else
            debug.MessageBox("You must raise the anchor before sailing")
            ToggleDrive = !ToggleDrive
        endIf
    elseIf MenuValue == 1
        if !ToggleDrive
            self.DropAnchor()
        else
            debug.MessageBox("You must stop sailing before dropping anchor")
        endIf
    endIf
endFunction

function OnKeyUp(Int keyCode, Float holdTime) ;does nothing?

    if keyCode == 18
        Debug.Trace("Key released after " + holdTime + " seconds")
        self.MenuActivated()
    endIf
endFunction

function DropAnchor()

    ToggleAnchor = !ToggleAnchor ;if anchor is down and sails furled, spawns a static ship at the exact position of the movable ship. Moves movable ship to dummy cell
                                 ;moves activator from dummy cell to static shipswheel, moves doors from dummy cell at their position on static ship
    if ToggleAnchor
        SpawnedStaticShip = MyBoat.PlaceAtMe(StaticShip as form, 1, false, false)
        MyBoat.MoveTo(StaticShipMarker, 0.000000, 0.000000, 0.000000, true)
        self.MoveTo(SpawnedStaticShip, 700 as Float * math.Sin(SpawnedStaticShip.GetAngleZ()), 700 as Float * math.Cos(SpawnedStaticShip.GetAngleZ()), 580 as Float, true)
        ShipDoorCabin.MoveTo(SpawnedStaticShip, 640 as Float * math.Sin(SpawnedStaticShip.GetAngleZ()), 640 as Float * math.Cos(SpawnedStaticShip.GetAngleZ()), 340 as Float, true)
        ShipDoorBase.MoveTo(SpawnedStaticShip, 0 as Float * math.Sin(SpawnedStaticShip.GetAngleZ()), 0 as Float * math.Cos(SpawnedStaticShip.GetAngleZ()), 340 as Float, true)

        debug.MessageBox("You have dropped the anchor.")
    else                        ;moves movable ship from dummy cell to static ship and disables the static ship
        MyBoat.MoveTo(SpawnedStaticShip, 0.000000, 0.000000, 0.000000, true)
        SpawnedStaticShip.DisableNoWait(false)
        SpawnedStaticShip.Delete()
        debug.MessageBox("You have lifted the anchor.")
    endIf
endFunction

function OnActivate(ObjectReference akActionRef) ;choice menu: sailing, anchor and sail toggling or exit

    self.MenuActivated()
endFunction

function OnInit()    ;set ship speed and movement direction. Set distance from ship for invisible actors. Set movement keys to WSAD

    MaxSpeed = 400 as Float
    MaxReverseSpeed = 400 as Float
    DefaultAngleSpeed = 2 as Float
    DefaultTiltAngle = 2 as Float
    FrontOffset = 90 as Float
    FrontBackMenOffset = 780 as Float
    dir = 1 as Float
    MenDepthOffset = 30 as Float
    DefFor = 17
    DefBac = 31
    DefLef = 30
    DefRig = 32
endFunction

I do not understand everything the script does. It's all trial and error for me. The values for the translation and distance of the invisible actors i.e. I simply tried different values until it worked.

What do you say? Screenshots here: https://www.afkmods.com/index.php?/gallery/album/149-tashenis-the-isles-of-teia/

 

 

 

 

 

Link to comment
Share on other sites

Hi, Tasheni! I don't know anything really about scripts, but I posted this over in the Coffee House thread in the Steam SSE forum, and perhaps someone there may know -

"Anyone experienced or knowledgeable about scripts, there is a question over on AFK Mods concerning one, for anyone who would wish to help:

From Tasheni - "I need advice and help with a script":
https://www.afkmods.com/index.php?/topic/6071-i-need-advice-and-help-with-a-script/

Thanks!"

https://steamcommunity.com/app/489830/discussions/0/154643795211522292/?ctp=1741#c3272438771252108009


Hope you don't mind, as it was the best way I thought to be able to help.

Link to comment
Share on other sites

Hi Tasheni,

I have read Steve's call in the Steam forum and may have found the problem. The SetVehicle function requires a Furniture marker attached to the ship, specifically to the steering wheel, same as riding a horse or dragon, or travelling with a cart or (rowing) boat. So, I think (not completely sure, never done anything like this) that where you use the XMarker, you should use the ship as a parameter for the SetVehicle function, with a Furniture marker in front of the steering wheel. If you have found the proper furniture marker at the steering wheel, the statement should be "PlayerRef.SetVehicle(YourShip)".

Good luck, Altbert

  • Thanks 2
Link to comment
Share on other sites

I've look a further into the issue by also checking the mod Sailable Ships of Skyrim SE, which uses a longboat and a rowing boat. In the statement PlayerRef.SetVehicle(SeatVehicle)" parameter SeatVehicle should definitely be set to the ship which should be a movable static. The original author has used a very peculiar way to let the player sit down. In the script they use the statement PlayerRef.PlayIdle(SitAnim/SitIdle), but there is no furniture marker on the longboat or rowing boat. Author also doesn't use idles to enter or leave the "seat", though idles are configured as IdleStoolEnterPlayer and EnterChairFront, both non-existing idles in the mod. Instead they use an unnamed package to provide for the sit animation, with the target set to None! Although it's a peculiar solution, at least it works for the rowing boat. 

I presume you want the player to be at the steering wheel. Then you will need a furniture marker that fits the steering wheel, and configure it usable for the player. Closest I can come up with is the counter/bar lean marker, possibly with appropriate idles to enter and leave the marker, as most idles are only used by NPCs and not the player.

Link to comment
Share on other sites

@Steve: Thank you very much, this is very kind of you.

@Altbert: Hi Altbert, thank you for your help. I made a video of the boats I already got to work:

Peculiar indeed. It took me days to figure out how it works - I'm a scripting noob :). The auther used XMarkers to attach the player to the boat, and that works fine for the row boat and the small sailing boat, with the trade ship the player translation is not perfect: player sometimes stays a bit behind if you drive full speed. But the animations for sitting never play, what makes completely sense, if there is no furniture. But for my new big ship this doesn't work anymore. I can sail it, but with the issues I described above. I also have noticed, that the ship animations do not work. I attached a controller to the ship and the animation is fine in nifscope, but ingame it's completely ignored. I guess there are too much nodes in the nif, the game can't handle. My other boats work fine though.

I tried already to set SeatVehicle to the ship, then the player moves down to the bottom of the ship :wallbash:. I will try that with a furniture marker - I have an invisible chair somewhere, but what I don't understand is how that works. The chair should be translated, too, or not? Is it automatically fixed to the boat through SeatVehicle?

I will try that out and report back. Thanks for your help, it's much appreciated.

 

Link to comment
Share on other sites

No luck at all. I looked into the setup of Helgen Intro, when the prisoners are attached to the carts, but I couldn't find any furniture markers on the carts. I also looked at the boat ride from Windhelm to Solstheim, but here is the same. I can't figure out how beth did this.

I tried the invisible chair. Like I assumed, player is not translating with the ship. He's attached to the chair and stays where the chair is. This is quite funny, you can move the big ship around like a remote controlled toy :lmao:. The other issue with a chair is the view. With an XMarker I can look around 360 degrees, with a chair only 180, what's alright with the rowboat, where player is sitting.

Weird is, that the first time player is attached to the ship, he hangs outside above the water. If you then move the boat he translates to the wheel at the wrong side. If you exit and start sailing again, all is fine. I don't know what happens here.

But the strangest thing that happened is, when I switched back to an XMarker in front of the wheel instead of an invisible chair, ship suddenly translates sideways. :stare:

I guess ck is fooling me. I feel I must quit with this kind of setup and look for other solutions. I will start from scratch. I downloaded the Gokstad ship, Dragonkiller cart and Gypsy Eyes Caravan and will look into their scripts. They are pretty difficult to understand, so hopefully I will find a solution I can deal with.

I want to move followers onboard. They should be able to walk around, at least if the ship is static. I guess it's not possible to attach navmesh to an object and move it with the object? Would be great if I could move them to the interior and if player stops sailing and toggles the anchor, they should move on deck. Or attach them with SetVehicle to furniture markers on the ship.

Any idea you may have is welcome :beer:

 

 

Link to comment
Share on other sites

It's not the scripts. The carriage scripts simply invoke idle animations. The animations attach the PC or NPC to the seating locations. There are 5 seating locations on the "cart" (really a wagon): driver, seat A, seat B, seat C, seat D. There are 3 animations for each of the seating locations: idle (sit in the seat), sway (in the seat during the ride), exit (stand and walk away from the seat). That's 15 animations total.

So you need to add attachment points to your nif, and new animations that use those specific attachment points.

Link to comment
Share on other sites

I have had a look at the way the player can ride a horse or a dragon, and at the same time thought about those mods with the most bizarre mountable creatures and animals, and had the "crazy" idea to make a boat/ship a mountable actor. I thought it had never been done before, but actually it has:

Script-Free Ship Sailing: https://www.nexusmods.com/skyrim/mods/67727
and an expansion: https://www.nexusmods.com/skyrim/mods/101178

These mods do use scripts, but not for movement, and those scripts are lightweight, using ActiveMagicEffect. The original mod only uses a canoe/kayak, but the expansion adds other types of ships. I tried to test those mods, but had to re-install Oldrim, and made a complete mess of it. 

I like the idea of having a rowing boat (canoe or kayak) to sail rivers, lakes and the sea/ocean, and will see if I can find a solution for SE, I hope with activators instead of magic effects.

Link to comment
Share on other sites

@DayDreamer: Understand. What are those attachment points? I will look again how beth did this and try to learn the part. Thank you for the hint.

@Altbert: I know these mods, but this is not the way I want to do that. From the description:

Quote

The boats are essentially rigged to a mountable cow with modified behaviors and skeletons to make them silent and motionless when not being ridden.  However, sometimes this trips up and the boat will start moving on its own, either running away or fighting enemies.  I'm trying to mitigate this, but it was an issue with the original mod too.

And they move over land. My boats stop moving with a crashing sound if there is an obstacle in the way, and then they get stuck. It's quite an effort to get them free again :)

I have to adjust the values of the swimming invisible actors in the scripts though, for each boat they are different, but mostly it works very reliable.

 

Link to comment
Share on other sites

I will re-install LE again and have a closer look into the various mods you mentioned. I will let you know when I find something.

EDIT: Re-installed LE and have taken a look at the mods. You're right about the script-free mods. Controls don't work properly, are very erratic and the moving over land is rediculous, although the "race" is only supposed to "swim", but it does so at water level and below. I really like the Gokstad approach for sailing, but not all the additions (fireball, raids, interior). 

Link to comment
Share on other sites

Oh, thanks a lot for your time. I experimented a lot with the ships model I want to use and with the script with the success that this ship is now translating sideways - hmmpff:crash: What I need to understand is, how TranslateTo exactly works, so I can determine the direction and rotation better. I messed around with the values and searched in the web for good informations, but unfortunately there is not much to find about it.

But I grabbed some informations more about the function SetVehicle and will try again this week - RL needs me these days, so it may take some time until I report back. :unsure:

Link to comment
Share on other sites

I haven't used the TranslateTo and TranslateToRef functions, but what I understand is that these functions are used to keep meshes at relative positions and rotations to each other while a mesh is moving. The Gokstad ship is not just one mesh, but uses a number of meshes, such as the ship, the oars, the sail and some others. When the ship moves at a certain speed in a certain direction, all related meshes should follow the movement of the ship, without it being too much noticeable. If you are sailing with the Gokstad ship at low speed (using the oars) you may notice that the furled sail would stay behind during a split second. When the ship is not moving you can find the X, Y and Z position and rotation values, and the same values for any other mesh, such as the oars. Differences between those values will give you the relative positions and rotations between the ship and other related meshes, which you can use for updates when the ship is moving. The more meshes are used and the shorter the update time, the more stress on the Papyrus VM. So, you will need to find an acceptable balance.

By the way, I'm retired, so time is not a problem. I like digging into these kind of issues, but certainly not 24/7! Glad to help, if it gives a nice new mod, preferably well balanced and eventually ported to SSE.

Link to comment
Share on other sites

Yes, I looked into the Gokstad ship and understand about the different meshes. But my ship is only one mesh, the doors are separate and are moved to my dummy cell, when player starts sailing and moved back when dropping the anchor, so they don't need to be translated with the ship. I figured out the values to position them perfectly. I'm satisfied with furled sails, when player drops the anchor, and that works fine. So it's not too much stress on the VM.

I found out that the value FrontOffset in the script is responsible for the angle the boat translates. It needs to be 90, I changed it to 200 in my tests, so boat translated sidewards. One issue solved :)

I also discovered, that it is crucial to use the IdleStoolEnterPlayer animation for the player, despite the idle doesn't play. SetVehicle alone doesn't work. And it is also crucial to position the ship with the right rotation in the worldspace, then player gets attached right. Afterwards the position is adjusted automatically. I found the right values for the player translation. It's not perfect, player may move a bit forward or backward from his position, sometimes through the mast, that's not so nice but not too troublesome. Don't know if it's possible to prevent that. Yay, it works :dancing:

I added a ladder to the ship, so player can climb from water onto the ship, but script is not ready, yet.

Now I need to know how I can make a door activator that teleports every follower to the interior and out of the interior. I think, I will need a formlist for the followers and the script should check if a follower is in Current Follower Faction or waiting. Player can enter the interior, but inside is no door activator to get him out. The doors are linked properly, but I guess that desn't work because the doors are moved. Did I overlook something?

 

 

 

 

Link to comment
Share on other sites

You have probably used a regular door with those yellow markers. Instead use a door as an activator and attach a script to move the player to a position on the ship after activating the door with the OnActivate event. The yellow door markers cannot be positioned other than by rotating the marker and using the F-key to position the marker at ground level if above. You can move the door, but once you have configured the teleport the doormarkers cannot be moved away from their editor location. For followers you will have to do something similar, but conditionally, for instance when the anchor is raised or lowered.

Link to comment
Share on other sites

I needed two days to get that to work. :frantics:

I now have a ship that teleports the player on deck, if he swims along the hull. The doors are now activators, they teleport the player inside the cabins and back out. Player can sail, drop anchor and sails. I'm not satisfied with the player translation. When driving angles player leaves the place in front of the wheel and moves sidewards to the hull, if you drive straight ahead, he moves back but behind the wheel. It's nothing gamebreaking, but a bit annoying. I played around with the translation values, maybe I should reduce the speed of the ship, this might help.

Now I must find out, how to move followers in. I looked at certain scripts, especially at that from DLC2, when player travels to Solstheim and followers are with him. Until now it's way too complicated for me to understand... but I'm learning. :cool: I hope I can advance my activator script.

Link to comment
Share on other sites

Congrats with the results sofar!

The problem with the player moving around when sailing may have to do with update timing. Maybe reduce the speed of the ship or decrease the update timing. The type of ship you are using (medieval) has a speed of 4 to 6 knots, which is about 6 to 9 mph. The Gokstad author seems to refer to a speed of 200 ingame units and an update timing of 0.1.

Link to comment
Share on other sites

The fastest possible update is 1 per graphics frame. At 60 fps, that's 0.017. But in reality, there are plenty of other things running updates, so you won't get an event call. In my testing, you are lucky to get 2 to 3 events per second.

Sadly, i'm not much help with nifs, and none at all with animation. Years ago, we figured out how to fix weapon mounting attachment points for weapon racks. But I've not even installed the nif tools on this machine in 5 years, and never had animation tools.

Link to comment
Share on other sites

Thank you both. I figured out that the x and y axis values for the player translation must be exactly the same. Now player stays mostly where he should, only slightly shifting, but I think, that's fine now. This big ship is more difficult to handle compared to the lightweight ones, and that's pretty alright.

I'm currently working on the cabin interior, and that is really hard to do. None of the cabin's walls or floors are straight and it's totally difficult to find fitting models. I added a lot of drawers, under the bed, in the desk, in my custom created board, and everyone is animated. I will focus on hanging pieces: baskets, nets, bird cage, windy things. That makes quite a nice atmosphere. I post some screenshots under my album.

When it's done, I will navmesh the room and than get back to get followers on board. I don't know yet, how the script must look like to teleport them with the player through an activator. And of course they will not be able to move on deck, what's quite annoying. Beth has the solution to dock the ship at a certain place, so the navmesh is in the right position. When the ship starts sailing, navmesh is cut off through a collision box and followers are stowed away, until player reaches Solstheim. Maybe I will make fixed landing points and do it the same way, but that's a lot of work to do. Every suggestion is welcome :nerd: And thanks for sticking with me :run::beer:

Link to comment
Share on other sites

Update:

I reworked the light sources. The candles made me headaches. If you have more than one together, the flickering may be pain. And the candlelight is way too bright for my taste. Took me a while to figure out how to change that. I use my own texture now and changed the flames to a warmer, more realistic color. The candles are now beautiful red :wub:.

I added two boxes under my selfmade board for more storage. Four birds are hanging in the nets under the ceiling. The board is now filled with clutter. There is a mirror above the towels. And I created and added some nice paintings. :rolleyes: There is now an animated trapdoor that links to the basement.

Last night I fought with weapon plaques. These damn things refused to work. Either I could'nt activate them or they won't hold my weapons :crash: Until I realised, that the game stopped updating my stuff accordingly :wallbash: That was four hours later! :swear: :(. After a newstart of my PC everything worked fine. I guess there was a Daedra in the back who fooled me and had fun the whole night :bat:.

I spend a lot of hours to find the right components to clutter up my room, to stay with my chosen style and make it attractive and cozy. I now need to fill the baskets and add some minor things, some idle markers and such things. Maybe I will add activators for changing the table or such things, but that is low in priority, yet.

I updated the gallery, in case you want to take a look at it :nerd:

Link to comment
Share on other sites

:celebration:

Thank you! There is a ton of stuff in that room, but it still looks like having a lot of empty space, lol! :rofl:

Link to comment
Share on other sites

  • 2 weeks later...

Now I have a serious problem, I can't figure out, why that happens :wallbash:

I added a load door to my basement and linked it to a custom trap door at Whiterun Watchtower, just for testing. I can use the trap door and have been teleported into the ship's basement. But I can't use the door in the basement: there is no activator.

In ck the links work perfectly, but in my ship interior, no door marker appears. What, by the nine, is that??? I tried to use another door. I tried to link to a door in my worldspace. I deleted all doors, saved the plugin, cleaned it with XEdit, created the doors again. Same result. Why can't I teleport out of my interior?

I'm relly experienced with creating doors and link cells together. But here I'm completely lost. Any suggestion is very much appreciated. :wave:

Solved!!!

I tried farmhousedoorl01 and noticed, that the activation was behind the door. I used tcl to go through the door and suddenly the activation appeared. Behind the door. ??? I pulled the door more inside the room and that worked. That worked also with my shipdoor. This is weird, because there is no visible obstacle in the way, if I push the door fitting into the doorframe. Alright, I guess the reason is the interior model of the ship. It has other obstacles which make it very tricky for npcs to move around. Navmeshing was pain. There are outstanding planks and the gratings on the floor are raised a bit above the floor, so I had to put the navmesh slightly above those obstacles to prevent npcs for getting stuck. Like on a ship - there's not much space for moving around.

Thank you for the hint, Hanaisse! :unworthy:

Link to comment
Share on other sites

Unable to respond after nearly a month without internet, but today it has been restored to a 1Gb fiber connection. As for you last problem, I'm somewhat lost too. You have a trapdoor on deck and a load door below deck, actually what you call basement, which is not part of the ship itself. I presume you mean both doors are DOOR objects, and that you can't activate the door below deck. The only thing I can think of at the moment is the placement of the teleport marker, which may not be in line with the door. I had something similar once, when I placed the doors, configured the teleports and then moved one of the (trap) doors. After moving one of the doors the moved door and teleport marker were out of line. Could this be your problem?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...