Since 23.40, the Verse API changed and caused many errors in existing code. Now I cannot open projects without UEFN crashing instantly.
Edit:
After some trial and error; I’ve narrowed it down to this snippet:
Something in here causes the compiler to crash UEFN to desktop!
SpawnPlayerTreasure()<suspends>:void=
for ( i := 1 ..PlayerTreasureSpawnAmount){
Logger.Print("Spawning new player treasure {i}!")
if(Tycoon.Debugging?){Print("Spawning new player treasure {i}!", ?Duration := 10.0)}
#Randomise Agent 1 Treasure Spot
set Player1_TreasureSpots = Shuffle(Player1_TreasureSpots);if {set CurrentTreasure = Player1_TreasureSpots[0]}
CurrentTreasure.ShowProps();CurrentTreasure.RestockResources()
#Randomise Agent 2 Treasure Spot
set Player2_TreasureSpots = Shuffle(Player2_TreasureSpots);if {set CurrentTreasure = Player2_TreasureSpots[0]}
CurrentTreasure.ShowProps();CurrentTreasure.RestockResources()
#Randomise Agent 3 Treasure Spot
set Player3_TreasureSpots = Shuffle(Player3_TreasureSpots);if {set CurrentTreasure = Player3_TreasureSpots[0]}
CurrentTreasure.ShowProps();CurrentTreasure.RestockResources()
#Randomise Agent 4 Treasure Spot
set Player4_TreasureSpots = Shuffle(Player4_TreasureSpots);if {set CurrentTreasure = Player4_TreasureSpots[0]}
CurrentTreasure.ShowProps();CurrentTreasure.RestockResources()
#Sleep
}
Sleep(TreasureSpawnRate)
SpawnPlayerTreasure()
BeginDayNightCycle():void={
set DayNightCinematics = Shuffle(DayNightCinematics)
if {set CurrentDayNightCinematic = DayNightCinematics[0]}
CurrentDayNightCinematic.Play()
Logger.Print("New Day!");if(Tycoon.Debugging?){Print("New Day!", ?Duration := 10.0)}
}
HandleFlowerHarvesting(Agent:agent):void={FlowerSwitch.TurnOn(Agent); FlowerQuestTracker.IncrementProgress(Agent)}
HandleBoneCollection(Agent:agent):void={BoneSwitch.TurnOn(Agent)}
HandleGoldPickUp(Agent:agent):void={QuestGoldCollect.IncrementProgress(Agent)}
HandleTreasureChestLoot(Agent:agent):void={
HUDOpenChest.Show(option{Agent})
RandL:int = GetRandomInt( 3, 6 )
Print("{RandL} Treasure Generated")
for ( i := 1 ..RandL){ TreasureChestLootGranter.CycleToRandomItem(Agent)} }
HandleSmallLoot(Agent:agent):void={
HUDOpenChest.Show(option{Agent})
RandL:int = GetRandomInt( 0, 2 )
if (RandL > 0 ){for ( i := 1 ..RandL){SmallLootGranter.CycleToRandomItem(Agent)}}
else {SearchNothingTrigger.Trigger(Agent)}
}
HandleLanternPlacement(Agent:agent):void={
LanternQuestTracker.IncrementProgress(Agent);Print("Lantern Lit!")
LanternBoneGranter.GrantItem(Agent)
HUDLightFire.Show(option{Agent})
}
HandleFlyerPlacement(Agent:agent):void={FlyerQuestTracker.IncrementProgress(Agent);Print("Placed Flyer!");HUDPaperClick.Show(option{Agent})}
HandleTravelArea(Agent:agent):void={ <#Nothing Yet#> }
CompleteWoodSwitch(Agent:agent):void={WoodSwitch.TurnOn(Agent)}
PlayDepletion(Agent:agent):void={HUDDepletion.Show(option{Agent})}
PlayFoliage(Agent:agent):void={HUDFoliage.Show(option{Agent})}
SpawnWorldTreasure()<suspends>:void=
#Randomise World Treasure Spots
for ( i := 1 ..WorldTreasureSpawnAmount){
if(Tycoon.Debugging?){Print("Spawning new world treasure {i}!", ?Duration := 10.0)}
set World_TreasureSpots = Shuffle(World_TreasureSpots);if {set CurrentTreasure = World_TreasureSpots[0]}
CurrentTreasure.ShowProps();CurrentTreasure.RestockResources()
}
SpawnWorldTreasureSingle(Agent:agent):void=
#Randomise World Treasure Spots
if(Tycoon.Debugging?){Print("Spawning new world treasure!", ?Duration := 10.0)}
set World_TreasureSpots = Shuffle(World_TreasureSpots);if {set CurrentTreasure = World_TreasureSpots[0]}
CurrentTreasure.ShowProps();CurrentTreasure.RestockResources()
SpawnFlowerTreasure()<suspends>:void=
#Randomise World Flower Spots
for ( i := 1 ..WorldFlowerSpawnAmount){
if(Tycoon.Debugging?){Print("Spawning new flowers {i}!", ?Duration := 10.0)}
set World_FlowersSpots = Shuffle(World_FlowersSpots);if {set CurrentTreasure = World_FlowersSpots[0]}
CurrentTreasure.ShowProps();CurrentTreasure.RestockResources()
}
SpawnFlowerTreasureSingle(Agent:agent):void=
#Randomise Spawn a Flower!
if(Tycoon.Debugging?){Print("Spawning new flower!", ?Duration := 10.0)}
set World_FlowersSpots = Shuffle(World_FlowersSpots);if {set CurrentTreasure = World_FlowersSpots[0]}
CurrentTreasure.ShowProps();CurrentTreasure.RestockResources()
Runs when this creative_device is stopped or the game ends
OnEnd<override>():void=
Logger.Print("World device stopped!")