Jump to content

Scripting Help for Settlement System


alexnidhogg

Recommended Posts

I'm looking for help from someone who's figured out how the scripting in this game works.

 

I'm trying to make a minor change to the script "workshopparentscript", but I don't want to modify the actual script itself. All I want to do is change 1 value. I could modify the script, but that would make this mod incompatible with anything else that modifies this script.

 

Specifically, is there a way to change the value on line 607?

 

; happiness modifier when an actor dies
float actorDeathHappinessModifier = -20.0 const
It's labeled as a const, which as far as I can tell is not accessible outside this script.
Is there any way to modify this value to 0 from an external source, or will I have to replace this script?
Any help would be greatly appreciated.
Thanks,
Alex
Link to comment
Share on other sites

Theres no way to externally modify that float value from what I can see

 

That doesnt mean it cant be done though, you could just jury rig a fix

You could listen for actor death the same way WorkshopParent does, and when an actor dies you could modify happiness by +20, thatll net a happiness change of 0

Link to comment
Share on other sites

As far as i can see, the actorDeathHappinessModifier is only used by a function HandleActorDeath() (line 1173). Thus it should be possible to write a script which extends workshopparent.

Scriptname myExtenderScript extends WorkshopParentScript

function HandleActorDeath(WorkShopNPCScript deadActor, Actor akKiller)
    ; get actor's workshop
    WorkshopScript workshopRef = GetWorkshop(deadActor.GetWorkshopID())

    UnassignActor(deadActor, true)
endfunction

This should override the original function. It doesn't modify happiness. (Not tested, though :whistling: )

Link to comment
Share on other sites

  • Recently Browsing   0 members

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