NOTA airfuel problem

NOTA airfuel problem

Discuss Lua based Spring scripts (LuaUI widgets, mission scripts, gaia scripts, mod-rules scripts, scripted keybindings, etc...)

Moderator: Moderators

Post Reply
User avatar
PepeAmpere
Posts: 589
Joined: 03 Jun 2010, 01:28

NOTA airfuel problem

Post by PepeAmpere »

Big part of last two days weeks I spent trying to fix broken refueling in NOTA.. with no success. Im not sure where is the problem (so maybe I've chosen bad subforum), but my personal tip is lua.

PROBLEM:
Units sometimes (what is "sometimes" I say later) dont go to refuel when they are out of fuel. Becouse the shooting ability is dependant on fuel (shot cost fuel), it happends mostly, that unit shoot/bomb on target and land on that place (!). And theres no way how to pick up them and get them from there (no response on move/refuel/attack.... cmds). They dont listen any other orders, until one of their favourite airpad is free.

OBSERVATIONS:
0) It started with new spring versions 84.0, 85.0.
1) It happends ussually to antiground planes (vashps, toads, hellfires, naplam guys,...) and to bombers (normal and adv. ones too). Air-vs-air planes are quite ok, but it happends to them, too.
2) Later I found that that bug is dependant on number of airpads - planes are using HALF some small part of built airpads, and if more planes need refuel, the order is canceled (respectively planes continue in attack until they lost all fuel) and when the plane is out of fuel, it sits down on the ground.
3) Becouse observation 2), I think observation 1) is bullshit ;) that bug is not type of plane dependant, but it more happends to units that spend more fuel in one "shot". Air-air fighters spend little fuel for fire (5-8... bombers 70-300), so they more often find free airpad until all fuel is depleted.
NEW 4) Im suspecting that airpads are lower now, so planes cannot reach them - that airpads, that are never used. (it not solve whole problem, but maybe part of it).
NEW 5) deleting of unit_refuel.lua doesnt affect thar problem.. only refuel button left, but aircrafts still use only 5-8 airpads and sit down without listening orders.
NEW 6) That 5-8 airpads are the nearest airpads from current position of first refueling plane, so there can be meaby some limit for queue of "find_closest_airpad". BUT If you build new airpads closer to aircraft position, sometimes new airpad is added as good one for refueling, sometimes not (ignored, never used).

Here is the code of our unit_refuel.lua (luarules/gadget)

Code: Select all

code deleted, becouse dont affect the problem
Two parts of code that Ive tried to mark with <<<< (that I found in different lua files) couse some problems in different lua scripts.. for example

WHAT I'VE TRIED
1) Ive tried to change fuel stats in .fbi files of that units.. BUT becouse the problem is CMD based (i think, it has something to do with lookining for free airpads and making orders queue), it had only partly effect, becouse units with non-zero fuel had time to wait for some free airpad (but such changes may brake game balance)
2) Ive tried to change refuel line in COB script file of unit (order refuel), but theres some stupid name of variable and I really really dont know what does that UNKNOWN_UNIT_VALUE(93) mean.

Code: Select all

Refuel()
{
	set UNKNOWN_UNIT_VALUE(93) to 0;
}
So only blind tries to set it on -1, 1, 50, 55
3) ive tried to change the params[0] of cmd refuel as i saw http://springrts.com/phpbb/viewtopic.php?f=23&t=12020 ... (-1, 1, 0) - no effect
4) old retreat code - no effect, its really old
5) delete unit_refuel.lua - no effect
6) change collision volume - no effect
7) I've tried to borrow unit_bomber_command.lua (unit_refuel still deleted) for testing from ZERO-K - it has ability to add comand buttons (rearm), but no other effect, problem still the same. (strange: ECHO commads - ON - in procedures does not seem executed)

SO, MY SILLY SOLUTIONS till now :roll:
- Planes somehow cannot find a way to half of airpads => so if you have two times more airpads than planes, the bug is no more here dont work
- Planes dont try to move to the nearest airpad and wait until its free. Instead of it they sit down and wait on the place where they lost their fuel - so other solution can be, adding there any RETREAT cmd to go back to base. But my tries dont work.. :). - dont work, ive tried to use ZERO-K refuel lua, and no change (it has retreat cmd).

The big problem is, most of the airfight is fueldependant, so whole game/mod is ruined by this. Im still big luanoob to solve it.

Here link for NOTA forum page - http://springrts.com/phpbb/viewtopic.ph ... 69#p509869
Here for my last version of nota1663.sdz - http://nota.googlecode.com/files/nota1663.sdz

BTW... when I was trying to fix the mod, when I use /luarules reload, all players loose all of their supplies and all income.. so its impossible to build anything. Is it correct way how it should work?
User avatar
PepeAmpere
Posts: 589
Joined: 03 Jun 2010, 01:28

Re: NOTA airfuel problem

Post by PepeAmpere »

SEEMS IT WILL BE FIXED IN NEW ENGINE VERSION (86.0), 85.0.1-185 tested and its working.
Post Reply

Return to “Lua Scripts”