Jump to content

[WIP] Bond of Friendship


Selene310187

Recommended Posts

 

The project began initially as a spell that added the "Automatic Calm" ability to an actor. The actor in question will stop any hostility due to friendly fire towards actors, who have the ability as well, and the player. I expanded the project with further ideas to make travelling with followers more comfortable.

 

What the "Bond of Friendship" lesser power can do so far:

(it was a spell first and now it's a lesser power, see the spoiler below the list)

  • give the target an "Automatic Calm" ability
  • modify the friendly hits setting of the target (ignore friendly hits/not ignore friendly hits) 
  • make the target an ally
  • give the target increased health and fortify its healing rate
  • make the target immortal/mortal
  • Automatic Teleport: teleport the target to you automatically if it has fallen behind


Outdated information:

Spoiler

At this point, there's one spell that manages one actor and assigns the actor to the actor manager of Bond of Friendship (up to 10 actors can be assigned), and the other spell manages all nearby actors who are assigned to the actor manager. However, I want to combine both spells and turn them into a lesser power instead (state: done).

Updated information (July 9, 2023): I combined both spells into a lesser power

 

How I imagine the handling of the planned lesser power:

If the player casts this lesser power and has his weapon drawn (works with unarmed fighting stance as well), the lesser power casts a spell where the player is pointing at. If the target is an actor that isn't assigned and if there's one free actor slot available at least, the assign menu of the actor manager will open. The menu with the features opens as soon as the actor is assigned to the actor manager (up to 10 actors can be assigned). You will then be able to decide whether you apply a feature to the target or all assigned actors. When the lesser power is casted while the player hasn't any weapon drawn, the menu where the features are applied to all actors only is shown (as there is no target).

 

Today, I managed to create a test lesser power (delivery: self) that casts a test spell on the target (delivery: aimed) but only after I assigned a projectile to the Magic Effect of the aimed spell (I have chosen an empty projectile so you can't see the projectile when the lesser power/spell is casted).

 

 

Technical details for those who are interested:

Spoiler

There's a quest with 10 Reference Aliases (Fill Type: Specific Reference pointing at nothing, Flags: Optional, Allow Disabled, Allow Reserved, Stores Text, Uses Stored Text). The target of the spell is forced to an empty ReferenceAlias with ForceRefTo. I assigend all Reference Aliases to the script as an array. The reference of the target is passed to functions containing while loops which cycle through this array and if the reference of the target matches the reference of the ReferenceAlias, the functions make changes to the target. An int property keeps track of the available actor slots which has a default value of 10 (the property is set to Auto Conditional <- very important for the "communication" between scripts*). If an actor is assigned to a ReferenceAlias, the variable is decreased by one. Clearing the ReferenceAlias increases the variable by one freeing up one actor slot at the time.

* I experienced a "bug" with values of variables that aren't passed from one script to the other while I playtested one of my other mods with Skyrim AE (I had no problems with Skyrim pre-AE). After I set the properties in question to Auto Conditional, I could solve the bug. I'm not sure if it's really a bug because of this:

Quote

Conditional: (Auto properties only) Flags the hidden variable of an auto property to be visible to the condition system. The script must also have the conditional flag.

Source

 

Misc feature: Debug Utility 

The other idea I got today was creating a debug utility to debug assigned actors (state: in progress). You could debug their AI and animation that got stuck or make them visible again if they became invisible due to a bug for example. The debug utility will probably be a separate spell or lesser power (I haven't quite decided yet).

 

If you have an idea that goes well with the mod, please don't hesitate to post it in this thread. :)

Edited by Selene310187
  • Thanks 2
Link to comment
Share on other sites

The more features I added or plan to add, the more it became clear that's a good idea to a have a menu structure that is as flat as possible (who wants to click through a menu with more than two or three levels?). That's why I plan to create three lesser powers:

 

"Bond of Friendship"

(works with non-followers, too; exception: the Automatic Teleport feature is for followers only)

(state: done)

The features I mentioned at the beginning of the first post

Casting with weapon drawn and pointing to the target: assign target to the actor manager of Bond of Friendship, apply features to the target (or all assigned actors)

Casting with sheathed weapon: apply features to all assigned actors

 

"Bond of Friendship -  Debug Utility"

(works with non-followers, too)

(state: done) 

Debug actions*: Disable/Enable, NEW: Get Up! (when the actor is stuck crawling on the ground), Reset AI, Recycle Actor, Reset Inventory, Move To Me

* some of the actions require SKSE (Reset Inventory) and ConsoleUtilSSE (Reset AI, Recycle Actor)

Casting with weapon drawn: debugging the current target of the lesser power (the target doesn't have to be assigned to the actor manager)

Casting with sheathed weapon: navigate with the slot buttons (First Slot, Next Slot, Previous Slot and Last Slot) to the assigned actor of your choice and execute the debug actions ("> Actions"). This is useful if you lost track of the actor (action: "Move To Me") or if the actor became invisible while travelling somehow (action: "Disable/Enable")

 

"Bond of Friendship - Requests"

(works with followers only)

(all features except "Outfit" can only be used by followers)

(state: planned)

Requests when casting with weapon drawn (current target): Talk, Wait/Follow, Favor, Inventory, NEW: Outfit

Requests when casting with sheathed weapon (all assigned followers): Wait/Follow, Meeting Point** (with the possibility to set and remove a meeting point anywhere and teleporting yourself and/or your followers to the meeting point and back again)

** I will use the teleporting mechanics of DFB - Dimensional Rift Home as reference

 

Edited by Selene310187
  • Thanks 2
Link to comment
Share on other sites

I don't know how much you are aware of the struggles I experience during the development of mods. I tend to work through many sleepless nights and inflating the project with too many ideas, until I'm too exhausted, loose motivation and put the project in question on ice indefinitely which happened to Better Untold Legends Rewards recently. This time I’m trying to do it differently. Some days I don't work on the project and play the game for the sake of playing for example (at the moment, I'm discovering the world of Chanterelle). Other days I'm just doing research on the internet (e.g. Creation Kit wiki), thinking of ways to improve things that are integrated already or what features could be useful as well. I don't immediately implement the new ideas. It's very likely that I got a "better" idea some days later and discard the other idea or put it aside, e.g. the possibility to set a meeting point replaced the idea of building a dimensional hideout for all companions. I may revisit discarded ideas/ideas that I put aside in future versions.

 

Currently, my priority is creating a test version which covers most of the collected ideas. So you can take a first look, try things out and find possible bugs, which I will fix in the next test version and gradually I will expand the test versions with new features until the release of version 1.0. Because there are just too many unknown parameters, especially in combination with other mods. Since I generally play with few mods, I'm not always aware of the complications that can arise.

Edited by Selene310187
Link to comment
Share on other sites

Info update on the debug utility lesser power

The selection of the actor slots including the display of the slot number and the name of the assigned actor is working:

20230724192925_1.thumb.jpg.d2121736cc762eb2a6c912d6ac6c7298.jpg

If a slot is not occupied or has been cleared, a function causes the hint "Empty Slot" to appear next to "Assigned Actor":

20230724192934_1.thumb.jpg.48d4facafda83ad3cc90ad0bbcfecde5.jpg

 

Technical Details:

Spoiler

If the player uses the debug utility lesser power for the first time, the slot number 1 is shown at default. Before the menu appears, the function CheckCurrentSlot checks whether the corresponding Reference Alias is filled, and, if this condition is met, the reference of this Reference Alias is assigned to the Reference Alias "BondOfFriendshipSlotCurrent" with ForceRefTo.

The part of the menu text with the slot number and the name of the assigned actor looks like this in the Creation Kit:

Quote

Actor Slot No.: [%.0f]
Assigned Actor: <Alias=BondOfFriendshipSlotCurrent>

To ensure that the correct number and name is shown, the quest, which contains the Reference Alias and the variables, needs to be assigned to the message (drop-down list next to "Quest Owner").

Script snippet of the debug utility lesser power:

Scriptname BondOfFriendshipDebugUtilityAOE extends activemagiceffect

BondOfFriendshipActorManager Property ActorManager Auto
; [...]

elseif ActorManager.ActorSlots < 10
            ActorManager.CheckCurrentSlot()
            ActorManager.DebugActorsMenu()
endif

Script snippet of the Actor Manager quest:

Scriptname BondOfFriendshipActorManager extends Quest Conditional

Message Property BondOfFriendshipMenuDebugActorsAOE Auto
ReferenceAlias[] Property ActorSlotsAlias Auto ; an array containing all actor slot Reference Aliases
Int Property ActorSlots Auto Conditional ; default value: 10
Int Property CurrentSlot Auto Conditional ; default value: 1
Int Property i Auto Conditional ; default value: 0
ObjectReference Property EmptySlot Auto



Function CheckCurrentSlot()
    int iElement = ActorSlotsAlias.Length ; Length or amount of the elements of the array (there are 10)
    int iIndex = i

    While iIndex < iElement
        if ActorSlotsAlias[iIndex].GetReference()
            BondOfFriendshipSlotCurrent.ForceRefTo(ActorSlotsAlias[iIndex].GetActorRef())
            iIndex = 999
        else
; It is very important to clear the ReferenceAlias BondOfFriendshipSlotCurrent at this point, otherwise the hint "Empty Slot" will not be displayed
; By the way, the reference EmptySlot is an item with the name "Empty Slot", which is located in an unreachable cell
; The reference alias flag "Stores Text" stores the name of the item and the "Uses Stored Text" flag allows using the name as a text replacement 
; e.g. in message or book texts
; more about Text Replacement: https://www.creationkit.com/index.php?title=Text_Replacement
            BondOfFriendshipSlotCurrent.Clear()
            BondOfFriendshipSlotCurrent.ForceRefTo(EmptySlot)
            iIndex = 999
        endif
        iIndex += 1
    EndWhile
EndFunction


Function DebugActorsMenu()
    int button = BondOfFriendshipMenuDebugActorsAOE.Show(CurrentSlot)
    ; the %.0f in the text of the message is replaced with the value of the variable CurrentSlot
    ; further information: https://www.creationkit.com/index.php?title=Show_-_Message

    if button == 0 ; First Slot
        i = 0
        CurrentSlot = 1
        CheckCurrentSlot()
        DebugActorsMenu()
    elseif button == 1 ; Next Slot
        i += 1
        CurrentSlot = i + 1
        if i > 9
            i = 0
            CurrentSlot = 1
        endif
        CheckCurrentSlot()
        DebugActorsMenu()
    elseif button == 2 ; Previous Slot
        i -= 1
        CurrentSlot = i + 1
        if i < 0
            i = 9
            CurrentSlot = i + 1
        endif
        CheckCurrentSlot()
        DebugActorsMenu()
    elseif button == 3 ; Last Slot
        i = 9
        CurrentSlot = i + 1
        CheckCurrentSlot()  
        DebugActorsMenu()
    elseif button == 4 ; > Actions
        DebugActionsMenu()  
    endif  
EndFunction

 

 

Edited by Selene310187
Link to comment
Share on other sites

  • 3 weeks later...

In the last couple of weeks, I explored the idea of an outfit management system which will be part of the "Bond of Friendship - Requests" lesser power in the future (this feature will be available to non-followers, too). At the moment, it's a separate test plugin where I exercised working with arrays. Before that, I used FormLists to organize and store stuff. I wanted to know if could achieve the same thing with arrays because arrays are faster than FormLists. Furthermore, I don't use the SetOutfit command due to its permanent effect on the NPC (the command overwrites the default outfit; I know that there's a workaround with SKSE but don't want to rely on it too much because not all users use it). I use EquipItem and RemoveItem (with the option to move the item to the container/inventory of the NPC) in combination with the arrays instead.

On top of that, there's the possibility to unequip and re-equip head gear items of NPCs (like the helmet of guards, the circlet that some of the Jarls wear, or the head gear items that are added by the player for example). And you can have a look at the assigned items of each outfit slot anytime by clicking on the "Show Item List" button (requires SKSE) or on the "Container" button (no SKSE required).

 

How the outfit management system works:

The player opens a remote container, places armor items into it and the container script adds the forms of the items to an array (Event OnItemAdded in the container script). When the container is closed (or after clicking on the Equip button in the menu), the items are transferred to the NPC and the ReferenceAlias script of the NPC iterates through the array to equip the listed items. If the container is opened again, the apparel items are transferred back to container according to the item list in the array. So the player can remove items from the container or add new items to change the item list.

Due to its very experimental and unfinished state (only one NPC slot and one outfit slot are supported currently as I need only one of them to test the concept), the outfit management system will not come with the first test version of Bond of Friendship. 

 

Here are some teaser images of the outfit management system:

20230815001701_1.thumb.jpg.eaff7e554368d09a54d13ba5172a914d.jpg20230814233233_1.thumb.jpg.1bf4a344d86e3b1524662a093e4c341c.jpg20230814233013_1.thumb.jpg.f0af450b7c107424f74aaed7651740c1.jpg

20230814231747_1.thumb.jpg.d7abd3ce8cd637023d04c33a8b2ff17f.jpg20230815000831_1.thumb.jpg.f6310ceb27a95e5f0a6e3e31316bc020.jpg

 

 

If you want to learn more about arrays, the YouTuber Skyrim Scripting created a very insightful video:

 

Edited by Selene310187
Link to comment
Share on other sites

I finished the second lesser power, "Bond of Friendship - Debug Utility" and added the feature "Get Up!" to it on top.

There's a bug in the game where the actor is stuck crawling on the ground:

Quote

A follower may not leave the recovery state even when their health is fully replenished but instead continue crawling around on the floor.
This can be fixed by entering combat again with a new enemy, attacking them, fast-traveling to a new area, reloading a save, or healing them with a Restoration spell. The Unrelenting Force Shout or casting Paralyze on them sometimes works as well.

Source: https://en.uesp.net/wiki/Skyrim:Followers#Bugs

Applying the "Get Up!" feature unstucks the actor. It adds a stagger effect to the target just like the Unrelenting Force Shout does, and restores its health and limbs. 

Edited by Selene310187
Link to comment
Share on other sites

  • 4 weeks later...

I want to let you know that I will give my full attention to Starfield for now and take a break from the mod project. If I continue to work on the project instead right now, Starfield will still be in the back of my mind distracting me which interferes with my creative process. Furthermore, I want to be part of the Starfield community where I share my experience with this new game and the discoveries I made with others and converse about various Starfield related topics. That way I can come back to the project with a fresh mind.

Edited by Selene310187
  • Like 2
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...