Jump to content

Recommended Posts

Convoy System [BETA]

View File

Overview:

 

This mod allows you to define destination locations in any place in the game world and then create prisoner convoys which will travel to the location of your choice. Players can use this mod via simple UIExtension menus. Modders have additional possibility to skip the frontend and talk directly to the controllers using the API.

 

The convoy moves in a linear fashion, one guard in the front, one optional guard in the end, any number of prisoners.

 

Usage for players:

 

You should have two spells available:

  1. BRCS Location Spell - location management.
  2. BRCS Convoy Spell - convoy management.

 

Menus:

 

You can always go to the previous menu by using the TAB key.

 

Location management:

 

You can create new location at current player position using the "Add new location here" option. "Manage locations" option allows you to display and remove locations. DO NOT REMOVE LOCATIONS WHICH ARE ASSIGNED TO THE EXISTING CONVOYS.

 

Convoy management - creation:

 

By using "Add new convoy" option you can create new convoy. This should be easy enough, just know that:

  • NPC selection works by finding all NPCs around you which are in the specific radius and are not already assigned to anything related to this mod.
  • The Guard is optional.
  • You can remove prisoners by clicking on their records.

 

After confirmation the convoy will be created and formed. This means that NPCs are going to go to the leader and form a convoy (kind of, for now).

 

Convoy management:

 

By using "Manage convoys" option you can see the list of all your convoys and their actual state:

  • created - the convoy is created and ready.
  • travel - the convoy is travelling.
  • arrived - the convoy reached it's destination.

 

From there you can click specific record to:

  • Start your convoy trip.
  • Start your convoy trip with prisoners keeping their hands behind their heads.
  • Activate tracking your convoy on the map. You can track up to 10 convoys at once. On the map you will see the marker with the label in format "Convoy: <LeaderName>". This is because I couldn't find a way to display the convoy's name.
  • Show information about your convoy.
  • Destroy the convoy. This should restore all NPCs state to the state they had before creating the convoy.

 

After reaching destination NPCs will be just standing there and waiting for your decision what to do next. You need to destroy the convoy to restore their original AI packages. This is probably the only reasonable thing you can do.

 

Configuration:

 

You can configure nearby NPC scanning radius in the console:

 

set BRCS_Var_ScanRadius to 1280

 

Setting this to 0 should disable radius limit and allow to display all NPCs in the loaded area. In general 128 is the one actor height. 1280 is the default.

 

Usage for modders:

 

First you should add this ESP as a master to your plugin using SSEEdit. After that you should be able to create the following properties in your scripts:

 

BRCS_Controller Property Controller Auto
BRCS_ControllerLocation Property ControllerLocation Auto

 

Location controller:

 

The most important function here is:

 

Function RegisterLocation(String name, ObjectReference ref)

 

This allows you to create new location at any ObjectReference.

 

Function CreateLocationAtMe(String name)

 

This will create an XMarker at current player position and call RegisterLocation on it.

 

Function RemoveLocation(String name)

 

ObjectReference Function GetLocationRef(String name)

 

You can use this to map location name to it's ObjectReference.

 

Int Function GetLocations()

 

Int locations = ControllerLocation.GetLocations()
String locName = JMap.nextKey(locations)
While locName
    Int location = JMap.getObj(locations, locName)
    ObjectReference ref = JMap.getForm(location, "ref") As ObjectReference

    locName = JMap.nextKey(locations, locName)
EndWhile

 

This returns JMap which is the container for the locations.

 

Convoy controller:

 

Function CreateConvoy(String name, Actor leader, Int prisoners, String locName, Actor guard = None)

 

Int prisoners = JArray.object()
JArray.addForm(prisoners, someActor)
Controller.CreateConvoy("MyConvoy", someActor, prisoners, "MyRegisteredLocName", someActor)

 

This will create new convoy. This means that NPCs are going to go to the leader and form a convoy (kind of, for now).

 

Note: After calling JArray.object() the array is going to exist for about 10 seconds and then it's going to be garbage collected. Therefor you should call CreateConvoy() quickly after calling JArray.object().

 

Function StartConvoy(String name, Bool handsBehindHead = True)

 

Call this to start the trip.

 

Bool Function TrackConvoy(String name)

 

Function UntrackConvoy(String name)

 

Anytime you can start/stop convoy tracking. The limit is 10 convoys in the same time. TrackConvoy() will return False if you try to track more.

 

Function DestroyConvoy(String name)

 

Use this anytime to destroy the convoy. This should restore all NPCs state to the state they had before convoy creation.

 

Bool Function IsActorAssigned(ObjectReference ref)

 

This function allows you to check if the actor is already a part of any convoy.

 

Event OnInit()
    RegisterForModEvent("BRCS_ConvoyArrive", "OnConvoyArrive")
EndEvent

Event OnConvoyArrive(String name)
    Debug.MessageBox("Convoy arrived!")
EndEvent

 

After arrival SKSE event is emitted. If you are going to use this mechanism remember to read the notes from wiki: RegisterForModEvent - Form - the CreationKit Wiki (uesp.net)

 

Int Function GetConvoys()

 

Int convoys = Controller.GetConvoys()
String convoyName = JMap.nextKey(convoys)
While convoyName
    Debug.Notification(convoyName)
    convoyName = JMap.nextKey(convoys, convoyName)
EndWhile

 

Returns JMap which is the container for the convoys. Mostly useful to iterate over the names.

 

Int Function GetConvoy(String name)

 

Int convoy = Controller.GetConvoy(name)

String status = JMap.getStr(convoy, "status")                 ; See available statuses in player section.
Actor leader = JMap.getForm(convoy, "leader") As Actor
Int prisoners = JMap.getObj(convoy, "prisoners")
Actor guard = JMap.getForm(convoy, "guard") As Actor
String locName = JMap.getStr(convoy, "locName")
Int handsBehindHead = JMap.getInt(convoy, "handsBehindHead")  ; 0 - False, 1 - True.
Int trackId = JMap.getInt(convoy, "trackId")                  ; -1 - not tracked, > -1 - tracking alias ID.

 

Returns JMap which is the container for the specific convoy. You can use this to get convoy information.

 

Permissions:

 

Any non-commercial usage is allowed.


  • Submitter
  • Submitted
    04/06/2024
  • Category
  • Requires
    FNIS, powerofthree's Papyrus Extender, PapyrusUtil, UIExtensions, JContainers
  • Regular Edition Compatible
    No

 

Link to comment

@Caligula Big I'm glad you like this mod. I saw hydra's slave girls mod briefly few months ago and probably thanks to this I came up with the idea of creating this mod. However I have no idea on how to integrate the two together. But I'm always open if you have an specific idea on how it could look like.

Link to comment

That's weird, spells are added when controller quest runs for the first time, as far as I know this should always work. Are you sure the mod is up and running? Try using for example in the console:

 

sqv brcs_controller

 

and check if it returns an error or not.

Link to comment
42 minutes ago, BrightRider said:

That's weird, spells are added when controller quest runs for the first time, as far as I know this should always work. Are you sure the mod is up and running? Try using for example in the console:

 

sqv brcs_controller

 

and check if it returns an error or not.

Yeah the mod is up and running in my load order, i have all the requirements like UI extensions installed.

 

I'll give it a go tonight and see if that shows up on console

 

get back to you soon

Link to comment

So I tried that command and it did return an error like I did not have the mod installed 🙃

 

I have to add that I’m on skyrim vr - but that shouldn’t prevent the mod from loading, right?

 

UIEctensions and every other requirement is installed like papyrus etc.

 

and the mod is active in my load order 🤷‍♂️ 

Link to comment

I see potential in a mod such as this. Especially if you can appoint your followers as guards. But the idea of manually destroying the convoy could be better if there was also an option set up conditions for this to happen automatically. Maybe setting up a convoy could be something like: Go to the jail in Whiterun, offload prisoners, collect bounties, return to base. Set up after defeating a bandit camp to escort the bandits smart enough to surrender. The next step would then be to actually have the bandits in the jail awaiting processing. Punishments could range from fines, floggings to execution depending on the severity of their crimes. However this processing part would probably be another mod entirely.

 

Maybe the prisoners are not actually prisoners sometimes but people that are guarded for their own safety? Imagine finding an npc on the way to somewhere and you know that the chance that said individual live to get there is slim and you could appoint a follower or two to guard them.

 

The military could do this to drag new recruits to a garrison to be outfitted and trained. Or they could BE training. Imagine a caravan where they are more like running as an exercise "guarded" by a nasty drill Sargent. 

Link to comment

@sweforce thank you for interesting ideas on how to expand this mod. However my idea was to create something rather generic and flexible, something like a framework usable in many different scenarios. Your idea from the first part of your post is rather specific and for me it looks rather like an idea for another mod which is based on this (which could be interesting, however for now I don't have enough time for mod creation unfortunately).

 

About escorting not only the prisoners, I strongly considered that, but finally I decided to not go in this direction and focus on prisoner convoys. The reason was that I decided that I'm going to implement more features in the future which are prisoner specific.

 

@83ilotzent when it comes to Skyrim VR I must admin that I have no experience at all. It's hard to say for me what could happen. I have no possibility to test this mod for VR and check if it's working or not. I have only one idea. If you have no DLCs or Update.esm this could be a problem because I added them as required masters (which was useless in fact) so I just removed them. You can install new version and check.

Link to comment

Ok so unfortunately it still wont show up in-game mid-save.

 

Really bummed out, because I was suppose to base my playthrough with this mod when it came out :classic_sad:

 

I guess this isn't compatible with VR or my game is borked.

Link to comment

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
  • Recently Browsing   0 members

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

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more information, see our Privacy Policy & Terms of Use