#Vehicle Sheets

1 messages · Page 1 of 1 (latest)

tidal gyro
#

I know the current work around is to drop the vehicle weapon onto the character sheet with a zero weight and then roll from that character's sheet vs the vehicle sheet.

I've been messing with Vehicle sheets for the past couple of days and I think I'm getting some ideas on how we might address some of the issues with them. Some structural changes are still necessary to handle things like gunner positions vs operator/pilot, but I wanted to try and discuss some of those issues here.

While I was tinkering, one of the things I found was that sending a vehicle weapon to chat was pointless (to the point of why even have a send to chat button in the first place) because it was assuming the vehicle was making the skill roll.

#

Digging through, I found this on the SwadeItem class in the show() method:

const templateData = {
      actorId: this.parent?.id,
      tokenId: tokenId,
...
      }

I kept getting an error because it wanted the vehicle to make the skill roll (makes sense). If I change this, I can at least get a different error:

let rollingActor = this.parent;
if (rollingActor.type === 'vehicle') {
  rollingActor = await rollingActor.getDriver();
}
#

The new issue is that now it won't roll the item for the actor because the operator doesn't have the vehicle weapon on their character sheet - basically, back to square one.

#

So, my question is - is there a way to pass both an actor and an item such that, regardless of whether the actor has the item on their sheet, it can still roll for the item that was passed using the item's properties designating which skill should be rolled?

#

It seems like, if you specify both the actor and the item on the chat card, it shouldn't matter if the actor has the item or not. Just look up the properties you need to perform an action on the provided actor. If the skill isn't present, roll untrained (which I'm assuming is addressed in logic somewhere already).

nova whale
#

Worth noting that we're planning to do a full rewrite with AppV2

tidal gyro
#

Which I understand and am aware because it's been mentioned several times before. I'm asking if some smaller changes are feasible now, possibly even laying some groundwork for the AppV2 rewrite.

ivory adder
#

The driving check button rolls for the assigned driver right?

#

Can we hijack that approach and make a shooting button

tidal gyro
#

There's a hacky way Kristian and I were talking about using Scene Regions in v12 to assign stations in a vehicle. That feels like a lot of setup for the GM, though.

tidal gyro
ivory adder
#

yeah that sounds a bit beyond me meagre skills

ivory adder
#

I think the answer is in listeners. So a script that uses activateListeners when the vehicle weapon card is sent to chat, that listens for that event and swaps the vehicle shooting skill for the pilot's

#

then no alterations to the sheet are really required and this could be a small module, world script, or temporary kludge in the system code

ivory adder
#

in app v2 I think activateListeners gets replaced by actions

#

so there's likely not a "part way" to v2 solution for the current moment

drifting pond
tidal gyro
# ivory adder I think the answer is in listeners. So a script that uses activateListeners when...

That's what my tweak is doing - and that is a trivial change. It substitutes the operator's ID for the vehicle's in the same SwadeItem listener (these were just local changes to the system to test some ideas).

The new issue that change introduced was that the operator didn't have the weapon the chat card was created for on their character sheet, so the system threw an error vs rolling the specified action (the one clicked in the chat card) using the specified item's definition and using the Trait of the specified actor, newly identified in the chat card as the operator. The chat card gets the ID for both, so there is some logic in the system that is saying "you can't do that".

ivory adder
tidal gyro
#

I'm in System and Module development and dev support.

ivory adder
tidal gyro
#

I found where in the code the message is originating - it's in the ItemChatCardHelper class.

    let actor = this.getChatCardActor(card);
    if (!actor) return null;

    // Get the Item
    const item = actor.items.get(card.dataset.itemId);
    if (!item) {
      Logger.error(
        `The requested item ${card.dataset.itemId} does not exist on Actor ${actor.name}`,
        { toast: true },
      );
      return null;
    }

I expect all that should really need to change is where you get the item from. That or the vehicle ID still needs to be used in the item chat card and the logic for the rolling actor needs to instead be implemented in the helper.

ivory adder
#

I thnk you are close for sure

tidal gyro
#

I expect this is because the item might only exist on the actor, so it has to be pulled from there.

ivory adder
#

yeah need to associate an item on one actor with the roll of another

tidal gyro
#

Ok. I think I know what I might need to do. Once I get it figured out, I'll submit a PR (or come back to this thread with...

drifting pond
#

There's also the swade-dev channel on the league server

nova whale
#

yeah that's where we usually talk stuff through