Jump to content
Nick Seafort

Two questions about pylon weapon configs, and pylon scripting

Recommended Posts

Hi fellas,

 

I've been scratching my head over these for a while now and not getting any closer to figuring out what's going on. I've tried the Discord a few times, but I think these questions may be a bit lengthy for that and haven't gotten any responses!

 

Situation: finalising adding pylons and associated scripting for our modpack's helicopters, and these differ from vanilla helos in that:

  a) they may have both a pilot and gunner controlling pylon weapons simultaneously (rather than all pylons controlled by one or other), and
  b) who controls each particular pylon varies between different presets of the same vehicle.

 

First issue: a "SAFE" weapon that we include as the first weapon for all vehicles vanishes ONLY IF the pylon loadout is altered in the mission editor.

So, we have fairly standard SAFE weapon added as the initial weapon for both pilot and gunner. The weapon is defined with a magazine name that doesn't exist, and when we specify the magazines[] for the vehicle we just include nothing - so the players see a read "SAFE" weapon with no rounds that they have to swap off to actually fire anything.

 

Having added pylons to the helicopters, these still work just fine upon loading into a mission. HOWEVER, if I alter the pylon loadout in the editor at all (via the vehicle's attributes pane, and simply swapping one ammo-type for another ammo-type for the same weapon for the pilot, for instance), then both the pilot and the gunner don't have the SAFE weapon show up any more - their initial weapon is the next in the list/first pylon, and cycling through all weapons reveal it's missing.

 

Has anyone else experienced this, or have an idea what might be causing it? I've checked other mods out and they don't seem to encounter the issue, but I can't spot anything in their configs that reveals an obvious difference. The only workaround I can think of is to rip all weapons off on spawn and then re-add them as well as the static weapons/magazines as part of the init... but this is obviously not a great solution and also runs into the second issue.

 

 

Second issue: I cannot find a reliable method via scripting to determine which seat controls which pylon station.

As an example, if the vehicle's default loadout has the pilot controlling two wingtip stations and the gunner controlling two inboard stations, then if this is changed in the editor so that actually they've swapped so the pilot controls the inboard stations and the gunner the wingtip stations then I can't see any way to find this information out.

 

As I'm trying to finalise the in-mission rearming GUI for pylons, this means that currently I have to try and guess who controls which pylon initially (to pre-set the ownership options on loading the GUI) and then store that in a custom variable after this to facilitate behaviour for the rest of the mission. It also means that I can't accurately workaround the first issue by removing and re-adding weapons/magazines due to not know the actual order to reattach them in to retain all the same animation/behaviour. It also means that the guessing function is a bloody awful nest of loops and array comparisons, with lots of checks to ensure the totals match after each step etc.

 

 

 

Is anyone able to offer insight into either of these points? If more convenient, I'm available to chat via Discord or TS - just let me know ☺️

Share this post


Link to post
Share on other sites

I didn't get a notification for this for some reason, but thanks for the suggestion Quake! I had a look into it, and unfortunately that mod doesn't really cover what I need (although I do like the way they've done some things!) ☺️

 

Anyone else got any suggestions?

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×