Jump to content

I need advice and help with a script


Tasheni

Recommended Posts

Hey Altbert, thanks for your suggestions, read post above, I solved it.

It has nothing to do with the door marker. The marker only controls where player or npcs land after going through the door. The activation is controled by the door itself. I'm still confused, I placed so many doors and this was never a problem. But it works now, yay!

Now the interiors are nearly finished. I tested with my followers - all six! There is not much room to move and navmeshing was terrible, because the interior of the ship contains many obstacles: the grates and planks are raised above the floor and npcs got stuck. I raised the navmesh a bit to improve the moving and I guess now I can live with it.

So back to scripting. I need to move followers on board, and not just mine, every follower should be able to move inside.

I have the idea to duplicate the ship and place it in Skyrim at a dock, where I can put navmesh onto the ship's exterior. If you go inside, you could simulate the moving to Teia and after some time go on deck and be there. In Skyrim you could sail the ship as well as in Teia - though in Teia it's much more fun to sail ;) There is a way to cut the ship's exterior navmesh with a collision box. I must make sure the ship docks again at the same spot, so the navmesh would work again after docking.

But this is something for the next week, for now I will finalize the interiors. I guess there will be an update for Teia soon... :cop:

Link to comment
Share on other sites

@Altbert: A week without internet, that is really hard :coffee:

@all:

The interiors of the cabin and the basement are now finished. I tested yesterday with my followers. Look at the Gallery: https://www.afkmods.com/index.php?/gallery/album/149-tashenis-the-isles-of-teia/

I tested the hammocks with the mod GoToBed, but unfortunately that doesn't work for the player. NPCs go sleeping without problems. I don't know why the player can't use them.

At the other hand npcs are not able to use the stairs. I guess they are too steep, and the steps are not big enough. Nothing I can do about it, the stairs are fixed part of the interior model. I tried to put planks at each step to extend them, but that doesn't work. I placed the navmesh with a certain distance from the steps, that doesn't work, too.

My followers are clever (I did not tell them to do that!): They move magically through the ceiling to reach the loft :imp:. But they were not able to get down again. So I marked to navmesh triangle as a jump down point, and they jump down. Not always, sometimes they just vanish and spawn downstairs. But I can live with it. The loft is too cozy, so I can't live without it.

What I think is a real issue is, that the npcs do not use idle markers. I tested also with Jenassa (istalled AFT). They all do use the furniture markers for crafting, reading, sitting, sleeping, but not the sweep idle markers, not the drunk idle markers... they are allowed to use everything in their packages. Is there priority of using furniture markers over idle markers? Your suggestions are welcome.

:wave:

Link to comment
Share on other sites

Just some thoughts, nothing really solid yet. Idle markers are typically used by actors with a Sandbox package or as part of a Patrol package. A Default Master Package may have actors wander around and use idle markers. Since you are using a follower framework, you probably may have to create a quest for followers with a conditional Sandbox or Patrol package. Conditional to prevent followers showing the same behavior when outside the basement and/or loft. Never done anything with followers, I'm more of a "lone ranger".

Link to comment
Share on other sites

My followers own several sandbox packages with different behavior at inns, player homes and if the player unequips weapons and spells. These packages allow to use idle markers and special furniture. My followers use idle markers in player homes, and this ship is marked as a player home. So this can't be the reason. I also tried Jenassa with AFT installed. And she never used idle markers on the ship, but all furniture markers. Hm, I will look at other player homes and vanilla locations, I know that the mod Clearsky Hideout has everything scripted instead of using idle markers. If I'm right and there is a priority of furniture markers over idle markers, this would be very annoying.

Link to comment
Share on other sites

Update:

I created a dock at the side of the ship and navmeshed it. It took me a whole day to attach stairs to my ship's model in nifskope. I copied the NiTriShape of the Katariah Stairs and pasted it into my nif, but the collision didn't work. I was very close to smash my computer :crash:, but suddenly "ta ta!" :o it worked! the bhkConvexVerticesShape must be added to the bhkRigidBody as a list together with bhkMoppBvTriShape and the BSX flag must be additionally set to Bit 3 Complex. This did the job.

The ship's exterior is now navmeshed. Follower follow player on board. Player can set sail and sail away - my followers were not attached to the vehicle, but didn't fall through the ship. Of course they couldn't go anywhere. The navmesh is attached to the cell, not to the object. Player needs to navigate to the exact point the ship was docked before, then the navmesh is there and npcs can move around again. It's pretty difficult to navigate that big vessel to the exact point, but not impossible. When I create several of those small docks player can at least have his followers on deck while docked, what I find more immersive than just having them inside. Of course I would love to have them around on deck when I decide to stop anywhere, but that seems not to be possible.

Now I have another problem I was not aware of:

I use an activator to teleport from the ship's interior to a marker on the ship's exterior. Or from swimming in the water to teleport on deck. But follower won't teleport with player. So I used another script that teleports followers fine, as long as the activator and the target are in exterior cells. But it doesn't work, if I want to teleport from exterior to interior or from interior to exterior. The script uses FastTravel(), but I already read that this will not work for interiors. Unfortunately that's true.

Alternatively MoveTo() could be used, but how would the script look like to move followers, that are currently following? I can't use a formlist, because custom followers from other mods would not be included. That would work only for playerfollowerfaction or better, currentfollowerfaction, but I can't use MoveTo() on a faction :shrug:.

As always, your suggestions are welcome.

And another question: I'm searching for a good point in Skyrim to add a dock and a duplicate of my ship. I would like to use Solitude docks, but that is already covered by a lot of other ship mods. Windhelm is nice also. But unfortunately you can't sail to the cost and then westwards along the northern coast, maybe to Winterhold or farther to Dawnstar, you will get out of the map. I tried that once. So best would be somewhere between Northwatch Keep and Dawnstar, I guess. The mod Shumer has settlements at the coast I won't deal with (no time to make patches). So any ideas are welcome, too.

That's it for today. :wave:

 

 

 

Link to comment
Share on other sites

Perhaps placing a dock extending out from the west side of the spit of land that the Solitude Lighthouse stands on?  Here are some pics I just took to show where I mean (that spot where Etienne is standing):

image.thumb.jpeg.b61023d2d122b41de94a556427fe3093.jpeg

image.thumb.jpeg.5974da5a1406e2c85f8727a13ee309ac.jpeg

image.thumb.jpeg.7ac0bbad0b5007c1f31290c9de899957.jpeg

Link to comment
Share on other sites

Yes, I thought the same, but the ship is too big for this location, you will get stuck, if you try to sail.

But... I worked the whole night through. I placed the dock in front of Dawnstar a bit westwards . Navmeshed it and the duplicated ship. I duplicated the interiors and reworked the doors. And I sailed in Skyrim :celebration:

The caveeat is, that you have now practically two player ships. I first wanted to link the same interior to both ships, but load doors can't have two destinations. Everything looks the same, but the containers are others than on the other ship, means, if you put stuff in the Teia ship inside a chest, it's not there in the Skyrim ship. I would have to replace every single container with the same of the other ship :sick: and I'm not in the mood to do that incredible work. At least not now.

You can change between the two ships through a trapdoor in the basement. Followers follow you through every door.

But they can only go on deck if you are docked. And you must dock at the exact same point, so the ladders of the ship and the dock fit, because otherwise the navmesh won't work. This can become a challenge, but I managed it, so others will too, I hope.

There is another caveeat: The ship drives through rock models. It collides, if the ground is raised, so you can't move over land or those small headlands. But through rocks or the docks themselves. Nothing I can do about it.

And I decided to crowd the crowded Solitude a bit more. I will do another dock right in front of the big gates. As far as I know, the only free space :teehee:

I sailed there last night and it was fun for me to get that big ship manoevred through the tight space.

I will test a bit further now, if the doors spawn at the right places after sailing and such things, but I think it's done then :clap:

Thanks for all your help, you will go right into the credits list :)

Link to comment
Share on other sites

I've been off the grid for a couple of days. Read your last messages and was wondering about something. I don't know if you already have solved the caveats, but why create two exteriors and two interiors of the ship? You could do with one interior by using two doors in the interior and the exterior of the ship, enabling the ones needed and disabling the others, . As for the ship itself, couldn't you provide "auto-docking" when the ship is within range of a dock by say 50 or 100 ingame units? 

Link to comment
Share on other sites

Sorry for the late reply. I'm currently busy with looking for a new job. Today I had an offer I can't refuse. But I must start tomorrow. I will answer your question, but I have no time the next days.

Please be patient with me. :hug:

Link to comment
Share on other sites

1 hour ago, Tasheni said:

Sorry for the late reply. I'm currently busy with looking for a new job. Today I had an offer I can't refuse. But I must start tomorrow. I will answer your question, but I have no time the next days.

Please be patient with me. :hug:

Good luck with the new job, Tasheni!  And I hope that it ls all that you desire it to be.

Link to comment
Share on other sites

On 6/29/2022 at 12:57 AM, smr1957 said:

Good luck with the new job, Tasheni!  And I hope that it ls all that you desire it to be.

Thank you, but not even close. I work for an advocate now. I'm drowning in paper and notes and burocracy and I hate it. And it's fulltime. At least they pay well. But now my freetime is gone. Quote a nuisance. :shrug:

Link to comment
Share on other sites

Drowning in paper and notes is bad enough, but with bureaucracy added in - well OUCH!   Glad you are at least getting paid well, though not having any free time (or enough free time) to enjoy the fruits of your labor is no fun.  Well, I and many others, I'm sure, will just have to be patient and wait for when you can find some free time - after all, good things, and people, are worth waiting for.  

Link to comment
Share on other sites

8 minutes ago, Tasheni said:

Thank you so much for your kind words. Ihope I will be back soon.

The light is on, a comfy chair awaits, and a nice drink and snack will be brought over whenever you get back!

  • Like 2
  • Haha 1
Link to comment
Share on other sites

That sounds good for today. :celebration:For a few hours this day is mine. Should I go to my islands with my doggies and my followers and sail around a bit, or should I proceed with my mod? Everytime I start playing something is bothering me and then I go back to modding :imp:

@Altbert:

Quote

I don't know if you already have solved the caveats, but why create two exteriors and two interiors of the ship? You could do with one interior by using two doors in the interior and the exterior of the ship, enabling the ones needed and disabling the others

I was under time pressure. It was the easiest and fastest way for me to do. From Interior, I would need an activator to enable or disable the doors. Yes, when I think about it, I know a mod who switches teleport locations. And followers follow through these portals. It's the mod Whiterun Mansion. I will put that on my to do list and change it, when I have the time. Then I could spare at least one interior.

Quote

As for the ship itself, couldn't you provide "auto-docking" when the ship is within range of a dock by say 50 or 100 ingame units? 

That was my first thought, but I couldn't find out how to do that. I looked at Windhelm docks and Solstheim to see how bethesda did this. I fear, this is beyond my scope. Maybe somebody can explain to me, how that works? I guess, this will not work very good with followers - they are stored away with an extremely complicated script during the first travel to Solstheim and spawn after the ship has docked. Hm, otherwise I find it not too hard to sail the ship at the exact point on the docks, yes, it's a bit tricky, but it's more realistic. You need to practice a bit to handle that ship well, but after some time you will be successfull. And it's only for the navmesh. If you sail alone, you can dock wherever and however you want. And if nothing else works, you can summon your followers if you are under deck. This is essential, because the followers are not attached to the vehicle while sailing, so it could happen that they fall into the water. It happend very rarely to me.

 

I will put the update online soon as a WIP, because I think it's immersive for others to play it, even if it has it's caveeats. When I find the time, I will improve it. Huch, I'm always so eager to get my stuff out to get all your congratulations and critics - this is a big, big motivation to proceed. :teehee:

Link to comment
Share on other sites

Update:

I have now only the cabin and the basement interior cells, no duplicates anymore. Both ships uses now the same interior. I attached a script to the exterior doors that works nice:

Import Game
ObjectReference Property InteriorTeleMarker01 Auto
 
 
AUTO STATE WaitingPlayer
EVENT OnActivate(ObjectReference akActionRef)
    If (akActionRef == GetPlayer())
        GoToState("Working")
        GetPlayer().MoveTo(InteriorTeleMarker01)
        EnableFastTravel()
        FastTravel(InteriorTeleMarker01)
        GoToState("WaitingPlayer")
EndIf
ENDEVENT
ENDSTATE
 
STATE Working
ENDSTATE

Followers are teleported inside with the player.

In the interiors, I use two activators: One for exiting to Skyrim, one for exiting to Teia. Script is the same. Player is teleported to every marker, but not the followers :angry:

What do I have to do to get any follower player might have out of interior and near the player, without using load doors? I can't find a solution :cry:

After testing with four followers together with me I can say that this doesn't work solid. Sometimes only one follower teleports with me, sometimes three or none of them.

Link to comment
Share on other sites

I always thought that navmesh is attached to the cell. If I sail my ship away, navmesh stays where it was created.

Looks like that is wrong. I sailed away and stopped in another cell. My ship should have no navmesh now. But my followers follow me around onboard. Isn't it weird? :lmao:

Link to comment
Share on other sites

Problem solved!!! :banana:

I had help from maxarturo. There was a problem with my followers and I made an awkward mistake in the main script of the ship.

Now I tested with Jenassa and AFT installed. The doors work fine, as long as the ship is docked, ship is navmeshed and followers go in and out like expected. If ship is somewhere on the ocean and not docked, there is no navmesh, so followers can't leave the interior.

Works perfectly in Teia and in Skyrim. I sailed from Dawnstar to castle Volkihar, with a stop in Solitude, where I docked the ship, and Jenassa followed me outside and off board, then back onboard and I sailed on. This is so cool :imp:

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...