• We have updated our Community Code of Conduct. Please read through the new rules for the forum that are an integral part of Paradox Interactive’s User Agreement.

CheTranqui

Corporal
30 Badges
Mar 9, 2018
45
2
  • Age of Wonders: Planetfall
  • Cities: Skylines - Snowfall
  • Hearts of Iron IV: Cadet
  • Pillars of Eternity
  • Europa Universalis III: Collection
  • Cities: Skylines
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Leviathans Story Pack
  • Cities: Skylines - Natural Disasters
  • Surviving Mars
  • Stellaris: Apocalypse
  • Stellaris: Distant Stars
  • Stellaris: Megacorp
  • Stellaris: Ancient Relics
  • Stellaris - Path to Destruction bundle
  • Stellaris: Synthetic Dawn
  • Magicka 2
  • Stellaris
  • Cities in Motion 2
  • Semper Fi
  • Majesty 2 Collection
  • Heir to the Throne
  • Hearts of Iron III Collection
  • Hearts of Iron III: Their Finest Hour
  • Hearts of Iron III
  • For the Motherland
  • Divine Wind
  • Europa Universalis III
  • Crusader Kings II: The Old Gods
  • Crusader Kings II
Turns out that while there's an awful lot of documentation, some things have gone unstated. Particularly how to interact with the UI and the main assets file paths.

Several that I've encountered so far:
1. Notification Icons (dimensions).
2. Popup window customization (of picture and size).
3. UI modification (Infopanels, build menu, icons, etc).
Add to the list so they know where to focus their efforts! What are you trying to accomplish that after hours of searching, you were unable to find?

((I'll aim to maintain this first post as an up-to-date list of requests that do not have an answer provided. Notes from other posts are below. Last updated March 19th.))

  • Nationalities for custom sponsor
  • All technologies and what they do (so you can modify them, give them to custom sponsors, etc)
  • How to create a new resource and how to generate them as a deposit on the map
  • How to reenable console commands (so we don't need to use third-party cheats for testing purposes)
  • Where to find SolarPanel class (or, say, one for Art Workshop building) and info on its methods/functionality, like that GetProductivityPenalty hook
 
Last edited:
I'm trying to find some of the constants. For example, the Yogscast mod seems to modify TravelTimeEarthMars and TravelTimeMarsEarth but I can't seem to find the documentation for those constants.

I'm also having a hard time finding how ot edit sponsor research contributions.
 
I'm trying to find some of the constants. For example, the Yogscast mod seems to modify TravelTimeEarthMars and TravelTimeMarsEarth but I can't seem to find the documentation for those constants.

I'm also having a hard time finding how ot edit sponsor research contributions.

You can do this 2 ways. One way it will effect all sponsors/commander and one way will effect only the sponsor/commander you want to change.

1st way that effects all sponsors/commander is to go add a gamevalue entry in the mod editor in your mod. Then while having Gameplay as Category, when you check ID you can see TravelTimeEarthMars and TravelTimeMarsEarth. Sometimes it bugs out and doesn't really change categories if you do more then one. Just close that mod editor window and reopen and it is fixed at least for me.

2nd way is to go to

function Game Apply(self, city)


under your sponsor/commander you want to add and enter something like

CreateLabelModifier("SCSponsorResearch", "Consts", "SponsorResearch", 900, 0)

The important part here is to change the SponsorResearch part to the thing you want to change and select a unique name where it says SCSponsorResearch. If you are unsure what something might be just use the first option to learn the id and then use that. The first numeric value is just straight for the value you want to add, the second numeric value is percentage based if you wanted to change it say per percentage.
 
• Nationalities for custom sponsor
• All technologies and what they do (so you can modify them, give them to custom sponsors, etc)
• How to create a new resource and how to generate them as a deposit on the map
• How to reenable console commands (so we don't need to use third-party cheats for testing)
 
  • Some generated docs on currently used CObjects and their Lua wrappers, at least parts can be open to public there, e.g. something like https://wiki.factorio.com/Data.raw

For example, "Shadowed Panels" sample code hooks into the game by overriding SolarPanel.GetProductivityPenalty.
Supposing that one wants to do something similar - where to find SolarPanel class (or, say, one for Art Workshop building) and info its current methods/functionality, like that GetProductivityPenalty hook?
 
Updated original post to include specific items declared missing.

Thanks.

Though between decompiled Lua sources and interactive console allowing for easy introspection, my suggestion became obsolete.
Existing docs do a decent job at describing general concepts, Lua code shows how all base stuff is implemented (e.g. how that "GetProductivityPenalty" works), looking at _G (lua globals) and filtering that has all class names and such (like mentioned SolarPanel class), and using Map Enumeration methods (described in docs) can get specific in-game instances (e.g. specific solar panel to tweak), with easy way to dump all info on each object to file (from console or mod code).
Maybe would be still easier with official docs, but assuming limited dev resources, probably shouldn't be any kind of priority.
Though Mark Watney mentioned same thing too, so it's not just my suggestion at this point.
 
Hey, maybe you all will find this useful in modding:
http://www88.zippyshare.com/v/kf900df3/file.html
Included inside are decompiled "Data" "Lua" hpk's from game. Unfortunately with some errors still present.

Note that there's better decompilation from unluac (vs luadec that was used in link above) - no errors all over the place there, and better indentation/layout:
https://cdn.discordapp.com/attachments/425368555190747136/425415773276733471/Lua.hpk.decompiled.7z

All credit for that goes to Waywocket on Surviving Mars Modders discord (there should be a thread about it with invite in this forum section), with py script and instructions on how to produce it pinned in #resources there.
 
You can do this 2 ways. One way it will effect all sponsors/commander and one way will effect only the sponsor/commander you want to change.

1st way that effects all sponsors/commander is to go add a gamevalue entry in the mod editor in your mod. Then while having Gameplay as Category, when you check ID you can see TravelTimeEarthMars and TravelTimeMarsEarth. Sometimes it bugs out and doesn't really change categories if you do more then one. Just close that mod editor window and reopen and it is fixed at least for me.

2nd way is to go to

function Game Apply(self, city)


under your sponsor/commander you want to add and enter something like

CreateLabelModifier("SCSponsorResearch", "Consts", "SponsorResearch", 900, 0)

The important part here is to change the SponsorResearch part to the thing you want to change and select a unique name where it says SCSponsorResearch. If you are unsure what something might be just use the first option to learn the id and then use that. The first numeric value is just straight for the value you want to add, the second numeric value is percentage based if you wanted to change it say per percentage.

To change stuff in your sponsor the right way you have to edit your mod's lua file.
Code:
PlaceObj('ModItemMissionSponsor', {
    'name', "SpaceX",
    'display_name', T{801235285272, --[[ModItemMissionSponsor SpaceX display_name]] "SpaceX"},
    'challenge_mod', 40,
    'funding', 8000,
    'cargo', 70000,
    'initial_rockets', 3,
    ...
}, {
    PlaceObj('TechEffect_ModifyLabel', {
        'Label', "Consts",
        'Prop', "SponsorResearch",
        'Amount', 1000,
    }),
    PlaceObj('TechEffect_ModifyLabel', {
        'Label', "Consts",
        'Prop', "FoodPerRocketPassenger",
        'Percent', 100,
    }),
})

In the 'effect' field you then write: "Research per Sol: <research(SponsorResearch)>" to show the SponsorResearch value.

By editing this file manually you have to restart Surviving Mars. The mod tool will then make your MissionSponsor a tree-view with editable items where you also can find other properties that can be modified.

I don't understand why they shipped the modding tool without a button to create these TechEffect's, becaues editing them works perfectly!