Jump to content

Mod Notes: RRS Adoption


DocClox

1,006 views

[ This is going to be some planning notes for Raider Reform School. It's unlikely to have much in the way of naughty pictures, and a lot in the way of programming talk. ]

 

The Raider Reform School is in may ways a pregnancy mod. The play is encouraged to keep a lot of slaves, and to keep them pregnant. The trouble is, that turns into babies, and thence to children, and that can overload the game engine very quickly.

 

So: I want a reaper. Or rather, in this case, an adoption mechanism.

 

  • Code should run daily, find all the settlement children, and disable them and mark them for removal with FPE
  • Needs to spare non-RRS kiddies, or at least non-FPE ones
  • Should be an option to spare player's own offspring
  • Needs to run whether the player visits or not. Otherwise a settlement could overload if the player neglects it for a while, and I don't want to force anyone to "do the rounds"
  • Maybe have a chance to adopt that rises with the number of kids in the settlement and the age of the kid
  • Maybe have a token you can give specific sproglings ("citizenship papers" maybe) that exempts them from adoption. So you can have a couple of the little sods grow up if you want.
  • Maybe preferentially adopt males over females. Probably needs to be MCM configurable
  • Want to remove them when the player isn't looking. Preferable when he isn't even in the location

 

I'm considering linking this to a settlement object you can place with the workshop

 

  • Probably use one of the static robobrains from the mechanist lair. SOE already has one, so I should be able to adapt that easy enough
  • Call it a RRS ... beacon? Administrator? Have to think about the name
  • Only settlements with a beacon get the adoption loop
  • Part of me wants to make this require science-1 and a wire link to a radio mast ... but I don't want to force people to play high-Int charaters, or build settler beacons. I could have an RRS mast to link in ... but it might be easier to just mashup a small radio mast into the robobrain object.
  • Considering having a Miss Nanny spawn from time to time and bimble around the settlement examining the kids - for no reason other than the fun of it. Maybe a reskin with the RRS logo. Probably more trouble than it's worth though.

 

image.png

 

There's a global list of workbenches accessible from WorkshopParentScript, and from a workshop I can get a list of NPS. Although if I use a Beacon, I can keep my own list of settlements. Might be faster than looping over all of them and looking for beacons. Although either would work. I can loop over workbenches, then loop over settlement NPCs and build a list of kids for that settlement. Also keep a track of how many were adopted and pay an Adoption fee to the settlement workbench. (I also want to pay something per-conception and per-birth, just to encourage players to maximise the number of pregnant raiders they maintain, but that'll have to wait on the next version of FPE).

 

What the hell, might as well give it a shot.'w'w

 

9 Comments


Recommended Comments

OK. So this is a bit of a bugger. The following is the header from WorkshopParentScript.psc

 

Scriptname WorkshopParentScript extends Quest Hidden Conditional
{parent workshop script to hold global data}

;/
General workshop documentation: http://institute.bethsoft.com/index.php?title=Workshop_Systems_Design

Overview:
* Workshops array is the master list of all workshops in the game. This is set up in the editor.
* Most workshop data is not stored here - in general, full data (actors, objects) is available only for the current (loaded) workshop
* For unloaded workshops, data is stored on the workshop's location using Keyword data.

The main things driving this script:
* Daily update - currently based on a 24-hour timer.
  Primary function:
        DailyWorkshopUpdate
                This loops through all the workshops in the Workshop array and updates them (production, consumption, happiness, repair, etc.)

* Building/Removing something - called by WorkshopScript when it receives the build/remove event
  Primary functions:
        BuildObjectPUBLIC
        RemoveObjectPUBLIC

* Reset current workshop data - when player arrives at a new workshop location, data is refreshed - workshop script only holds full data for a single workshop
  Primary function:
        ResetWorkshop

* Assign an actor to a workshop - currently done by test NPC spawner, or by daily update if the radio is "on"
  Primary function:
        CreateActorPUBLIC

* Assign an actor to a resource object/bed or caravan
  Primary functions:
        AssignActorToObjectPUBLIC
        AssignCaravanActorPUBLIC

* Random raider attacks can resolve off-screen if necessary
  Primary function:
        ResolveAttack
/;

Bad news is it looks like the actor info isn't present unless the workshop is loaded. Good news, perhaps, is that I might be able to do something with the dailyWorkshopUpdate loop, since there seem to be mechanisms for hooking into that. Worst case, I may have to run a quest for each location in the list, which sounds like a pain in the arse.

 

I suppose I should read the doumentation, since someone's been kind enough to leave a link pointing at it...

 

... of course, it would be nicer if the link sodding well resolved into something. Must point at an internat Bethesda wiki or something.

 

... and of course, the page doesn't exist on the creationkit.com wiki, which is sodding wonderful.

Link to comment

OK. So. Now that I know the player alias load game event is firing, let's make it do something.

 

Scriptname rrs:player_script extends ReferenceAlias
{Alias for OnGameLoad events}

Event OnPlayerLoadGame()
        Debug.OpenUserLog("rrs")
        debug.traceUser("rrs", "Game Load Event")

        quest q = Game.GetFormFromFile("Fallout4.esm", 0x2058e) as quest
        WorkshopParentScript workshops = q as WorkshopParentScript

        debug.notification("rrs: looping over workshops")
        int lim = workshops.workshops.length
        while idx > 0
                idx -= 1
                debug.traceUser("rrs", workshops.workshops[idx])
                debug.traceUser("rrs", workshops.WorkshopLocations[idx])
                debug.traceUser("rrs", "")
        endwhile
        debug.notification("rrs: workshops done")

        endwhile
EndEvent

Nothing very helpful happening there, but the output will test a few hypotheses

Link to comment

Also, I'm on a time limit here. I have kids all over my settlements. I only have so long before they grow to adults.

Link to comment

OK.. That gets me this:

 

[04/30/2020 - 11:53:56PM] rrs log opened (PC-64)
[04/30/2020 - 11:53:56PM] Game Load Event
[04/30/2020 - 11:53:57PM] [workshopscript < (0009B1D1)>]
[04/30/2020 - 11:53:57PM] [Location < (0009B1C2)>]
[04/30/2020 - 11:53:57PM] 
[04/30/2020 - 11:53:57PM] [workshopscript < (0009B18F)>]
[04/30/2020 - 11:53:57PM] [Location < (000482CF)>]
[04/30/2020 - 11:53:57PM] 
[04/30/2020 - 11:53:57PM] [workshopscript < (0009B1F1)>]
[04/30/2020 - 11:53:57PM] [Location < (0009B1C5)>]
[04/30/2020 - 11:53:57PM] 
[04/30/2020 - 11:53:57PM] [workshopscript < (00054BAE)>]
[04/30/2020 - 11:53:57PM] [Location < (00024FAB)>]

... and a lot more in the same vein. Like I said, not immediately useful, but at least it confirms I can iterate over the workshops like this. Let's see if I can get names out of those locations, and maybe filter the ones I don't own.

Link to comment

Bit of a tangent, but I've been making some compile tools for RRS. I had a bash script called "papc" for "Papyrus Compiler", but that needed to be edited each time I added an import folder. So I moved to python. This is papc.py:

 

#! /usr/bin/python3

import json, sys, os

with open("papc.json", "r") as fd:
        project = json.load(fd)
#print(json.dumps(project,indent=4))

try:
        input_file = sys.argv[1]
except:
        print("usage: papc.py input_file")
        print("")
        print("paths and import folders should be specified in papc.json")
        sys.exit(1)

command = '"{pcc}" "{input_file}" -f="{flags}" -i="{imports}"'.format(
        pcc = project["pcc"],
        input_file = sys.argv[1],

        # imports can be either absolute paths under the fallout\data folder
        # or relative to the current one, which can be anywhere
        imports = ";".join(project["imports"]),
        flags   = project["flags"]
)

#print(command)
rv = os.system(command)
sys.exit(rv)

That lets me define all the paths I need in a papc.json file:

 

{
        "dirs"  : {
                "game"  : "/cygdrive/e/steam/steamapps/common/Fallout 4/",
                "data"  : "/cygdrive/e/steam/steamapps/common/Fallout 4/Data/"
        },
        "pcc"   : "/cygdrive/e/steam/steamapps/common/Fallout 4/Papyrus Compiler/PapyrusCompiler.exe",
        "flags" : "E:\\steam\\steamapps\\common\\Fallout 4\\Data\\Scripts\\Source\\Base\\Institute_Papyrus_Flags.flg",
        "imports" : [
                "E:\\steam\\steamapps\\common\\Fallout 4\\Data\\Scripts\\Source\\User",
                "E:\\steam\\steamapps\\common\\Fallout 4\\Data\\Scripts\\Source\\Base",
                ".\\scripts\\source\\user"
        ]
}

The mix in path formats is because I'm working under cygwin on windows. Although, honestly, it would make more sense to use windows paths throughout now I think on it.

 

Anyway, that'll compile a single papyrus file, optionally in a sub-folder. I'm doing it this way because then I can write a makefile:

 

PCC="papc.py"
PEX= rrs/name_controller.pex rrs/player_script.pex rrs/pregswap.pex rrs/pregswap2.pex rrs/tattoo.pex

.SUFFIXES: .psc .pex

#
# compiler will interpret these as DOS paths. So that's what they need to be.
#

all: ${PEX}

.psc.pex:
        ${PCC} $*.psc

install:
        cp rrs/*.pex scripts
        cp rrs/*.psc scripts/source/user/rrs

And that'll build and install my scripts and all I need to do is keep the PEX list current.

 

[ I know, I know, probably you're thinking "but the Fo4 Papyrus compile already supports projects". Well it does, but their poorly documented, and I couldn't work out why they weren't working with my makefiles. This, I understand how it works, and if it breaks I can fix it. I did look at setting the whole thing up in Visual Studio, but honestly I'm much happier on the command line. ]

Link to comment

Revised code:

 

Event OnPlayerLoadGame()
        Debug.OpenUserLog("rrs")
        debug.traceUser("rrs", "Game Load Event")

        quest q = Game.GetFormFromFile(0x2058e, "Fallout4.esm") as quest
        WorkshopParentScript workshops = q as WorkshopParentScript

        debug.notification("rrs: looping over workshops")

        int idx = workshops.workshops.length
        while idx > 0
                idx -= 1
                do_shop( workshops.workshops[idx], workshops.WorkshopLocations[idx])
                debug.traceUser("rrs", "")
        endwhile
        debug.notification("rrs: workshops done")

EndEvent

function do_shop(WorkshopScript shop, Location loc)
        debug.traceUser("rrs", loc.getname())
        if shop == None
                debug.traceUser("rrs", "workshop is None!")
                return
        endif
        if !shop.OwnedByPlayer
                debug.traceUser("rrs", "Not our workshop")
                return
        endif
        debug.traceUser("rrs", "Workshop is ours")
endfunction

 

Basically getting the workshop name and checking for ownership. I moved the checking out to the do_shop function so I can return form the function early in lieu of a "continue" statement.

 

Output looks like this:

 

Spoiler

[05/01/2020 - 06:28:25AM] rrs log opened (PC-64)
[05/01/2020 - 06:28:25AM] Game Load Event
[05/01/2020 - 06:28:25AM] Oberland Station
[05/01/2020 - 06:28:25AM] Workshop is ours
[05/01/2020 - 06:28:25AM] 
[05/01/2020 - 06:28:25AM] Graygarden
[05/01/2020 - 06:28:25AM] Not our workshop
[05/01/2020 - 06:28:25AM] 
[05/01/2020 - 06:28:25AM] Greentop Nursery
[05/01/2020 - 06:28:25AM] Workshop is ours
[05/01/2020 - 06:28:25AM] 
[05/01/2020 - 06:28:25AM] Red Rocket Truck Stop
[05/01/2020 - 06:28:25AM] Workshop is ours
[05/01/2020 - 06:28:25AM] 
[05/01/2020 - 06:28:26AM] Tenpines Bluff
[05/01/2020 - 06:28:26AM] Not our workshop
[05/01/2020 - 06:28:26AM] 
[05/01/2020 - 06:28:26AM] Dalton Farm
[05/01/2020 - 06:28:26AM] Not our workshop
[05/01/2020 - 06:28:26AM] 
[05/01/2020 - 06:28:26AM] Visitors Center
[05/01/2020 - 06:28:26AM] Not our workshop
[05/01/2020 - 06:28:26AM] 
[05/01/2020 - 06:28:26AM] Bunker Hill
[05/01/2020 - 06:28:26AM] Not our workshop
[05/01/2020 - 06:28:26AM] 
[05/01/2020 - 06:28:26AM] The Mechanist's Lair
[05/01/2020 - 06:28:26AM] Workshop is ours
[05/01/2020 - 06:28:26AM] 
[05/01/2020 - 06:28:26AM] Croup Manor
[05/01/2020 - 06:28:26AM] Not our workshop
[05/01/2020 - 06:28:26AM] 
[05/01/2020 - 06:28:26AM] Boston Airport
[05/01/2020 - 06:28:26AM] Not our workshop
[05/01/2020 - 06:28:26AM] 
[05/01/2020 - 06:28:26AM] Warwick Homestead
[05/01/2020 - 06:28:26AM] Not our workshop
[05/01/2020 - 06:28:26AM] 
[05/01/2020 - 06:28:26AM] Sunshine Tidings Co-op
[05/01/2020 - 06:28:26AM] Workshop is ours
[05/01/2020 - 06:28:26AM] 
[05/01/2020 - 06:28:26AM] Egret Tours Marina
[05/01/2020 - 06:28:26AM] Not our workshop
[05/01/2020 - 06:28:26AM] 
[05/01/2020 - 06:28:26AM] Longfellow's Cabin
[05/01/2020 - 06:28:26AM] Not our workshop
[05/01/2020 - 06:28:26AM] 
[05/01/2020 - 06:28:26AM] The Slog
[05/01/2020 - 06:28:26AM] Not our workshop
[05/01/2020 - 06:28:26AM] 
[05/01/2020 - 06:28:26AM] Jamaica Plain
[05/01/2020 - 06:28:26AM] Not our workshop
[05/01/2020 - 06:28:26AM] 
[05/01/2020 - 06:28:26AM] County Crossing
[05/01/2020 - 06:28:26AM] Not our workshop
[05/01/2020 - 06:28:26AM] 
[05/01/2020 - 06:28:26AM] Covenant
[05/01/2020 - 06:28:26AM] Not our workshop
[05/01/2020 - 06:28:26AM] 
[05/01/2020 - 06:28:26AM] Finch Farm
[05/01/2020 - 06:28:26AM] Not our workshop
[05/01/2020 - 06:28:26AM] 
[05/01/2020 - 06:28:26AM] Sanctuary
[05/01/2020 - 06:28:26AM] Workshop is ours
[05/01/2020 - 06:28:26AM] 
[05/01/2020 - 06:28:26AM] Nordhagen Beach
[05/01/2020 - 06:28:26AM] Not our workshop
[05/01/2020 - 06:28:26AM] 
[05/01/2020 - 06:28:26AM] Echo Lake Lumber Mill
[05/01/2020 - 06:28:26AM] Not our workshop
[05/01/2020 - 06:28:26AM] 
[05/01/2020 - 06:28:26AM] 
[05/01/2020 - 06:28:26AM] Not our workshop
[05/01/2020 - 06:28:26AM] 
[05/01/2020 - 06:28:27AM] Spectacle Island
[05/01/2020 - 06:28:27AM] Not our workshop
[05/01/2020 - 06:28:27AM] 
[05/01/2020 - 06:28:27AM] Starlight Drive-In
[05/01/2020 - 06:28:27AM] Workshop is ours
[05/01/2020 - 06:28:27AM] 
[05/01/2020 - 06:28:27AM] The Castle
[05/01/2020 - 06:28:27AM] Not our workshop
[05/01/2020 - 06:28:27AM] 
[05/01/2020 - 06:28:27AM] Vault 88
[05/01/2020 - 06:28:27AM] Not our workshop
[05/01/2020 - 06:28:27AM] 
[05/01/2020 - 06:28:27AM] Coastal Cottage
[05/01/2020 - 06:28:27AM] Not our workshop
[05/01/2020 - 06:28:27AM] 
[05/01/2020 - 06:28:27AM] Outpost Zimonja
[05/01/2020 - 06:28:27AM] Workshop is ours
[05/01/2020 - 06:28:27AM] 
[05/01/2020 - 06:28:27AM] Murkwater Construction Site
[05/01/2020 - 06:28:27AM] Not our workshop
[05/01/2020 - 06:28:27AM] 
[05/01/2020 - 06:28:28AM] Somerville Place
[05/01/2020 - 06:28:28AM] Not our workshop
[05/01/2020 - 06:28:28AM] 
[05/01/2020 - 06:28:28AM] Kingsport Lighthouse
[05/01/2020 - 06:28:28AM] Not our workshop
[05/01/2020 - 06:28:28AM] 
[05/01/2020 - 06:28:28AM] Abernathy Farm
[05/01/2020 - 06:28:28AM] Workshop is ours
[05/01/2020 - 06:28:28AM] 
[05/01/2020 - 06:28:28AM] Hangman's Alley
[05/01/2020 - 06:28:28AM] Not our workshop
[05/01/2020 - 06:28:28AM] 
[05/01/2020 - 06:28:28AM] Nuka-World Red Rocket
[05/01/2020 - 06:28:28AM] Not our workshop
[05/01/2020 - 06:28:28AM] 
[05/01/2020 - 06:28:28AM] Taffington Boathouse
[05/01/2020 - 06:28:28AM] Not our workshop
[05/01/2020 - 06:28:28AM] 

 

 

Interesting things.

 

  • Both Red Rocket (normal settlement) and Oberland Station (raider settlement) show as owned. So I don't need two loops, but if I ever want to exclude one or the other, I'll need another test.
  • Echo Lake and Nuka World RR show up. So this pulls in DLC workbenches, and rpesumably any modded ones as well.
  • We don't see Home Plate there, so this is a settlement list and not a list of workbench objects.
  • There's an interesting one just after Echo Lake which doesn't have a name. Not sure what's going on there. Might be the Home Plate bench I suppose.

Anyway, nothing earth shattering there, but nice to confirm some assumptions.

 

Next up I need an actor list. I can try the obvious thing, but I don't think that's going to work, except possibly at my test location. We'll see.

Link to comment

I moved the WorkshopParent reference into a global rather than add in a new parameter. Otherwise all the changes are in do_shop:

 


function do_shop(WorkshopScript shop, Location loc)
        if shop == None
                debug.traceUser("rrs", "workshop is None!")
                return
        endif
        if !shop.OwnedByPlayer
                debug.traceUser("rrs", "Not our workshop")
                return
        endif
        debug.traceUser("rrs", loc.getname())
;
;       get actors
;
        ObjectReference[] list = workshop_parent.GetWorkshopActors(shop)
        int idx = list.length
        debug.traceUser("rrs", "" + idx + " actors")
;
;       loop over the list
;
        while idx > 0
                idx -= 1
                actor a = list[idx] as actor
                if a == None
                        debug.traceUser("rrs", "actor is None!")
                else
                        debug.traceUser("rrs", "Actor: " + a.getDisplayName())
                endif
        endwhile

endfunction

The result:

 

Spoiler


[05/01/2020 - 06:59:13AM] Red Rocket Truck Stop
[05/01/2020 - 06:59:13AM] 26 actors
[05/01/2020 - 06:59:13AM] Actor: Child
[05/01/2020 - 06:59:13AM] Actor: Child
[05/01/2020 - 06:59:13AM] Actor: Child
[05/01/2020 - 06:59:14AM] Actor: Child
[05/01/2020 - 06:59:14AM] Actor: Child
[05/01/2020 - 06:59:14AM] Actor: Child
[05/01/2020 - 06:59:14AM] Actor: Hired Gun
[05/01/2020 - 06:59:14AM] Actor: Legendary Raider
[05/01/2020 - 06:59:14AM] Actor: Raider Survivalist
[05/01/2020 - 06:59:14AM] Actor: raider
[05/01/2020 - 06:59:14AM] Actor: Raider Psycho
[05/01/2020 - 06:59:14AM] Actor: Nip-Nip
[05/01/2020 - 06:59:14AM] Actor: Babycakes
[05/01/2020 - 06:59:14AM] Actor: Raider Scavver
[05/01/2020 - 06:59:14AM] Actor: Raider Scavver
[05/01/2020 - 06:59:14AM] Actor: Raider Waster
[05/01/2020 - 06:59:14AM] Actor: Raider Scum
[05/01/2020 - 06:59:14AM] Actor: Raider Scum
[05/01/2020 - 06:59:14AM] Actor: Rust Devil
[05/01/2020 - 06:59:14AM] Actor: Raider Survivalist
[05/01/2020 - 06:59:14AM] Actor: Raider Scum
[05/01/2020 - 06:59:14AM] Actor: Raider Psycho
[05/01/2020 - 06:59:14AM] Actor: raider
[05/01/2020 - 06:59:14AM] Actor: Raider Scum
[05/01/2020 - 06:59:14AM] Actor: raider
[05/01/2020 - 06:59:14AM] Actor: raider
[05/01/2020 - 06:59:14AM] 

 

 

Doing the obvious thing worked! And if the refs are god enough to get DisplayNames for them, they'll probably be good enough to disable as well. Also, there's no sign of my followers in any setlement, which means we're actually getting settlement NPCs here and not just NPCs that happen to be in the settlement.

 

Next step is to cast them to FPFP_GrowingChildScript and see if I can winnow it down to the FPFP children. (I should really do the Sommerville Place quest and adopt the settlement, just so I can test that part.

Link to comment

So:

 

function do_shop(WorkshopScript shop, Location loc)
        int count = 0

        if shop == None
                debug.traceUser("rrs", "workshop is None!")
                return
        endif
        if !shop.OwnedByPlayer
                debug.traceUser("rrs", "Not our workshop")
                return
        endif
        debug.traceUser("rrs", loc.getname())
;
;       get actors
;
        ObjectReference[] list = workshop_parent.GetWorkshopActors(shop)
        int idx = list.length
        debug.traceUser("rrs", "" + idx + " actors")
;
;       loop over the list
;
        while idx > 0
                idx -= 1
                if do_actor(list[idx])
                        count += 1
                endif
        endwhile
        debug.traceUser("rrs", "" + count + " children at " + loc.getname())
endfunction

bool function do_actor(objectreference obj)
        actor a = obj as actor
        if a == None
                debug.traceUser("rrs", "reference is not an actor: " + obj)
                return false
        endif
        string name = a.getDisplayName()
        if a as FPFP_GrowingChildScript == None
                ; debug.traceUser("rrs", "actor "+name +" is not a FPE child")
                return false
        endif
        debug.traceUser("rrs", "FPE Child:  "+name)
        return true
endfunction

That seems to work, in that it gets all the FPR kids for each settlement. Looking at Sanctuary, you can see the scale of the problem:

 

[05/01/2020 - 09:08:47AM] Sanctuary
[05/01/2020 - 09:08:47AM] 48 actors
[05/01/2020 - 09:08:47AM] FPE Child:  Child
[05/01/2020 - 09:08:48AM] FPE Child:  Child
[05/01/2020 - 09:08:48AM] FPE Child:  Child
[05/01/2020 - 09:08:48AM] FPE Child:  Child
[05/01/2020 - 09:08:48AM] FPE Child:  Child
[05/01/2020 - 09:08:48AM] FPE Child:  Child
[05/01/2020 - 09:08:48AM] FPE Child:  Child
[05/01/2020 - 09:08:48AM] FPE Child:  Child
[05/01/2020 - 09:08:48AM] FPE Child:  Child
[05/01/2020 - 09:08:48AM] FPE Child:  Child
[05/01/2020 - 09:08:48AM] FPE Child:  Child
[05/01/2020 - 09:08:48AM] FPE Child:  Child
[05/01/2020 - 09:08:48AM] FPE Child:  Child
[05/01/2020 - 09:08:48AM] FPE Child:  Child
[05/01/2020 - 09:08:48AM] FPE Child:  Child
[05/01/2020 - 09:08:48AM] FPE Child:  Child
[05/01/2020 - 09:08:48AM] FPE Child:  Child
[05/01/2020 - 09:08:48AM] FPE Child:  Child
[05/01/2020 - 09:08:48AM] FPE Child:  Child
[05/01/2020 - 09:08:49AM] 19 children at Sanctuary

Nearly 50 workshop actors in Snactuary, and 40% of them are kids. With probably a similar number as either babies or pregnancies.

 

So now I need to cull them. I'd like to get a list of them, sort them by age and cull the oldest first, with a chance of culling based on age and number of kids. The aim is to have two or three kids running around the place, but not to let them grow to maturity. That said, for test purposes, I might just do a 50% per night chance.

Link to comment

So:

 

MiscObject property Caps001 auto

bool function do_actor(objectreference obj, WorkshopScript shop)
        actor a = obj as actor
        if a == None
                ; debug.traceUser("rrs", "reference is not an actor: " + obj)
                return false
        endif
        FPFP_GrowingChildScript child = a as FPFP_GrowingChildScript
        string name = a.getDisplayName()
        if child == None
                ; debug.traceUser("rrs", "actor "+name +" is not a FPE child")
                return false
        endif
;
;       reap % probably needs to be configurable
;
        if utility.randomFloat() > 0.6
                debug.traceUser("rrs", "Spared By RNG: " + name + " : " + child)
                return false
        endif

;
;       reap 'em
;
        debug.traceUser("rrs", "reaping: " + name + " : " + child)
        child.disable()
        child.startDelete()
;
;       pay the adoption fee
;
        shop.additem(Caps001, 100)

        debug.traceUser("rrs", "FPE Child:  "+name)
        return true
endfunction
             

60% chance reap rate, 100 caps per child adopted, FPE friendly deletion.

 

If this works, it needs to run in a sleep loop, rather than just being called every time the game loads. And then that will be that for this stage.

Link to comment
×
×
  • 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