DayZ
61 ratings
sFramework_experimental
   
Award
Favorite
Favorited
Unfavorite
Type: Mod
Mod Type: Mechanics
File Size
Posted
Updated
781.828 KB
15 Sep, 2022 @ 9:28am
23 Apr @ 7:30am
13 Change Notes ( view )

Subscribe to download
sFramework_experimental

In 1 collection by simonvic
sUDE_experimental
3 items
Description





Information

WARNING
This is an experimental version of the mod meant for testing purposes. It may be unstable; use at your own risk.

sFramework is the core of the sUDE project.

It ships many features and utilities used and/or implemented by sUDE modules :
  • Advanced PostProcessing
  • Cameras Overlays
  • Game and User configuration interface
  • Helper classes and utilities for developing and debugging
  • Improvements to base game classes
  • more...

PostProcessing effects
sFramework ships a centralized post processing effects manager, with the goal of allowing multiple requests of the same effects, without hardcoding them.

SPPEffect
SPPEffect is the "container" of any PostProcess Effect you wish to add to it (e.g. saturation, vignette, motion blur etc.).

SPPEffect myPPE = new SPPEffect();

To add a parameter use the provided setters:
myPPE.setVignette(intensity, color); myPPE.setRadialBlur(powerX, powerY, offsetX, offsetY); myPPE.setChromAber(powerX, powerY); //...

To apply it, "hand it over" to the SPPEManager, which will calculate the correct value of all active SPPEffect and then apply it

SPPEManager.activate(myPPE); //SPPEManager.deactivate(myPPE); // to deactivate the effect

SPPEffectAnimated
A SPPEffectAnimated is just like a SPPEffect, but it has an animation mechanism which allows you to animate the values of a PostProcess effect.

A SPPEffectAnimated is an abstract class. You need to implement it with your own class and override the onAnimate() method, which will be called on every frame.

There also is a timed variant SPPEffectTimed, which will be automatically deactivated once a certain amount has passed.

To create your animation, simply extend either SPPEffectAnimated or SPPEffectTimed
class MyLoopAnimation : PPELoopedParams{ override void onAnimate(float deltaTime){ /* change PPE values here setOverlay(...); setChromAber(...); setCameraEffects(...); */ setVignetteIntensity( Math.Sin(getTime()) ); } } class MyTimedAnimation : SPPEffectTimed{ override void onAnimate(float deltaTime){ setVignetteIntensity( Math.Cos(getTime()) ); } }

A SPPEffectTimed also has a "duration" which can be set with the constructor, or the provided method:
MyTimedAnimation myTimedAnimation = new MyTimedAnimation(6); // the animation will last 6 seconds myTimedAnimation.setDuration(10.0); // the animation will last 10 seconds

The activation of the animation is identical to any other SPPEffect
MyLoopAnimation myAnimation = new MyLoopAnimation(); SPPEManager.activate(myAnimation); MyTimedAnimation myTimedAnimation = new MyTimedAnimation(5.5); SPPEManager.activate(myTimedAnimation);

If you want to manually manage the animation you can use the provided methods
myAnimation.start(); // Set the animation state to "Playing" myAnimation.stop(); // Reset the time and set the animation state to "Stopped" myAnimation.pause(); // Freeze the animation values and set the animation state to "Paused" myAnimation.resume(); // Resume the the animation and set the animation state to "Playing"

Camera Overlays
A camera overlay is nothing else than an image, used like an HUD. The fundemental unit of camera overlays is the SCameraOverlay, a very simple wrapper for the ImageWidget (the DayZ UI component that holds an image).

It can be used in countless ways:

As an animated UI :


or for emulating headgear damage:

(from sVisual, MotoHelmet in various health state: Pristine, Worn, Damaged, BadlyDamaged and Ruined)


Defining an overlay is very simple and very similar to SPPEffects, in fact there are three types as well and the logic is identical to the SPPEffects:
class MyAnimatedOverlay : SCameraOverlayAnimated { override void onInit(){ setImage("path/to/texture.edds"); //... } //onAnimate() gets called every frame! override void onAnimate(float deltaTime){ setSize(Math.Sin(getTime())); //setPosition(...) //setRotation(...) //setMask(...) //... } }

To activate/deactivate an overlay, you use the SCameraOverlayManager:
SCameraOverlaysManager.getInstance().activate(myOverlay);

A SCameraOverlay has many attributes you can play with, which can be set either by scripts or in the config. Currently available attributes are:
image=""; // Resource image path, can be whatever an ImageWidget accepts texture alpha=1.0; // [0.0 - 1.0] Alpha value (transparency) mask=""; // Resource image path, can be whatever an ImageWidget accepts as mask maskProgress=1.0; // [0.0 - 1.0] Mask progress maskTransitionWidth=1.0; // Mask transition width (used as progress + transitionWidth) position[] = {0.0, 0.0}; // [0.0 - 1.0] X and Y position in screenspace size[] = {1.0, 1.0}; // [0.0 - 1.0] X and Y size in screenspace rotation[] = {0.0, 0.0, 0.0}; // Yaw, Pitch and Roll defined in degrees priority = 0; // Higher priority means closer to the camera (also known as z-depth) targetCameras[] = {"DayZPlayerCamera"}; // Camera typename on which the overlay will be visible hidesWithIngameHUD = 0; // [0 = false, 1 = true] Determines if it must hides when the player hides the ingame HUD

Utilities
sFramework also has many other utilities such as:
  • sUserConfig : to help in storing and loading custom client settings
  • sRaycast : to help launching raycasts with more flexibility
  • sSpawnable : to help in spawning many items with multiple attachments
  • sFlagOperator : to help dealing with bitwise operations with flags
  • sColor, sLog, sGameConfig and more...
For a better insight of the tools, give a look at the github page

Github page
For a better insight give a look at the github page: https://github.com/simonvic/sFramework

Need help?
Come over to my DISCORD[discord.gg]

Monetization
You are hereby given monetization approval, as long as you follow the DayZ Server Monetization rules[www.bohemia.net] and have obtained permission from Bohemia

Repack
You are NOT allowed to repack any part of this mod, unless given my explicit consent


Contact me
Found a bug or want to give a suggestion? Feel free to contact me!
Discord server: DISCORD[discord.gg]


Buy me a coffee
[paypal.me]