Rescue HQ - The Tycoon

Rescue HQ - The Tycoon

Multi Sandbox Mod
MaFooBar 2019 年 5 月 31 日 上午 8:23
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 ^^)
< >
正在显示第 1 - 7 条,共 7 条留言
nDeavor  [开发者] 2019 年 5 月 31 日 上午 9:00 
That works perfectly. Thanks! Update will be uploaded shortly
MaFooBar 2019 年 5 月 31 日 上午 9:04 
woot woot
nDeavor  [开发者] 2019 年 5 月 31 日 上午 11:57 
Actually after testing it looks like this is not working as expected. Riot gear still breaks.
nDeavor  [开发者] 2019 年 5 月 31 日 下午 1:03 
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 2019 年 6 月 1 日 上午 5:07 
Hm.. interesting.
FYI, your code will set ALL station cycles to 0. Maybe ideal for sandbox mode ^^
最后由 MaFooBar 编辑于; 2019 年 6 月 1 日 上午 5:07
nDeavor  [开发者] 2019 年 6 月 1 日 下午 3:57 
引用自 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 2019 年 6 月 2 日 上午 1:16 
haha World War A-pplicant
最后由 MaFooBar 编辑于; 2019 年 6 月 2 日 上午 1:20
< >
正在显示第 1 - 7 条,共 7 条留言
每页显示数: 1530 50