Hard Light Productions Forums

Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: Fury on February 17, 2010, 10:24:46 am

Title: Weapon templates
Post by: Fury on February 17, 2010, 10:24:46 am
For 3.7.0, perhaps someone would be kind enough to implement this for weapons? http://www.hard-light.net/wiki/index.php/Ship_Templates
Title: Re: Weapon templates
Post by: Nuke on February 17, 2010, 12:44:49 pm
ditto

this would actually be even more useful that ship templates, especially in mods that use lots of weapon variants. such as versions of weapons used on specific ships that differ from the standard issue.

could this also include a feature to make such variants of the same weapons appear as the same weapon in the loadout screen. for example if a ship uses Cyclops#short and another ship uses Cyclops, only one cyclops is shown in the loadout (instead of showing icons for both Cyclops and Cyclops#short). possibly by addind an $alias: ("Cyclops", "Cyclops#short"). so if you try to arm a ship that can only take Cyclops#short with a cyclops, it will check the alias list and if a string in it matches the current banks loadout options, will arm that ship with that particular weapon. if a weapon appears in the aliased list it need not be in the mission's loadout option, it would be assumed to be a Cyclops and and the number of cyclops available will be decreased. if alternate versions appear in the team loadout then they would appear in the loadout list, so that current mods wont be broken.
Title: Re: Weapon templates
Post by: Zacam on February 17, 2010, 03:54:25 pm
I like that aliasing option.

Though, if something can take the Cyclops#short, it can take a regular Cyclops. The differences in the two is so frikken stupid somebody should be shot for it.
Title: Re: Weapon templates
Post by: Nuke on February 17, 2010, 04:29:16 pm
i just used it as an example. a more realistic scenario would be a variant of a swarm missile (called "bob" for lack of a better name) that fires more missiles than the regular version, which is used on assault fighters. to set something up youd have these in your weapon tables:

template for weapon with alias flags
standard version of that weapon (named "bob")
enanced version of that version of that weapon with swarm count increased (named "bob#enhanced"

then in the mission you add the standard version to the loadout list (tick "bob")

it the ship tables:
normal fighters get the standard version of the weapon ($Allowed SBanks: ("bob" ...)
assault fighters get the enhanced version ($Allowed SBanks: ("bob#enhanced" ...)

in mission loadout only "bob" is available, assigning bob to normal fighter will add "bob" to it, but if its an assault fighter and you try to equip "bob", it apears that it has happened however "bob#enhanced is the weapon you actually get.
Title: Re: Weapon templates
Post by: Wanderer on February 20, 2010, 01:54:31 am
If some one can resolve the ship template issues then there might be chance for this to be used as well.
Title: Re: Weapon templates
Post by: asyikarea51 on February 20, 2010, 06:01:12 am
If some one can resolve the ship template issues then there might be chance for this to be used as well.

I find with ship templates things have to be set up in a really strict way (i.e. not flexible at all) or weird stuff occurs.

Something I noticed only last week, haven't got around to Mantis, depending on how the table was done up you can have "Heavy Bomber" appear on the loadout screen from out of nowhere... on the GTB Artemis (and/or DH depending on what lines were added/removed/edited in the table).

And the Artemis is nowhere near heavy. :wtf:
Title: Re: Weapon templates
Post by: Wanderer on February 20, 2010, 10:24:14 am
Take some malloc, bit of memcpy, add some STL vectors, and a half bowl of string pointers, mix well and serve, and you get the issues like currently with the ship templates

Or that is how at least the issue seems to be caused ATM.