
I’ve been laying out the groundwork for v0.02, working on the “Conquest” (Assault) objective type. AI Emplacements were already in and working, so I was just testing out a quick AI battle to make sure nothing had broken since I last touched it all.
Emplaced anti-tank guns seemed to be invincible — no matter how many rounded slammed into them, they never seemed to die. Upon closer inspection, I noticed that their components were missing, indicating that a round had hit and destroyed that component. This should trigger an explosion, it’s how damage and destruction is handled.
Scratching my head, I did a whole lot of debugging, using breakpoints, to try and figure out what wasn’t firing. The anti-tank guns share the same “brain” as the tanks — they share a script, and use the parts that are appropriate (i.e ignore movement). The tanks were exploding fine, so the code was good.
Then I noticed down in the console, there was an error. The destruction logic was attempting to place and aligh the wreckage (blown up vehicle object) at the navigation/movement component, which the turret did not have. An oversight for sure, that was easily fixed, but I was confused at why it was skipping the rest of the code.
From what I understand, an error like that basically prematurely ends the code block. This.. makes some previous debugging headaches suddenly make a lot more sense.
Moral of the story? If you hit an error, you need to fix it, otherwise you cannot debug.
