66ee36d1a5bf4

66ee36d1a64ef
1 Guest is here.
 

Topic: Better Weapon Info test Read 143 times  

66ee36d1a6dfaZylonBane

66ee36d1a6e62
This mod is an attempt to turn SS2's weapon settings MFD into something more like the weapon panel in Deus Ex, displaying detailed weapon stats and which stats have been affected by modification. The primary motivation for this was to allow players to directly see the effects of the SCP Tinker OS upgrade (which improves the effect of all weapon modifications), but it should be useful for non-SCP players as well.

There were some interesting challenges with this:

The script API, somewhat surprisingly, doesn't have functions for unloading weapons or changing their fire modes, so all the engine code that does this had to be re-implemented in Squirrel.

The overlay API provides no functionality for buttons or scrolling text boxes. You have to roll all that yourself.

The overlay API provides no functionality for replacing existing MFD panels or otherwise integrating with the MFD system. Creating the illusion of having done so can only be accomplished by acts of rank skulduggery.

The overlay API provides no functionality for rotating bitmaps. Since I wanted to display the weapon icon at the top of the panel, but all the weapon icons are oriented vertically, I ended up using the sub-bitmap rendering function to redraw the bitmaps into a rotated orientation, one pixel at a time. This in turn required drawing the weapon icons into a "transparent" overlay, which has the advantage of not needing to be re-rendered every frame, so this rotation process could be done only once when the panel is first opened. An earlier version of this mod just included pre-rotated icon bitmaps, but that would have made this incompatible with mods that include their own weapon icons, and we can't have that now can we.

Turns out that in Dark, projectile velocities are non-linear. For example, input of velocities from 1 - 10 results in actual velocites per velocity unit of:
- 1: DU/Sec: 0.40
- 2: DU/Sec: 0.70
- 3: DU/Sec: 0.80
- 4: DU/Sec: 0.85
- 5: DU/Sec: 0.88
- 6: DU/Sec: 0.90
- 7: DU/Sec: 0.92
- 8: DU/Sec: 0.93
- 9: DU/Sec: 0.94
- 10: DU/Sec: 0.942
(DU = DromEd Units)

They eventually converge on a 1:1 relationship once velocities get around the 50s, but still, this makes the projectile velocities reported somewhat approximate. On top of that, there's never been any well-defined relationship established between DromEd units and real-world distances, so this entire stat is a bit wobbly.

And sadly, there appears to be no way for Squirrel to detect mousewheel events, so I couldn't replicate NewDark's cool mousewheel scrolling of text boxes. You gotta use the scroll buttons like some kind of savage.

Anyway, the mod in its current state reports the following info about each weapon. Any modified stats are indicated by the percentage change from the base stat.
- Modification level + description
- Condition
- Fire mode (semi-auto, full auto, burst)
- Fire rate
- Ammo per shot
- Clip size/energy capacity
- Projectile velocity
- Reload time
- Reliability
- Stat requirements to equip, maintain, modify, and repair
- Ammo type(s) used

What's not yet reported is damage per shot and kickback. These both require consolidating a large amount of information into a single number, and I haven't figured out yet what the best way is to go about this. Damage in particular is going to be a huge pain in the ass due to all the different ways there are to implement damage sources in Dark.

And I reaaalllly doubt this will play well with RSD. It would be nice if it did, but RSD commits a lot of upgrade and UI shenanigans of its own.

« Last Edit: 17. September 2024, 12:27:11 by ZylonBane »

66ee36d1a6fcfDark-Star88

  • Company: I freaking wish
66ee36d1a7020
DAMN!  :stroke:

ZB still figuring out how to make the Dark engine dance like a monkey!

Don't feel bad that you couldn't do all you wanted, it's amazing you got this far! I'll give it a look-see soon.

66ee36d1a7132voodoo47

66ee36d1a7185
had the CZ translation loaded when trying this, the text part is not compatible obviously, but oddly enough, the button on the left is translated while the one on the right is not.

need to find the texture name somehow.

66ee36d1a727dZylonBane

66ee36d1a72cb
The text displayed on the mode switch button is pulled from the same string file the weapon HUD uses, so it will get translated. There is no vanilla string that just says "UNLOAD" though. In the vanilla Settings panel the text on that button is part of the bitmap. "SETTINGS" should be localized though, since it loads the original background and pastes just the label part over the custom background that this uses. If you look at iface/wsettbkg.png in this mod you'll see that the label region is blank.

I'll eventually break out all the non-vanilla text into a standalone string file so this can be easily localized.
Acknowledged by: voodoo47

66ee36d1a735fZylonBane

66ee36d1a73a9
Download updated. Now displays weapon condition icon, and all text now translatable via external string file.

Your name:
This box must be left blank:

A familiar passcode with 3 digits:
1 Guest is here.
Today at 00:00:57
Contact SMF 2.0.19 | SMF © 2016, Simple Machines | Terms and Policies
FEEP
66ee36d1a88df