• Our friends from AlphaCentauri2.info are in need of technical assistance. If you have experience with the LAMP stack and some hours to spare, please help them out and post here.

[GS] Remove all but one unit class

zachwastaken

Chieftain
Joined
Jan 11, 2023
Messages
3
Hello. I've been wanting to make a series of mods where every single unit type is disabled but one - plus civilian units - for use. For example, only siege and civilian units, or melee only. I've tried looking into it some but apparently no one else has done this that I see. There's a few codes I tried guessing but none of them worked. I even went the long route and coded to remove every unit but melee units and civilians. (Didn't even bother with uniques)

DELETE from Units WHERE Types IN ( 'UNIT_SCOUT', 'UNIT_RANGER', 'UNIT_SLINGER', 'UNIT_ARCHER', 'UNIT_ARCHER', 'UNIT_CROSSBOWMAN', 'UNIT_FIELD_CANNON', 'UNIT_MACHINE_GUN', 'UNIT_HORSEMAN', 'UNIT_CAVALRY', 'UNIT_HELICOPTER', 'UNIT_CATAPULT', 'UNIT_TREBUCHET', 'UNIT_BOMBARD', 'UNIT_ARTILLERY', 'UNIT_ROCKET_ARTILLERY' 'UNIT_KNIGHT', 'UNIT_HEAVY_CHARIOT', 'UNIT_GALLEY', 'UNIT_QUADRIREME', 'UNIT_IRONCLAD', 'UNIT_CARAVEL', 'UNIT_FRIGATE', 'UNIT_PRIVATEER', 'UNIT_BATTLESHIP', 'UNIT_SUBMARINE', 'UNIT_AIRCRAFT_CARRIER', 'UNIT_DESTROYER', 'UNIT_NUCLEAR_SUBMARINE', 'UNIT_MISSLE_CRUISER', 'UNIT_BIPLANE', 'UNIT_FIGHTER', 'UNIT_BOMBER', 'UNIT_JET_FIGHTER', 'UNIT_JET_BOMBER';

I don't know what else to try, I've tried taking away unit formations but that doesn't do what I'd like it to do. Any sugeestions?
 
Oh wow, I didn't notice that error at all. Let me fix and do some more tweaks and see how this goes
 
You're also referencing a column 'Types' in the 'Units' table, which doesn't exist. The column you want is 'UnitType'. However, I believe if you reference the 'Types' table instead of 'Units', you can use the 'Type' column to delete the units and it will cascade through the other tables.
 
Back
Top Bottom