2025-07-20 17:16 CEST

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0003702Spring engineGeneralpublic2013-04-27 23:03
Reporterabma 
Assigned ToKloot 
PrioritynormalSeveritymajorReproducibilityhave not tried
StatusresolvedResolutionfixed 
Product Version94.1.1+git 
Target Version95.0Fixed in Version 
Summary0003702: most weapons can't / don't shoot
Descriptionfor example the strike commander of zero-k doesn't shoot.
Additional Information94.1.1-169-g8402b8b develop
TagsNo tags attached.
Checked infolog.txt for Errors
Attached Files

-Relationships
duplicate of 0003695closedKloot (94.1.1-162-gab09935) LUS weapon firing issue 
+Relationships

-Notes

~0010452

abma (administrator)

weird, can't reproduce in BA

~0010456

Kloot (developer)

Last edited: 2013-04-27 23:03

View 5 revisions

BrainDamage broke LuaUnitScript'ed units (which BA doesn't have) with https://github.com/spring/spring/commit/ba9721b4e4a296f35efd9838a36c94ab7a9f476e (contrary to FLOZi's claim in http://springrts.com/phpbb/viewtopic.php?f=12&t=30153 this change *is* in fact responsible because it did *not* just affect the new callins).

Although that commit makes the Lua interface more consistent, using 1-based weapon indices is still fucking retarded (not to mention extremely error-prone) and I doubt the entire API is now converted so it will need revision anyway.

~0010510

Google_Frog (reporter)

As far as I know this is the only thing blocking ZK. I'd have games testing engines if this were fixed because 94.1 doesn't work all that well and with static builds the Linux people won't be left out.

~0010556

cleanrock (reporter)

Shouldn't this be on 95 Roadmap ?
Do we want to revert this change or force all games to use 1 based indices ?

~0010557

abma (administrator)

yep. at least we should know if we keep or if we revert this commit.

currently it seems we'll keep it?!

~0010558

Kloot (developer)

Last edited: 2013-04-26 02:41

View 2 revisions

If the commit is kept I would prefer to force use of 0-based indices in one fell swoop, the amount of work for game-devs would be roughly the same (and clearly many scripts in ZK already assume weapon indices start at 0 or they would not have been broken).

If it is not kept we are left with a more messy API that has to be sanitized at some point anyway but gives game-devs more time to prepare, although they won't be able to use the new functions without creating extra work for themselves when that happens.

~0010559

cleanrock (reporter)

I prefer 0-based too but i guess this 1-based change was because of Luas odd "Counting From One".

~0010563

Google_Frog (reporter)

What do you mean "assume weapon indices start at 0"? Most of the time we don't delve that deep into the system. Most of the scripts use AimWeapon1, AimWeapon 2 etc...

I think unit_script.lua needs to be updated to reflect this change, that is where the problem lies.

~0010565

FLOZi (reporter)

lua assumes tables start at 1, and unitdefs start at 1... It's hugely more consistent from a gamedev PoV to have 1-based indices.

I also don't quite grasp what you mean with "clearly many scripts in ZK already assume weapon indices start at 0 or they would not have been broken"

~0010566

KingRaptor (reporter)

Should just need updating of basecontent gadget with https://code.google.com/p/zero-k/source/detail?r=10015

~0010567

emmanuel (reporter)

maybe changing the engine in worst manner will avoid ZK gamedev to fix a gadget bug of them ?

~0010571

Kloot (developer)

Last edited: 2013-04-27 12:28

View 2 revisions

"What do you mean "assume weapon indices start at 0""

What could I possibly mean...

https://code.google.com/p/zero-k/source/diff?spec=svn10017&r=10017&format=side&path=/trunk/mods/zk/LuaRules/Gadgets/unit_water_effects.lua
https://code.google.com/p/zero-k/source/diff?spec=svn10017&r=10017&format=side&path=/trunk/mods/zk/LuaRules/Gadgets/unit_control_gunship_stafe_range.lua
https://code.google.com/p/zero-k/source/diff?spec=svn10017&r=10017&format=side&path=/trunk/mods/zk/LuaRules/Gadgets/unit_attributes.lua
https://code.google.com/p/zero-k/source/diff?spec=svn10017&r=10017&format=side&path=/trunk/mods/zk/LuaRules/Gadgets/unit_AA_micro_gadget.lua

So no, "just updating basecontent" would not have been enough for ZK.

~0010572

Google_Frog (reporter)

"clearly many scripts in ZK already assume weapon indices start at 0 or they would not have been broken"

Scripts. Not gadgets. Of course the gadgets were broken by this as well. 'scripts' has specific meaning in this area. I know the gadgets were broken as well but there are so few of them that use weapon functions that I don't care. They are easy to fix. The important thing for me was possibly needing to find someone with the time to rewrite a lot of scripts.

Anyway, the scripts did not need to be rewritten and ZK now has the updates to unit_script.lua.

~0010576

Kloot (developer)

Then I assume this is no longer an issue; others can follow ZK's example.
+Notes

-Issue History
Date Modified Username Field Change
2013-04-14 20:58 abma New Issue
2013-04-14 21:47 abma Note Added: 0010452
2013-04-15 01:30 Kloot Note Added: 0010456
2013-04-15 01:36 Kloot Note Edited: 0010456 View Revisions
2013-04-15 01:42 Kloot Note Edited: 0010456 View Revisions
2013-04-15 01:44 Kloot Relationship added duplicate of 0003695
2013-04-20 09:14 Google_Frog Note Added: 0010510
2013-04-25 19:11 cleanrock Note Added: 0010556
2013-04-25 23:51 abma Target Version => 95.0
2013-04-25 23:52 abma Note Added: 0010557
2013-04-26 02:39 Kloot Note Added: 0010558
2013-04-26 02:41 Kloot Note Edited: 0010558 View Revisions
2013-04-26 02:42 Kloot Note Edited: 0010456 View Revisions
2013-04-26 07:06 cleanrock Note Added: 0010559
2013-04-26 17:21 Google_Frog Note Added: 0010563
2013-04-26 22:42 FLOZi Note Added: 0010565
2013-04-27 04:39 KingRaptor Note Added: 0010566
2013-04-27 06:31 emmanuel Note Added: 0010567
2013-04-27 12:27 Kloot Note Added: 0010571
2013-04-27 12:28 Kloot Note Edited: 0010571 View Revisions
2013-04-27 13:07 Google_Frog Note Added: 0010572
2013-04-27 23:03 Kloot Note Edited: 0010456 View Revisions
2013-04-27 23:03 Kloot Note Added: 0010576
2013-04-27 23:03 Kloot Status new => resolved
2013-04-27 23:03 Kloot Resolution open => fixed
2013-04-27 23:03 Kloot Assigned To => Kloot
+Issue History