View Full Version : Modding Fuel Burn in Homeworld 2 - Impossible? Possibly!
Bakuras
23rd Oct 03, 6:31 PM
I've been pouring over both the various dumped LUA files and Thought's function listing, but as of yet I have not been able to find anything that could possibly allow us to add the concept of fuel burn to Homeworld 2.
Now I'll be the first to admit that I'm a card-carrying Kadeshi maniac who wants to see fuel pods make a comeback in Homeworld 2, but my goal of putting fuel burn back into Homeworld 2 has larger rewards:
It opens the door to limited ammunition, in-game animation stills, the glorious return of Support Frigates, escape pods, and all sorts of other in-game modifiable values!
Basically, my thinking is this:
We can already add an entry into SHIP Lua's and call it "newshiptype.maxfuel" I discovered this while experimenting with debris and combining attributes of ships with resources.
What's even more interesting, however, is that LUA scripting might allow for us to create global values within game types. Thus, fuel burn can be turned on and off! The main problem, unfortunately, is that while its true that LUA is flexible, we might not be able to tag a value to each strike craft called 'fuel' and have it automatically decrease with movement. While it certainly looks like the realm of the forbidden code mod, if we can somehow accomplish it the door to an infinate number of additional gameplay concepts will be open.
Thus, in closing, I feel that trying to find a way to model fuel burn in Homeworld 2 will benefit the mod community as a whole and broaden our options for additional gametypes. As of now, I don't see it as possible, but I simply haven't seen everything that LUA can do yet. Adding global values to gameplay types is certainly possible, but adding something more dedicated like a fuel burn value to each ship definately seems like stretching the bounds of LUA
Please, if anyone finds any leads, post them here so we can follow up!
pipakin
23rd Oct 03, 6:33 PM
I think it could be done if you put the fuel burn code in the game type lua file. You can add Rules in there, maybe....you could hack in a way to decrease the fuel of every moving vessel?
Just brainstorming.
-Philip "Pip" Kin
Bakuras
23rd Oct 03, 6:37 PM
That's my hope as well, but as of yet I don't see any viable functions that will allow me to call every type of vessel on the move and have the added 'fuel' value be reduced relative to the move factor.
It's the same concept as health: You dock with carriers to restore damaged vessels. Naturally, if we're able to implement a function that decreases a ship's fuel value based on their movement factor, we should be able to do it in a similar fashion to ship's becoming damaged by enemy fire.
The only question is, will LUA allow it? Will we be able to call up a list of every ship of a certain type(namely strikecraft) and have our added value of 'fuel' decrease relative to its movement?
A tricky propisition as I haven't found anything that's related to that at all :(
blood_angel
23rd Oct 03, 6:54 PM
Is it possible to just have it decreasing constantly, even at rest?
Bakuras
23rd Oct 03, 6:58 PM
Assuming we can call a ship up through the LUA, yes. I believe that we can do that, but I don't know if we would be able to sort it by shiptype. I've been having a look at the unit caps files and I personally believe that doing that is possible in the same way that unit caps are used
Having it only decrease when moving sounds like more than is possible at the moment, unfortunately.
Not only that, but actually preventing a ship from moving: that is the true challenge!
We would have to be able to manually call up the units thruster and engine speeds and decrease it to zero when the fuel runs out, and then re-instate the values when fuel is restored. Although having zero fuel destroys the hope of making it back to a carrier to be re-fueled....
Grey Fox
23rd Oct 03, 9:24 PM
try looking through the code for defense fields or cloaking...they have time-limit functions...the trick would be to tie the activation of said ability to movement...also see what code the damaging radiation has
Bonnet
23rd Oct 03, 9:48 PM
hrm, well each ship has a ceratin amount of energy (like the def field settings) so you might be able to tweak the engines to work off of that.
verybad
23rd Oct 03, 10:21 PM
How about you have two ships, one that can move, and one that can't. If you "run out of fuel" then it switches the ship (same texture etc). Perhaps even a blinking "Out of Fuel" cursor arround it.
Fuel tracking would be based on a timer, that only works while moving. (I know someon made a clock, so this ought to be possible)
Edit: If this works, you could use it in reverse to give interceptors an Afterburner that lets them "Intercept" better :)
pipakin
23rd Oct 03, 11:42 PM
Interesting idea, with the different models, but it would change the ship's hp and such, plus I don't think it's possible with the tools/current understanding that we have.
However, I'm sure there is a way to implement fuel burn, and I hope it gets discovered :)
-Philip "Pip" Kin
Bakuras
24th Oct 03, 12:31 AM
Different ships... the problem is that if we could pull off changing the ship type on the fly when fuel reaches zero, then we would most certainly be able to simply stop a single ship from moving.
A good idea, but our main problem at the moment is finding a way for each individual ship to have our custom value of 'fuel' to decrease on movement only. Once we accomplish that, the next challenge will be getting ships to be unable to move when that value reaches zero.
I have no new progress, but the more we know about the LUA functions ingame, the closer we get.
Thought
24th Oct 03, 12:32 AM
ship.fuel = blah ? :)
Bakuras
24th Oct 03, 12:34 AM
Huh? ^_^
malcom2073
24th Oct 03, 7:07 AM
Rofl. Tried it, nogo.
Bakuras
25th Oct 03, 12:51 PM
Well we already knew you can add it, but doing anything with it doesn't seem to work yet :(
Ammon Ra
25th Oct 03, 2:42 PM
Try this for activating fuel.
d:games:sierra:homeworld2/bin/release/homeworld2.exe -overridebigfile -overridenofulel :D:D
Sorry, couldn't resist ;):frog:
The5thElephant
25th Oct 03, 6:22 PM
LOL Ammon Ra. Perhaps add -pilotviewyesplease at the end too.
:elephant: :elephant: :elephant: :elephant: :elephant:
Avatar Terminus
25th Oct 03, 6:28 PM
if you add fuel burn, and can make it constant <even while stopped> or make it run only while firing as variants, i'll name my kid after you, Bakuras.
Oh fine, and I'll throw in a monkey.
starfleet
25th Oct 03, 8:48 PM
work out the exact commands for movements then do something like this
if shipmove = 1 then {
activate some form of timer store as fueltimer
check current fuel level if fuel = 0 set shipmove = 0 else
when fueltimer = 100 get fuelvalue - 10 store fuel value
check to see if ship stop'd moving
if ship stopmoving go to end
you could do it something like that i'm still waking up atm but maybe thought or the like can work out the code.. basically make a function inside the lua code that does it for you... It should be possible.
Bakuras
26th Oct 03, 1:14 AM
Hehe, good one A-Ra :)
No, but you make an excellent point Starfleet. We should be less concerned right now about how to get ships to subtract 'fuel' when they move and more concerned about how to find out when a particular ship is moving via LUA. We know that if you knock a capital ship's engines out, it stops moving altogether, AND we also know that putting ships into a strike group gets them to move at the same speed as the slowest ship in the unit... if we could somehow find out if these values are called up through LUA then half the battle is already won! I'm getting right on it! Thanks for the revelation Starfleet!
:salute:
Ammon Ra
26th Oct 03, 11:40 AM
This;
AddSubSystemMultiplier(NewSubSystemType,"Speed","ThisShipOnly","Linear",1,0,0)
And;
NewSubSystemType.typeString = "CarrierEngine"
Are found in the carrier's engine subsystem. Apparently the movement abbility is linked to the subsystem, and when it gets desiabled the ability gets removed. although a damaged subsystem has a lower max speed than a full health one (correct me if i'm wrong). But he curious thing about the file is the second quote: the "stringtype".
Also find the Ai strike group files, and you're sure to find the lua string that gives the speed factor to you. i have an old data.zip file and am d/l a large file (600mb) so i can't chack in the newer data zip file :(.
Hope that Helps ;)
BlueTech
26th Oct 03, 2:51 PM
About the ship stopping: In Homeworld, when a ships fuel is depleated, it dosn't stop, it moves very slowly (so that it can still get to a Carrier, MS, or Support Frig.
Unfortunately, i don't think there is any way to mod the original system in perfectly. One thing though: why would you want fuel? its dumb.
Bakuras
26th Oct 03, 5:11 PM
Thanks for the info about it not fully stopping. I never really noticed! I suddenly feel incredibly guilty about not having escape pods in any ships... I always scuttled them if they ran out of fuel since I thought it was hopeless! What an evil commander I am :(
The reason I want fuel burn back into Homeworld 2(as an option to enable in my mods) is because it adds an extra layer of depth to strike craft usage. My hope is that instead of blindly committing their forces to a rush attack on an enemy's distant position, players will have to carefully consider bringing along support craft to re-arm and re-supply their units. Since I feel that fuel-burn and limited-ammunition for certain weapons go hand in hand, I hope to add both to the game. This will, hopefully, create a more strategic and enjoyable Homeworld 2 environment.
Hopefully!
And thanks for the info Ammon Ra! I'll be sure to dump some of the strike group LUA's :)
BlueTech
26th Oct 03, 5:58 PM
ooooooohh!!! i see now... lol
You scuttled them? you ARE an evil commander! LOL *imagines corvette wall trying to get back to support frig slowly and going "AHHHHHHH!!!" as they blow up* ;)
Once I get my own comp to play HW2 on, I'll begin digging through the .lua files.. until then, I can only give design ideas and homeworld (1) facts. :( Any questions u got (about hw) i might know as I dug through the hw files for centurys.
i hope you find a way!
Aldat
26th Oct 03, 10:16 PM
just saying, but i don't think fusion reactors require much in terms of fuel
but the nthat's just me i guess
Bakuras
27th Oct 03, 12:12 AM
Fusion Reactors use super-heated plasma to get their power. The fuel for the plasma is usually Deuterium and Lithium. The by-product of the reaction between the two superheated particles is Tritium. The amount of electricity generated by this effect is quite enourmous, but although it's far more efficient than Nuclear power in its waste to energy ratio, it still needs fuel. While the Deuterium contained in 500 liters of water is enough to supply an average Joe with a lifetime of electricity, high performance space engines are another matter entirely! Since the Fusion Reactor would have to be substantially miniaturized in order to fit inside the hull of a fighter, special fuel would likely be required, so there you go!
Ammon Ra
27th Oct 03, 2:03 AM
Well, the strike groups have been dumped in the data file, but it only gives the position of ships. strike groups as in fighter wass, frigate line, capital phalanx, ect.
It doesn't say anything about speed though, just the position.
So with respect to speed, it's not contained wiothin those files, check the Ai directory and the scripts directory. just a guess, but i have a feeling that something is in those two folders of relative importance. ;)
Aldat
27th Oct 03, 11:46 AM
actually i figure they could carry an innordinantly large amount of feul inside those fighters and remember the time difference in technologies...
Bakuras
27th Oct 03, 12:08 PM
Thanks for the info on the Strike Groups files. I checked with scripts... nothing there yet that hints at a function I can call globally, but I'm still looking!
Exactly! Since their ships are so advanced, they require an ungodly amount of fuel to keep them going. Luckily, since ships of a Frigate size and above are large enough to carry the proper reactor components for self-regenerating fuel cells, this isn't an issue for them :)
See? Technology at work to make things better for us!(by making us use fuel!)
Overload
27th Oct 03, 4:51 PM
Perhaps a way to get the ships to stop without having an engine subsystem, would be to apply the EMP disabling effect to them once fuel runs out. Although as someone pointed out earlier, even in HW1, ships w/o fuel could still move very slowly to facilitate refueling.
Ranger
27th Oct 03, 5:02 PM
If you are somehow able to use a function to apply EMP disabling effect, then why not simply apply the addShipMultiplier function and reduce the speed to half (or whatever percentage you choose)?
BlueTech
27th Oct 03, 7:18 PM
* caugh caugh * SOMEONE!!!!!>!??!??!?! AM I JUST SOMEONE NOW!?!?!?!??!?!??!?!? lol jk ;)
the biggest problem here is not control over the ship, but how to moniter EXACTLY how many meters the fighter travels, when the timers getting low tell the player so, and to show a little bar of how much fuel. Also to program in the docking to replenish fuel.
mabye we could model it after EMP (in terms of recharging) cuz emp is always recharged at docking.
Powered by vBulletin® Version 4.2.0 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.