![]() |
|
General Questions & Help General & Advanced Orbiter flight questions, Orbiter installation questions, to all other help topics here. |
![]() |
|
Thread Tools |
![]() |
#1 |
Orbinaut
|
![]()
Hi all, I’m currently flying the Providence however as this ship doesn’t have a .ini file, I was wondering how I could increase the main’s fuel quantity.
It holds 150k. It has a providence.dll file in the modules folder. Can anyone advise how I can change the quantity from 150k to 350m? Your assistance will be greatly appreciated. |
![]() |
![]() |
![]() |
#2 |
Beta Tester
![]() ![]() ![]() |
![]()
One way (not easy) is to dock a tank to the vessel. Then you can use the fuel transferMFD, to transfer fuel if you need to.
|
![]() |
![]() |
![]() |
#3 |
Beta Tester
![]() ![]() |
![]() Quote:
You could also write a module that uses the Orbiter API to change the fuel setting of the vessel. In addition, there is the possibility to use the scenario editor with the IIRC generic "propellant" section that allows you to refuel the tank. |
![]() |
![]() |
![]() |
#4 |
Orbinaut
|
![]() Quote:
I opened up the .dll with hex editor but info made absolutely no sense to me. |
![]() |
![]() |
![]() |
#5 |
Beta Tester
![]() ![]() |
![]() Quote:
In this case however, the thing is not that hard to do, especially if you already know what a hex-editor is and how you can change bytes with it. In principle you are searching for a single 8-byte combination and have to exchange it to another one. Chances are that you will find it only once, but it is possible that there are multiple occurrences. You can simply use trial-and-error to find the right one, always only changing one occurrence. First, go here to convert the number into hexadecimal representation: http://www.binaryconvert.com/result_double.html There you enter the number 150000, which will give you the hex-number 0x41024F8000000000. Now you have to reverse the byte order, because such constants are saved in little-endian in the code. It will give the byte sequence 00 00 00 00 80 4F 02 41 . Search for that in the hex editor. Once found, overwrite it with the byte sequence for your number (350000000=0x41B4DC9380000000= 00 00 00 80 93 dc b4 41). Save it (remember to make a copy of the original DLL) and try. Now this will of course only work in standard coded vessel modules. If there is anything fancy going on in there, chances are you won't get far with this method. But most fuel mass settings are just using one constant, and that's where this should work. |
![]() |
![]() |
Thanked by: |
![]() |
#6 |
Addon Developer
![]() ![]() |
![]()
I think there is a much easier way to do it: LUA.
1) Be sure that in the launchpad - modules section the "LuaConsole" is ticked 2) open the sim and focus on your vessel 3) got to orbiter menu select function 4) in the window that opens select lua console window and press open. 5) in the window that opens write the following line by line and press enter each line: Code:
v=vessel.get_focusinterface() h=v:get_propellanthandle(0) v:set_propellantmaxmass(h,350000000) v:set_propellantmass(h,350000000) for a single scenario it should work. if you want it to be like this every time you open the scenario there are the mission scripts for lua that can be added, but I would do one step at the time and I would check if this is working before proceeding to the next step |
![]() |
![]() |
Thanked by: |
![]() |
#7 |
Beta Tester
![]() ![]() |
![]() Quote:
But there we are already into coding a module that uses the Orbiter API and I thought this to be a bit more complex to explain to a complete newbie than exchanging some bytes. As funny as it sounds, but for the given problem the hacking was easier ![]() ---------- Post added at 12:57 ---------- Previous post was at 12:45 ---------- BTW: if is what is meant, the constant occurs only once at position 0x00003860 in the Providence.dll . |
![]() |
![]() |
![]() |
#8 |
Addon Developer
![]() ![]() |
![]() Quote:
Also I have to say that I think that lua commands are a very good entry point for newbies to start to understand the orbiter APIs. I personally started there. |
![]() |
![]() |
Thanked by: |
![]() |
|
Thread Tools | |
|
|
Quick Links | Need Help? |