KspNoobUsernameTaken Posted May 24, 2024 Share Posted May 24, 2024 I'm trying to understand the code of this mod: https://github.com/AniruddhKSP/KSP-Beamed-Power-Standalone-mod But its like gibberish to me. My aim is to change it to transmit a different resource instead of electric charge, ideally defined in the parts cfg files. Quote Link to comment Share on other sites More sharing options...
carryyourzero Posted July 26, 2024 Share Posted July 26, 2024 I mean, I'm not really a programmer but at least some of it seems pretty self explanatory. int EChash is where they create a variable, so called because EC stands for Electric Charge, hash meaning the number signifying the current EC. They also make two other variables, frames and requestAmount. Below, these are defined with the = operator (OnLoadVessel is probably telling the game to grab the EC value when the vessel loads on the launchpad). Etc etc. You just want to read each section carefully and find where ElectricCharge is being referenced. Figure out what terms the game uses to reference the resource you're interested in. Slot it in and see what breaks, find out why, and so on. Quote Link to comment Share on other sites More sharing options...
KspNoobUsernameTaken Posted August 3, 2024 Author Share Posted August 3, 2024 On 7/26/2024 at 3:59 PM, carryyourzero said: I mean, I'm not really a programmer but at least some of it seems pretty self explanatory. int EChash is where they create a variable, so called because EC stands for Electric Charge, hash meaning the number signifying the current EC. They also make two other variables, frames and requestAmount. Below, these are defined with the = operator (OnLoadVessel is probably telling the game to grab the EC value when the vessel loads on the launchpad). Etc etc. You just want to read each section carefully and find where ElectricCharge is being referenced. Figure out what terms the game uses to reference the resource you're interested in. Slot it in and see what breaks, find out why, and so on. Yep, I figured it out. Late thanks anyway. Quote Link to comment Share on other sites More sharing options...
KR_PUG Posted February 2 Share Posted February 2 BackgroundProcessing = this class + VesselModule OnLoadVessel -> init.ecash = part('ElectricCharge')'s id LoadVesselPowerData -> scan [all modules] in [all parts(flight node only)] filter=WirelessSource,WirelessReceiver,WirelessReceiverDirectional -> requestAmount update with "powerBeamed" | "receivedPower" | "receivedPower" FixedUpdate -> postfix maybe. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.