-
Posts
9 -
Joined
-
Last visited
Content Type
Profiles
Forums
Developer Articles
KSP2 Release Notes
Posts posted by cymon4380
-
-
Hello! I'm making a plugin and I've run into another problem. I want kerbals to turn into tourists if a player doesn't pay them a salary. How can I do this? Thank you for the answer
-
22 hours ago, HebaruSan said:
You can try what I suggested earlier:
That last link is sample code that does exactly this for one of my mods.
Thank you very much! It works! Now I can resume my mod development
-
55 minutes ago, HebaruSan said:
That's probably impossible to prevent, given that the user controls the computer where the code runs.
It's probably also a bad idea to try to prevent it. What user would keep using a mod that didn't allow them to play the way they wanted to?
Ok, I got it. Anyway, how can I know if the game was saved and then save mod settings into save file? And also load settings when loading save. Please reply ASAP, I wanna create my mod in a few days. Thank you.
-
8 hours ago, HebaruSan said:
Before you worry about the file name, you should try to use the built-in save/load functionality if at all possible. If your class inherits from ScenarioModule and has the KSPScenario attribute, its OnSave and OnLoad methods will be called when the game saves and loads, and the parameter is a ConfigNode that you can save to/load from, that will automatically be included in/retrieved from the save file.
- https://www.kerbalspaceprogram.com/ksp/api/class_scenario_module.html
- https://www.kerbalspaceprogram.com/ksp/api/class_k_s_p_scenario.html
- https://www.kerbalspaceprogram.com/ksp/api/class_config_node.html
- https://github.com/HebaruSan/PlanningNode/blob/faa12a59ce935fc5fa59a17fa8e2f63e8c98b661/Source/PlanningNodesManager.cs#L22-L45
I worry about the file name because I'm making a salary mod and I'm afraid players will be able to bypass it. For example, a player quicksaved a game, paid to kerbals their salary and then quickloaded and saved funds. I'm new to mod development, so I don't know literally anything about saving data. Also, if a player loads a fairly old save, all settings should load too.
-
Hello there! I'm making a plugin for KSP and I've run into an issue. How to get the save file game was saved to, like quicksave.sfs, persistent.sfs, etc.? For example, some settings need to be saved to SFS file, and when a player loads some save (persistent, quicksave or other), they'll need to load too.
GAME { (some game stuff) } MY_MOD { param1 = 1 param2 = Some Parameter param3 = true }
Thank you in advance for your answer
-
Well, I've just solved my issue. I used HighLogic.CurrentGame.CrewRoster.Crew to get a list of kerbals. Anyway, if there are good answers here, I'll be glad to read them.
-
Hello there! I'm writing a C# plugin to make player pay salary to kerbals. I'm new to plugin development, so, I don't know most of things that devs can use. Well, how to get a list of all kerbals and then get their roles (Pilot, Engineer, Scientist, Tourist) and XP levels? Thanks in advance for your reply
[C# Plugin] Increase engine thrust and decrease fuel flow
in KSP1 C# Plugin Development Help and Support
Posted
Hello there! I'm working at KSP mod that allows a player to upgrade parts. How to increase engine thrust by 15% or set a new value? Same with electricity generator. At the same time, also reduce fuel flow by 10% or set a new value.
Here's an example:
Hope this information will be enough. Thanks in advance for your reply!