Skip to content

Commit

Permalink
Mods:
Browse files Browse the repository at this point in the history
Fix Bugs 6.3:
Elevator func not checking for invalid resources (seen an error in an unrelated log file).
Stopped Tourist Gurus from happening (https://www.reddit.com/r/SurvivingMars/comments/1f178q0/how/)

Remove Unwanted Colonists 2.4:
Fixed stuck pods.

Underground Cheats 0.4:
Added mod option to pin rockets.

[email protected]
  • Loading branch information
ChoGGi committed Sep 2, 2024
1 parent 0905b1c commit 403d74b
Show file tree
Hide file tree
Showing 34 changed files with 146 additions and 76 deletions.
8 changes: 4 additions & 4 deletions Mods ChoGGi/Add Rivals/items.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
-- See LICENSE for terms

local properties = {
local mod_options = {
PlaceObj("ModItemOptionToggle", {
"name", "EnableMod",
"DisplayName", T(302535920011303, "<color ChoGGi_yellow>Enable Mod</color>"),
Expand Down Expand Up @@ -35,14 +35,14 @@ You might need to re-apply mod options after starting a couple new games.]]),
}),
}

local c = #properties
local c = #mod_options

local rivals = Presets.DumbAIDef.MissionSponsors
for i = 1, #rivals do
local rival = rivals[i]
if rival.id ~= "none" and rival.id ~= "random" then
c = c + 1
properties[c] = PlaceObj("ModItemOptionToggle", {
mod_options[c] = PlaceObj("ModItemOptionToggle", {
"name", rival.id,
"DisplayName", T(rival.display_name),
"Help", T(rival.description .. "<newline> If turned on this will be used as a rival instead of random (this will override Rival Amount)."),
Expand All @@ -51,4 +51,4 @@ for i = 1, #rivals do
end
end

return properties
return mod_options
2 changes: 1 addition & 1 deletion Mods ChoGGi/All Sponsor Buildings/items.lua
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ local PlaceObj = PlaceObj
local table = table

local mod_options = {}
local c = 0
local c = #mod_options

-- shown ame of tech
local techs = {
Expand Down
2 changes: 1 addition & 1 deletion Mods ChoGGi/Allow BB Buildings/items.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ local mod_options = {
"DefaultValue", true,
}),
}
local c = 1
local c = #mod_options

local BuildingTemplates = BuildingTemplates
for id, item in pairs(BuildingTemplates) do
Expand Down
2 changes: 1 addition & 1 deletion Mods ChoGGi/Autonomous Factories/items.lua
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ local mod_options = {
"StepSize", 10,
}),
}
local c = 1
local c = #mod_options

local g_Classes = g_Classes
local BuildingTemplates = BuildingTemplates
Expand Down
2 changes: 1 addition & 1 deletion Mods ChoGGi/Block Pets/items.lua
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ local mod_options = {
"MaxValue", 200,
}),
}
local c = 2
local c = #mod_options

local Animals = Animals
for id, def in pairs(Animals) do
Expand Down
2 changes: 1 addition & 1 deletion Mods ChoGGi/Bottomless Storage/items.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ local T = T
local table = table

local mod_options = {}
local c = 0
local c = #mod_options

local resources = table.icopy(UniversalStorageDepot.storable_resources)

Expand Down
2 changes: 1 addition & 1 deletion Mods ChoGGi/Change Lightmodel/items.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ local PlaceObj = PlaceObj
local T = T

local mod_options = {}
local c = 0
local c = #mod_options

local lightmodels = {
"Terraformed",
Expand Down
2 changes: 1 addition & 1 deletion Mods ChoGGi/Colonist Next Age/items.lua
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Set this and min to 0 to revert all colonist death ages to game default random v
}),
}

local c = 4
local c = #mod_options

local Colonist = Colonist
local ColonistAgeGroups = const.ColonistAgeGroups
Expand Down
2 changes: 1 addition & 1 deletion Mods ChoGGi/Constant Disasters/items.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
-- See LICENSE for terms

local properties = {}
local c = 0
local c = #mod_options
local disasters = {
ColdWaves = T(4148, "Cold Waves"),
DustStorms = T(4144, "Dust Storms"),
Expand Down
2 changes: 1 addition & 1 deletion Mods ChoGGi/Custom Resource Icon Toggle/items.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ local PlaceObj = PlaceObj
local T = T

local mod_options = {}
local c = 0
local c = #mod_options

-- skip instead of add for mod added ones
local skips = {
Expand Down
2 changes: 1 addition & 1 deletion Mods ChoGGi/Disable Disasters/items.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
-- See LICENSE for terms

local mod_options = {}
local c = 0
local c = #mod_options
local table = table

local disasters = {
Expand Down
99 changes: 66 additions & 33 deletions Mods ChoGGi/Fix Bugs/Code/Script.lua
Original file line number Diff line number Diff line change
Expand Up @@ -125,38 +125,6 @@ function OnMsg.SectorScanned()
end
--
function OnMsg.ClassesPostprocess()

-- Cargo presets are missing images for some buildings/all resources
local articles = Presets.EncyclopediaArticle.Resources
local lookup_res = {
PreciousMinerals = articles.ExoticMinerals.image,
Concrete = articles.Concrete.image,
Electronics = articles.Electronics.image,
Food = articles.Food.image,
Fuel = articles.Fuel.image,
MachineParts = articles["Mechanical Parts"].image,
Metals = articles.Metals.image,
Polymers = articles.Polymers.image,
PreciousMetals = articles["Rare Metals"].image,
Seeds = articles.Seeds.image,
-- Close enough
WasteRock = "UI/Messages/Tutorials/Tutorial1/Tutorial1_WasteRockConcreteDepot.tga",
}

local BuildingTemplates = BuildingTemplates
local CargoPreset = CargoPreset
for id, cargo in pairs(CargoPreset) do
if not cargo.icon then

if lookup_res[id] then
cargo.icon = lookup_res[id]
elseif BuildingTemplates[id] then
cargo.icon = BuildingTemplates[id].encyclopedia_image
end

end
end

-- Fix Colonist Daily Interest Loop
-- last checked 1011030 Colonist:EnterBuilding()
local ChoOrig_Colonist_EnterBuilding = Colonist.EnterBuilding
Expand Down Expand Up @@ -194,7 +162,44 @@ do -- CityStart/LoadGame
local ResupplyItemDefinitions = ResupplyItemDefinitions
local bt = BuildingTemplates
local main_realm = GetRealmByID(MainMapID)
local objs
local objs

--
-- I'm going out on a limb and saying tourist gurus are a bug.
TraitPresets.Guru.incompatible.Tourist = true
TraitPresets.Tourist.incompatible.Guru = true

--
-- Cargo presets are missing images for some buildings/all resources
local articles = Presets.EncyclopediaArticle.Resources
local lookup_res = {
PreciousMinerals = articles.ExoticMinerals.image,
Concrete = articles.Concrete.image,
Electronics = articles.Electronics.image,
Food = articles.Food.image,
Fuel = articles.Fuel.image,
MachineParts = articles["Mechanical Parts"].image,
Metals = articles.Metals.image,
Polymers = articles.Polymers.image,
PreciousMetals = articles["Rare Metals"].image,
Seeds = articles.Seeds.image,
-- Close enough
WasteRock = "UI/Messages/Tutorials/Tutorial1/Tutorial1_WasteRockConcreteDepot.tga",
}

local BuildingTemplates = BuildingTemplates
local CargoPreset = CargoPreset
for id, cargo in pairs(CargoPreset) do
if not cargo.icon then

if lookup_res[id] then
cargo.icon = lookup_res[id]
elseif BuildingTemplates[id] then
cargo.icon = BuildingTemplates[id].encyclopedia_image
end

end
end

--
-- See OnMsg.TechResearched below for more info about GeneForging
Expand Down Expand Up @@ -1194,6 +1199,34 @@ end
--
--
--
--

--
-- Why it doesn't check if the cargo resource exists is anyones guess.
-- Seen an error in a log file, no idea what it's from though.
local ChoOrig_Elevator_DeliverResource = Elevator.DeliverResource
function Elevator:DeliverResource(resource, ...)
if not mod_EnableMod then
return ChoOrig_Elevator_DeliverResource(self, resource, ...)
end

-- This is from the func, it can't hurt to have it happen, and it might hurt not to.
-- last checked lua rev 1011166
if not self.other.cargo[resource] then
self.other.cargo[resource] = {
class = resource,
requested = 0,
amount = 0
}
end

if not self.cargo[resource] then
return
end

return ChoOrig_Elevator_DeliverResource(self, resource, ...)
end

--
-- No flying drones underground
if g_AvailableDlc.gagarin then
Expand Down
4 changes: 3 additions & 1 deletion Mods ChoGGi/Fix Bugs/MoreInfo.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Problem updating supply grid.
Colonists on an expedition now show proper status when selected from command centre (instead of just unknown).
Added missing images for certain Cargo listings.
Gale crater name doesn't show up for 4S138E, 5S138E.
Stopped Tourist Gurus from happening.
Storybits:
Gene Forging storybit tech doesn't increase rare traits chance.
Expand All @@ -28,7 +29,8 @@ Marsgate blank transportation panel in CCC after a certain point in mystery.
St. Elmo's Fire: Stop meteoroids from destroying sinkholes.
The Philosopher's Stone Mystery doesn't update sector scanned count when paused.
B&B:
B&B
Elevator func not checking for invalid resources.
Colonists showing up on wrong map in infobar (also negative counts in infobar).
No flying drones underground (they tend to get stuck in walls/etc).
No Planetary Anomaly Breakthroughs when B&B is installed.
Expand Down
5 changes: 4 additions & 1 deletion Mods ChoGGi/Fix Bugs/changes.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
v6.3
Elevator func not checking for invalid resources (seen an error in an unrelated log file).
Stopped Tourist Gurus from happening (https://www.reddit.com/r/SurvivingMars/comments/1f178q0/how/)

v6.2
Added my Pins Missing Some Status Icons mod.


v6.1
Added missing images for Cargo listings.
Gale crater name doesn't show up for 4S138E, 5S138E (thanks a_pompous_fool).
Expand Down
4 changes: 2 additions & 2 deletions Mods ChoGGi/Fix Bugs/metadata.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ return PlaceObj("ModDef", {
"steam_id", "2721921772",
"pops_any_uuid", "3aff9cde-7dc1-4ad8-b38d-31a7568185ff",
"lua_revision", 1007000, -- Picard
"version", 62,
"version", 63,
"version_major", 6,
"version_minor", 2,
"version_minor", 3,
"image", "Preview.jpg",
"author", "ChoGGi",
"code", {
Expand Down
4 changes: 0 additions & 4 deletions Mods ChoGGi/Fix Bugs/todo.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
https://www.reddit.com/r/SurvivingMars/comments/1f178q0/how/
tourist gurus seem like a bug


condition = function(self)
return not IsGameRuleActive("NoPicard")
end,
Expand Down
2 changes: 1 addition & 1 deletion Mods ChoGGi/Game Rule Apocalypse Run/items.lua
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ local bits = {
}

local mod_options = {}
local c = 0
local c = #mod_options

local table = table
local PlaceObj = PlaceObj
Expand Down
3 changes: 2 additions & 1 deletion Mods ChoGGi/Notification Disable/items.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ local T = T

-- build sorted list of all notifications
local mod_options = {}
local c = 0
local c = #mod_options

local OnScreenNotificationPresets = OnScreenNotificationPresets
for id, item in pairs(OnScreenNotificationPresets) do
local priority
Expand Down
3 changes: 2 additions & 1 deletion Mods ChoGGi/Notification Pause/items.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ local T = T

-- build sorted list of all notifications
local mod_options = {}
local c = 0
local c = #mod_options

local OnScreenNotificationPresets = OnScreenNotificationPresets
for id, item in pairs(OnScreenNotificationPresets) do
local priority
Expand Down
2 changes: 1 addition & 1 deletion Mods ChoGGi/POI Spawn Rate/items.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ local table = table
local T = T

local mod_options = {}
local c = 0
local c = #mod_options

local POIPresets = POIPresets
for id, poi in pairs(POIPresets) do
Expand Down
2 changes: 1 addition & 1 deletion Mods ChoGGi/Photo Filter Toggle/items.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ local table = table
local T = T

local mod_options = {}
local c = 0
local c = #mod_options

-- add filters
local PhotoFilterPresetMap = PhotoFilterPresetMap
Expand Down
2 changes: 1 addition & 1 deletion Mods ChoGGi/Play All Mysteries/items.lua
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ You will lose all progress in current mystery and it may cause unexpected issues
"MaxValue", 100,
}),
}
local c = 6
local c = #mod_options

local mysteries = ClassDescendantsList("MysteryBase")
local g_Classes = g_Classes
Expand Down
9 changes: 6 additions & 3 deletions Mods ChoGGi/Remove Unwanted Colonists/Code/Script.lua
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,7 @@ DefineClass.MurderPod = {
leave_height = 1000 * guim,
hover_height = 30 * guim,
hover_height_orig = 30 * guim,
--~ min_hover_height = 10 * guim,
arrival_time = 10000,
min_pos_radius = 250 * guim,
max_pos_radius = 750 * guim,
Expand Down Expand Up @@ -468,9 +469,11 @@ function MurderPod:Leave(leave_height)
self.min_pos_radius,
self.city
)
local map = GetGameMap(self)
--~ leave_height = (map.terrain:GetHeight(current_pos) + leave_height) * 2
leave_height = (map.realm:SnapToTerrain(current_pos) + leave_height) * 2

leave_height = (
GetGameMap(self).realm:SnapToTerrain(current_pos):z() + leave_height
) * 2

self.hover_height = leave_height / 4

self.fx_actor_class = "SupplyRocket"
Expand Down
3 changes: 3 additions & 0 deletions Mods ChoGGi/Remove Unwanted Colonists/changes.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
v2.4
Fixed stuck pods.

v2.3
Fix so you can remove colonists from open-air passages and still be able to demo them.

Expand Down
2 changes: 1 addition & 1 deletion Mods ChoGGi/Remove Unwanted Colonists/items.lua
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ local mod_options = {
}),
}

local c = 4
local c = #mod_options

local table = table
local T = T
Expand Down
4 changes: 2 additions & 2 deletions Mods ChoGGi/Remove Unwanted Colonists/metadata.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ return PlaceObj("ModDef", {
"steam_id", "1594867237",
"pops_any_uuid", "fb8fc954-40d2-4818-b84f-157903c4ed36",
"lua_revision", 1007000, -- Picard
"version", 23,
"version", 24,
"version_major", 2,
"version_minor", 3,
"version_minor", 4,
"image", "Preview.jpg",
"author", "ChoGGi",
"code", {
Expand Down
Loading

0 comments on commit 403d74b

Please sign in to comment.