PDA

View Full Version : Vehicle Attacks from CT Not Working



Mike Serfass
March 10th, 2023, 18:44
This is for the SWADE ruleset.

We had a slew of errors last night during combat, enough that vehicle combat was unplayable. The recent updates fixed almost all of them.
A remaining bug is that you can't roll vehicle attacks or damage from CT.

Here's what it looks like:
56654

The entry in the cyan box is what appears when clicking on the vehicle weapon in CT. It's the same for attack and damage.
If you open the vehicle and click on the weapon in the character sheet, it rolls attack and damage correctly, as you see under the cyan box.

This works properly for NPCs. It affects only vehicles.
There is a NPC assigned to pilot and to the weapon, and a target is selected.

Let me know if you need more information.
Thanks!

Moon Wizard
March 11th, 2023, 00:36
@Mike,

Can you provide the campaign folder zipped up, as well as steps to recreate? Or a walk through to see in a new campaign?
(I tried with an Apache from SWADE, and dropped a pilot in the vehicle record on the second tab, and the attack/damage rolls seemed to be working for me.)

Thanks,
JPG

Mike Serfass
March 11th, 2023, 19:23
I investigated further and discovered a few things.

The problem vehicles have two similar weapons, e.g. two medium laser cannons.
The vehicles that are not working correctly are from my setting module. It may be affecting vehicles in other modules, but I don't have any other modules with vehicles set up with two similar weapons.

The pilot is not being assigned properly to those duplicate weapons.
If I drop the pilot or another NPC into the weapon slot, it works correctly.
If I remove the pilot from the weapon, it continues to work correctly.

Here's an example:
56668
The weapon in the cyan square is not working properly, and it's the weapon the pilot is not perpetuating to correctly. Notice the weapon shows only damage in CT. When clicked it doesn't roll, and shows the "weapon +4" message.
The weapon in the green rectangle shows the attack die and is the weapon I dropped the pilot into. This weapon rolls attacks correctly.

Here you see a vehicle with two different weapons (in green).
The lower vehicle (in blue) has two similar weapon.
56669
Both have a pilot assigned, and the Piloting Skill shows under Traits, as it should.

I cleaned out CT before setting this up, so there's nothing leftover from pre-updated code.
When I exit this campaign, I get "Object databasenode deleted without cleaning up attached Lua object.

I'll zip up my campaign, module, and error log and attach that.

Mike Serfass
March 11th, 2023, 19:31
Here's my error log generated after exiting the campaign.
The zipped campaign and mod files are too large to attach.
You can download them from here:
my google drive (https://drive.google.com/drive/folders/0B8mGuFqw3YuwT1l0cFpfV0VLeUE?resourcekey=0-cypu8wl6Ur2jsf2kce9dKQ&usp=sharing)

Mike Serfass
March 12th, 2023, 22:22
I figured out what's happening.

In my module. I add an NPC pilot to the vehicles. The idea being that it will save me time during game. When I drop a vehicle into CT, it will already have the pilot assigned.
That doesn't work as I expected. The vehicle doesn't have a pilot assigned when dropped into CT.

If you look at the vehicle in the <combattracker> node, you'll see that pre-assigned npc under the vehicle and weapon. e.g.


<actor type="windowreference">
<class>npc</class>
<recordname>reference.npcs.jumpcorp_pilot_kalian@Quar Dai - GM</recordname>
</actor>

is set, so it's carrying over from the exported module.

vehicle_combat.lua and mountedweapon_listentry.lua doesn't pick this up, so the npc doesn't display in CT.
When I drop an npc into the pilot position, it's already assigned to the weapons, so it doesn't notify CT to refresh the Attacks section.
When I drop the npc into the weapon section, it fires the notifications, and CT refreshes the Attacks section, but only for that single weapon.

This is why the attacks work from the vehicle character sheet as expected; the npc is already assigned.
However, the vehicle character sheet doesn't display the assigned npcs either. Even though the <actor> nodes are set properly.

The fix is to not assign npcs to vehicles in the module being exported.
When I cleared those npcs from the vehicles and exported, the bug didn't happen.

It would be nice to be able to pre-assign npcs to vehicles in the module. It would be a time saver.
Alternatively, it would be nice to be able to assign npcs to vehicles when creating encounters. But that's not possible because module vehicles are locked.

In the end, this isn't a bug. It's a "didn't work like I thought it would".

Mike Serfass
March 13th, 2023, 00:55
Further discoveries.

If you drop npcs into all the vehicle weapon slots on the combat tab, export that module, and use that vehicle in a campaign, that sets all the weapon attack dice properly, and the piloting/driving die.

For vehicles that are not pre-populated (like the SWADE book and Vehicles Guide), when you drop a character into the pilot slot, the weapons all take on the pilot's attack dice by default, which is nice.
Except when you remove the pilot, the weapon attack dice don't update in CT. But when you click on a weapon, it will roll as unskilled, whatever the attack dice say. It should refresh the CT to remove attack dice. So there's a small bug there, fortunately nothing breaking.

That means, if you're going to pre-populate your vehicles with NPCs to speed up vehicle combat setup, you must populate all the positions. Otherwise, leave all the positions blank to avoid this "bug".

Moon Wizard
March 13th, 2023, 01:09
We actually suggest that all adventure modules are built as non-read-only, so that they can be customized by the GM to fit the needs of the session. Only core rulebooks are recommended for read-only to preserve base content.

Did you figure out where in the scripts where the lookup was failing?
I can take a quick poke around to see if I can figure out where the limitation is, but no guarantees.

Regards,
JPG

Moon Wizard
March 13th, 2023, 01:50
I dug in a little bit with your example campaign. For the weapons where you had problems, it looks like the NPC references are set up to point to "Quar Dai - Player" module, instead of the "Quar Dai - GM" module. (i.e. reference.npcs.tazanianpilot@Quar Dai - Player)

Did you perhaps change the modules around at some point?

I'm not sure if this is applicable; but it's usually best not to load modules into the campaign you are building the module in, to avoid any linking issues in the export.

Regards,
JPG

Mike Serfass
March 13th, 2023, 03:44
I just noticed that too. I don't know how it's doing that. The module isn't loaded into it's own campaign. Though I was testing a module load script which loaded it, but I unloaded it. Maybe something is still pointing at it.
Thanks for looking at that. Good to know it's on my end.

In looking at the module deeper, I found other links pointing to the wrong module. I'm now thinking this is from before I split the module into a player and GM version.
Sorry for the wild goose chase.