ZeroK-RTS / Zero-K

Open source RTS game running on the Spring/Recoil engine
https://zero-k.info
GNU General Public License v2.0
687 stars 205 forks source link

Some gadgets contain hardcoded unitnames or weaponnames, which is an issue for moddability #4535

Open CarabusX opened 3 years ago

CarabusX commented 3 years ago

Here is the list of some gadgets that I found that contain hardcoded unitnames or weaponnames. The list is not complete, as I mostly looked at unit and weapon gadgets, and could miss some.

I may look into some, but also fell free to fix any of these :)

CarabusX commented 3 years ago

Points 1, 2, 3, 4, 5, 7 fixed in PR #4536.

CarabusX commented 3 years ago

Point 6 fixed in PR #4542.

CarabusX commented 3 years ago

Point 13 fixed by Sprung in commit https://github.com/ZeroK-RTS/Zero-K/commit/065dbc94e796ce3caad52b4517adc0dfbebaca74

CarabusX commented 3 years ago

Point 8 fixed in PR #4543.

GoogleFrog commented 3 years ago

I think the ticks should be for pulled PRs rather than open ones.

CarabusX commented 3 years ago

I think the ticks should be for pulled PRs rather than open ones.

They are. I am not ticking them until given PR is merged. Just posting links to PRs here so that someone doesn't accidentally start fixing something simultanously.

CarabusX commented 3 years ago

Points 10 and 12 fixed in PR #4546.

sprunk commented 3 years ago

How did you perform the check? There are more, for example https://github.com/ZeroK-RTS/Zero-K/blob/master/LuaRules/Gadgets/unit_starlight_handler.lua#L29-L30

CarabusX commented 3 years ago

Yeah I didn't look for units with non-standard names. I mostly searched for strings prefixed with amph..., hover... (for all mobile unit types including stuff like bomber..., drone..., sub...), and then for statics (static..., energy..., plate..., turret... etc.). I skipped some I found not worth fixing or that don't need fixing for me. (like the hardcoded windgen in some OD places)

sprunk commented 3 years ago

Would anything be missed by grepping for UnitDefNames?

GoogleFrog commented 3 years ago

Or better, UnitDefNames[".

sprunk commented 3 years ago

That doesn't find things like

local udn = UnitDefNames
local rockoDefID = udn.rocko.id
CarabusX commented 3 years ago

Because things like these are too evil to find. Once I get through the current batch I may try finding some more.

CarabusX commented 3 years ago

Points 14, 15, 18, 19, 22, 23 fixed in PR #4549.

CarabusX commented 3 years ago

Point 17 fixed in PR #4557. Point 20 fixed in PR #4558.

Mach565 commented 1 year ago

Point 11 fixed in PR #4930.