Rescue HQ - The Tycoon

Rescue HQ - The Tycoon

Multi Sandbox Mod
MaFooBar 31 May, 2019 @ 8:23am
Fix for "Items still break"
I think this code should work. Put it into Scenario.Modifications.
// iterate over all items for item in Def.SmartObject |> Seq.toArray do // see if it's a broken version if item.ID.EndsWith("Broken") then // get unbroken id let unbrokenId = item.ID.Substring(0, item.ID.Length - "Broken".Length) // update the unbroken item Def.Item.Update unbrokenId (fun x -> {x with // override all events Events = [ // and only return the unbroken equipment When.Emergency.Done [Hq.Storage.Create unbrokenId 1] ] } )

But actually it's kind of a hack. Because all the items have only the storage create events attached and it's not possible to filter the events by name or anything right now... (might be a nice addition though ^^)
< >
Showing 1-7 of 7 comments
nDeavor  [developer] 31 May, 2019 @ 9:00am 
That works perfectly. Thanks! Update will be uploaded shortly
MaFooBar 31 May, 2019 @ 9:04am 
woot woot
nDeavor  [developer] 31 May, 2019 @ 11:57am 
Actually after testing it looks like this is not working as expected. Riot gear still breaks.
nDeavor  [developer] 31 May, 2019 @ 1:03pm 
As a workaround I used this for now

let autoRepair = for smartObject in Def.SmartObject |> Seq.toArray do match smartObject.Type with // is it a station? | Some (:? StationObjectDef as v) -> // update defintion Def.SmartObject.Update smartObject.ID (fun x -> {x with Type = SmartObjectType.Station {v with ProcessingTime = Gt.hours 0.0 AutoActivate = Yes } }) // no -> ignore | _ -> ()
MaFooBar 1 Jun, 2019 @ 5:07am 
Hm.. interesting.
FYI, your code will set ALL station cycles to 0. Maybe ideal for sandbox mode ^^
Last edited by MaFooBar; 1 Jun, 2019 @ 5:07am
nDeavor  [developer] 1 Jun, 2019 @ 3:57pm 
Originally posted by MaFooBar:
Hm.. interesting.
FYI, your code will set ALL station cycles to 0. Maybe ideal for sandbox mode ^^

I added
if v.InputSlots.Length > 0 then
to only check for stations that have input slots as otherwise the hiring desk was going crazy and instantly hired thousands of recruits :D
MaFooBar 2 Jun, 2019 @ 1:16am 
haha World War A-pplicant
Last edited by MaFooBar; 2 Jun, 2019 @ 1:20am
< >
Showing 1-7 of 7 comments
Per page: 1530 50