Hard Light Productions Forums

Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: asyikarea51 on October 09, 2016, 12:54:04 am

Title: Two questions: missile lock and variants
Post by: asyikarea51 on October 09, 2016, 12:54:04 am
The short question:
1) Is the missile multi-lock part of trunk now or is it still WOD-specific code?

The longer question, I admit it sounds like a request (considering I don't play FSO anymore :banghead:), but just felt like putting this thought out there:
2) Last I remember ship templates were broken because of how data was being copied around. (correct me if I'm wrong please!)

Instead of doing it as part of ships.tbl and adding to the count limit, could this be done in a "variant" way instead?

Something like Mechwarrior but the player can't actually mod their ship - the player just picks an available "mod" version of their ship from a "parts list" like weapon selection; restrict available variants in a similar way to missile ammo? If no variant is selected, revert to default statistics of the ship as per ships.tbl / tbm's. If a variant is selected, just direct the game to read the entire table chunk from, say, ship_variants.tbl? (No selective data replacement to limit complexity; just get the modder to supply complete table entries for all variants. Much more work & typo risk on the modder's end though.)

Say if GTVA's BG14, all the latest block mods. Or if small-scale hodgepodge group, maybe 1 dude has bUly.pof because refurbished Ulysses hull with no advanced tech, but his 2 buddies have Myrms of different generations with different flight characteristics/loadout but look identical (i.e. same POF).

I'm no adequate coder so I dunno the complexity, but off the top of my head, I know this would need custom UI and enough code changes to FSO and FRED that there's no point doing it unless any campaign of considerable reputation decides to use it en masse. And I don't know how this can be extended to unplayable ships e.g. capitals.

Way back when I was messing around in FRED there was this lingering idea in my head to portray the generational gaps between ships, block upgrades, merc/pirate/engineer/IT hacker mods etc - you could do this in a small scale with ships.tbl, but even with 'separate entry' or 'template entry' in ships.tbl it still added to the limit. Somehow I could never get over that "OMG A LIMIT" feeling nagging at me, dunno why.

I suppose in the longer run this could go further Tachyon-style with add-on slots for ships on top of that, but I'm just dreaming at this point.

after typing this whole block of text I stumble across a similar thread by AdmiralRalwood (http://www.hard-light.net/forums/index.php?topic=92349.0), whoops. Glanced through it VERY quickly, seems to cover weapons too and is more complex (awesome, I didn't think that far, 'circular variants' didn't cross my mind at all; the whole 'implementation-via-stats-appending' drawbacks did though). But I'll leave this here since I had the variants thought for a while too i.e. years.

Right now one item I can think of that could only be done via 'appending' route is missile lock, but then again lock is presently determined by weapon type and not by shipcomputer e.g. Ace Combat...

Code: [Select]
FRED loadout editor layout / campaign loadout layout? (Reckon would need SEXPs to manipulate this between missions too, e.g. add-ship-variant -> pull from playable variants only)

Ship: GTF Artemis
Variant count in inventory: (somehow pull the below list from ship-variants.tbl, match text, populate accordingly in FRED and populate loadout menu)
GTF Artemis D.H. "1"
GTF Hydra "1"

Ship: GTF Chaos
Variant count in inventory:
SOF Chaos "2"

Ship: GTF Thor
Variant count in inventory:
GTB Athena "1"
GTB Athena Mk2 "1"


Code: [Select]
;ship_variants.tbl

$Variant: GTD Carthage
$Variant of: GTD Orion
 +not_player_usable  ;do not appear in variant list for loadouts, but display in ship editor variant list
;(Ship stats go below as per the norm)

Code: [Select]
;Target box
SSJ bad guy
SJ Sathanas
Variant: SJ Amritaya


I have one more query about fighterbeams but I suppose I should just stop moping and load the game again to see what has changed...  :nervous:
Title: Re: Two questions: missile lock and variants
Post by: AdmiralRalwood on October 09, 2016, 02:24:26 am
The short question:
1) Is the missile multi-lock part of trunk now or is it still WOD-specific code?
Still WoD-specific for now, but if you want an up-to-date master-branch build that includes the multilock changes, it shouldn't be much effort to compile one.

2) Last I remember ship templates were broken because of how data was being copied around. (correct me if I'm wrong please!)
You aren't wrong; they used to be broken. However, they're not anymore! I spent a lot of effort getting them working again, after we moved to Git, and the fruits of that labour wound up in FSO 3.7.4.

However, templates are rather limited in and of themselves, which led me to make that thread (http://www.hard-light.net/forums/index.php?topic=92349.0) you linked. I highly recommend you add your thoughts to that thread, actually (don't worry about how long it's been since it was posted in; it'll be a relevant post, and I'm far more likely to look at that thread when I finally get around to implementing variants than this one).

I'm no adequate coder so I dunno the complexity, but off the top of my head, I know this would need custom UI and enough code changes to FSO and FRED that there's no point doing it unless any campaign of considerable reputation decides to use it en masse. And I don't know how this can be extended to unplayable ships e.g. capitals.
Firstly, capital ships aren't unplayable; they're just not playable by default because tablers don't usually give them the "player_ship (http://hard-light.net/wiki/index.php/Ships.tbl#.22player_ship.22)" flag. There are several good examples of missions entirely designed around player-flown capital ships (some using advanced scripting to give the player detailed control over the ship's turrets, and some not).

Secondly, I don't see any reason why the idea as you've described it would need a custom UI or code changes. It sounds like you could do it just by adding new entries to the ships.tbl (or more likely a -shp.tbm) that are slightly-modified versions of existing ships, and then just putting them in mission loadouts and letting the player select them as usual.
Title: Re: Two questions: missile lock and variants
Post by: X3N0-Life-Form on October 09, 2016, 03:27:57 am
Yeah, you're not the first person to think about having a variant system in FSO.

Back when templates didn't work, I made my own script-based solution (they're still on the scripting board's first page (http://www.hard-light.net/forums/index.php?board=145.0)), but it has its limits and most people probably don't want to bother with scripts. An in-engine solution like Ralwood proposed would very likely work much better.
Title: Re: Two questions: missile lock and variants
Post by: asyikarea51 on October 09, 2016, 10:10:02 am
Yeah a non-coder (more like I degraded back to zero after never touching the not-really-useful school assignments in forever) like me would probably go uncomfortable with scripts. I reckon it might be the same for other lurker n00bs, if it isn't part of the core engine and/or easily located, it isn't likely to be used quickly and by many modders, at least that's what I think. FWIW I don't know how to use variables in FRED either (despite coming from FRED1)... but that's another conversation.

It's true that for a small-scale mod, just cramming new shipclass entries into ships.tbl and going from there would work, you guys are right - players would just have to be careful not to pick the wrong icon at pre-mission loadout, but I dunno, at the time my brain just went, "the UI/editor loadout menus would have to be edited is if someone decides to use the feature across the board". I guess something, whatever it is, is just triggering my nitpicky-ness there. :banghead:

I thought I was doing something wrong with my own data set when I still had that old mod, then I did the Artemis template guide and then I saw the really weird behaviour in both normal and debug builds back then. Last time I read it was slated to be abandoned - and just by looking I could see why, I didn't expect it to get fixed anyway. And since it added to the ship count limit = you might as well just do a conventional entry in ships.tbl. Totally didn't know someone actually done all-out fixed it! :nervous:

Somewhere in my head is visualising a really nice laid-up pre-mission loadout screen, ship select and wing command is the same, but next to the ship select, you have a variant select with counts like missile ammo. Then to simulate 'new build hulls' vs 'incremental upgrades', just permanently remove the older variants from loadout (or maybe a global flag to block use of null as default, then use a cut-down ships.tbl and expand the ship_variants.tbl). Then below the top-right would be Tachyon-style 'add-on mods' selection... though how to make such add-on ship mods actually do something in missions is another thing altogether :shaking: since things like the radar in FSO is unlimited range...

Surprised that multi-lock isn't part of the main branch, here's hoping it does sooner or later. But oh well, anybody can wish, making it is another! Anyway if this variant thought strikes me again I'll go post in the other thread. Might not be the first, but at least I finally got this lingering thought out of my system.
Title: Re: Two questions: missile lock and variants
Post by: Bryan See on November 15, 2016, 11:18:25 am
Speaking of multi-missile lock in this thread, is it possible to modify the weapons.tbl and code in some way to allow that?
Title: Re: Two questions: missile lock and variants
Post by: DahBlount on November 15, 2016, 02:15:52 pm
It's already been done, see the WoD mod. The code is not currently merged into master because the main branch containing it has not been updated to most recent master afaik and WoD uses custom builds that feature multi-lock and some BMPMan changes which would never get merged into master.
Title: Re: Two questions: missile lock and variants
Post by: niffiwan on November 15, 2016, 05:34:11 pm
Due to some BMPMAN slot usage cleanup in master, WoD probably doesn't need that bumped BMPMAN limit anymore.  ~probably~
Title: Re: Two questions: missile lock and variants
Post by: Bryan See on November 15, 2016, 10:32:14 pm
Is it possible to get the WoD team to port the multi-missile lock to master so that the mods running FSOpen (including Shattered Stars) benefit? Either way, we can include smoother, exponentially accelerating/decelerating features of missile locks.
Title: Re: Two questions: missile lock and variants
Post by: DahBlount on November 15, 2016, 11:00:37 pm
Not at the moment, no.