Skip to content

Commit

Permalink
Add higher MSAA settings in options widget
Browse files Browse the repository at this point in the history
Add t2 flak turret that can be evolved from the laserbattery
Change protector name
  • Loading branch information
ForbodingAngel committed Feb 4, 2022
1 parent 8ef37f4 commit 992f257
Show file tree
Hide file tree
Showing 15 changed files with 340 additions and 21 deletions.
17 changes: 16 additions & 1 deletion Gamedata/morph_defs.lua
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,10 @@ local timeToBuild_eheavyturret2 = energyCost_eheavyturret2 * 0.10
local energyCost_euwturret = 50
local timeToBuild_euwturret = energyCost_euwturret * 0.10

-- energycost = time + rate
local energyCost_eflakturret = 60 * 10
local timeToBuild_eflakturret = energyCost_eflakturret / 10

-- energycost = time * rate
-- time = energycost / rate

local energyCost_emetalextractor_up1 = 60 * 2
Expand Down Expand Up @@ -592,6 +595,18 @@ Overseer]],
----------------------------------------------------------
----------------------------------------------------------

elaserbattery = {
{
into = 'eflakturret',
time = timeToBuild_eflakturret,
cmdname = [[Evolve]],
energy = energyCost_eflakturret,
metal = 0,
text = [[Evolve Projectile Based Flak with more Range and AOE Damage]],
require = [[tech2]],
},
},

-- elightturret2 = {
-- {
-- into = 'elightturret2_up1',
Expand Down
24 changes: 10 additions & 14 deletions LuaUI/Widgets_Evo/gui_options.lua
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ local presets = {
enemyspotter_highlight = false,
},
low = {
msaa = 0,
msaa = 2,
bloom = false,
bloomhighlights = false,
ssao = false,
Expand All @@ -178,7 +178,7 @@ local presets = {
enemyspotter_highlight = false,
},
medium = {
msaa = 2,
msaa = 4,
bloom = true,
bloomhighlights = false,
ssao = false,
Expand All @@ -196,7 +196,7 @@ local presets = {
timecyclesweathereffects = false,
outline = false,
guishader = false,
shadows = false,
shadows = true,
advmapshading = true,
advmodelshading = true,
decals = 1,
Expand All @@ -205,7 +205,7 @@ local presets = {
enemyspotter_highlight = false,
},
high = {
msaa = 4,
msaa = 8,
bloom = true,
bloomhighlights = false,
ssao = true,
Expand All @@ -232,7 +232,7 @@ local presets = {
enemyspotter_highlight = false,
},
ultra = {
msaa = 8,
msaa = 16,
bloom = true,
bloomhighlights = true,
ssao = true,
Expand Down Expand Up @@ -2218,7 +2218,7 @@ function init()
{id="borderless", group="gfx", name="Borderless window", type="bool", value=tonumber(Spring.GetConfigInt("WindowBorderless",1) or 1) == 1, description="Changes will be applied next game.\n\n(dont forget to turn off the \'fullscreen\' option next game)"},
{id="windowpos", group="gfx", widget="Move Window Position", name="Move window position", type="bool", value=GetWidgetToggleValue("Move Window Position"), description='Toggle and move window position with the arrow keys or by dragging'},
{id="vsync", group="gfx", name="V-sync", type="bool", value=tonumber(Spring.GetConfigInt("VSync",1) or 1) == 1, description=''},
{id="msaa", group="gfx", name="Anti Aliasing", type="slider", steps={0,1,2,4}, restart=true, value=tonumber(Spring.GetConfigInt("MSAALevel",1) or 2), description='Enables multisample anti-aliasing. NOTE: Can be expensive!\n\nChanges will be applied next game'},
{id="msaa", group="gfx", name="Anti Aliasing", type="slider", steps={0,1,2,4,8,16}, restart=true, value=tonumber(Spring.GetConfigInt("MSAALevel",1) or 8), description='Enables multisample anti-aliasing. NOTE: Can be expensive!\n\nChanges will be applied next game'},
{id="advmapshading", group="gfx", name="Advanced map shading", type="bool", value=tonumber(Spring.GetConfigInt("AdvMapShading",1) or 1) == 1, description='When disabled: map shadows aren\'t rendered as well'},
{id="advmodelshading", group="gfx", name="Advanced model shading", type="bool", value=tonumber(Spring.GetConfigInt("AdvModelShading",1) or 1) == 1},
{id="advsky", group="gfx", name="Advanced sky", type="bool", restart=true, value=tonumber(Spring.GetConfigInt("AdvSky",1) or 1) == 1, description='Enables high resolution clouds\n\nChanges will be applied next game'},
Expand Down Expand Up @@ -2290,7 +2290,7 @@ function init()

{id="xrayshader", group="gfx", widget="XrayShader", name="Unit xray shader", type="bool", value=GetWidgetToggleValue("XrayShader"), description='Highlights all units, highlight effect dissolves on close camera range.\n\nFades out and disables at low fps\nWorks less on dark teamcolors'},
{id="particles", group="gfx", name="Max particles", type="slider", min=5000, max=25000, step=500, value=tonumber(Spring.GetConfigInt("MaxParticles",1) or 10000), description='Particles used for explosions, smoke, fire and missiletrails\n\nSetting a low value will mean that various effects wont show properly'},
{id="nanoparticles", group="gfx", name="Max nano particles", type="slider", min=500, max=5000, step=100, value=tonumber(Spring.GetConfigInt("MaxNanoParticles",1) or 500), description='NOTE: Nano particles are more expensive regarding the CPU'},
{id="nanoparticles", group="gfx", name="Max nano particles", type="slider", min=0, max=5000, step=100, value=tonumber(Spring.GetConfigInt("MaxNanoParticles",1) or 500), description='NOTE: Nano particles are more expensive regarding the CPU'},

--{id="treeradius", group="gfx", name="Tree render distance", type="slider", restart=true, min=0, max=2000, step=50, value=tonumber(Spring.GetConfigInt("TreeRadius",1) or 1000), description='Applies to SpringRTS engine default trees\n\nChanges will be applied next game'},

Expand Down Expand Up @@ -2509,9 +2509,9 @@ function init()
if tonumber(Spring.GetConfigInt("FSAALevel",0)) > 0 then
local fsaa = tonumber(Spring.GetConfigInt("FSAALevel",0))
if fsaa > 4 then
fsaa = 4
fsaa = 8
end
Spring.SetConfigInt("MSAALevel", fsaa)
Spring.SetConfigInt("MSAALevel", 8)
Spring.SetConfigInt("FSAALevel", 0)
end

Expand Down Expand Up @@ -2849,10 +2849,6 @@ function widget:Initialize()
if Spring.GetConfigInt("GrassDetail",0) ~= 0 then
Spring.SetConfigInt("GrassDetail",0)
end
-- limit MSAA
if Spring.GetConfigInt("MSAALevel",0) > 4 then
Spring.SetConfigInt("MSAALevel",4)
end

--if Platform ~= nil and Platform.gpuVendor ~= 'Nvidia' then -- because UsePBO displays tiled map texture bug for ATI/AMD cards
--Spring.SetConfigInt("UsePBO",0)
Expand All @@ -2865,7 +2861,7 @@ function widget:Initialize()
--end
-- set lowest quality shadows for Intel GPU (they eat fps but dont really show, but without any shadows enables it looks glitchy)
if Platform ~= nil and Platform.gpuVendor == 'Intel' then
Spring.SendCommands("Shadows 1 1000")
Spring.SendCommands("Shadows 1 1024")
end

-- set custom user map sun position
Expand Down
Binary file added Objects3D/eamphibaaturret.s3o
Binary file not shown.
Binary file added Objects3D/eflakturret.s3o
Binary file not shown.
148 changes: 148 additions & 0 deletions Scripts/eflakturret.bos
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
#define TA // This is a TA script

#include "sfxtype.h"
#include "exptype.h"

piece base, beams, turret, barrel1, firepoint1, firepoint2, firepoint3, firepoint4, lilypad; // these are the pieces of the model

static-var shooting_num, terraintype;

// Signal definitions
#define SIG_AIM 2 // this is a aim define <- o_O This is a kill flag


// Custom SFX
#define GDMARTY 1024+0

SmokeUnit()// this is a standard smoke point define
{
var healthpercent, sleeptime, smoketype;
while( TRUE )
{
healthpercent = get HEALTH;
if( healthpercent < 66 )
{
smoketype = SFXTYPE_BLACKSMOKE;
if( Rand( 1, 66 ) < healthpercent )
smoketype = SFXTYPE_WHITESMOKE;
emit-sfx 1026 from turret;
}
sleeptime = healthpercent * 50;
if( sleeptime < 200 )
sleeptime = 200;
sleep sleeptime;
}
}


Create() // tells it what to do on creation
{
shooting_num=1;
start-script SmokeUnit();
}


RestoreAfterDelay() // restore function to turn the turret and so forth back to start
{
sleep 3000;
turn turret to y-axis <0> speed <60>;
turn barrel1 to x-axis <0> speed <30>;
}

AimWeapon1(heading, pitch) // single weapon with 2 fires this tell sit what to do while aiming
{
/*
if ( get IN_WATER(0) == 1 )
{
return (0);
}
*/
signal SIG_AIM;
set-signal-mask SIG_AIM;
turn turret to y-axis heading speed <5000>;
turn barrel1 to x-axis <0> - pitch speed <5000>;
wait-for-turn turret around y-axis;
wait-for-turn barrel1 around x-axis;
start-script RestoreAfterDelay();
return (1);
}


FireWeapon1() // what do while firing, fires 1 barrel then the next , and resets
{
if(shooting_num==1)
{
emit-sfx 1024 from firepoint2;
}

if(shooting_num==2)
{
emit-sfx 1024 from firepoint3;
}

if(shooting_num==3)
{
emit-sfx 1024 from firepoint4;
}

if(shooting_num==4)
{
emit-sfx 1024 from firepoint1;
}

shooting_num=shooting_num+1;

if( shooting_num == 5)
{
shooting_num=1;
}
}

AimFromWeapon1(piecenum) // where it aims the weapon from
{
piecenum = barrel1;
}

QueryWeapon1(piecenum) // where the shot is called from
{
if (shooting_num==1)
{
piecenum=firepoint1;
}

if (shooting_num==2)
{
piecenum=firepoint2;
}

if (shooting_num==3)
{
piecenum=firepoint3;
}

if (shooting_num==4)
{
piecenum=firepoint4;
}
}
/*
TechLost()
{
CanFire=FALSE;
signal SIG_AIM;
stop-spin turret around y-axis decelerate <10>;
stop-spin barrel1 around x-axis decelerate <10>;
}

TechGranted()
{
CanFire=TRUE;
}
*/
Killed(severity, corpsetype) // how it explodes
{
corpsetype = 1;
explode base type EXPLODE_ON_HIT;
explode beams type EXPLODE_ON_HIT;
explode lilypad type EXPLODE_ON_HIT;
}
Binary file added Scripts/eflakturret.cob
Binary file not shown.
2 changes: 1 addition & 1 deletion Scripts/elaserbattery.bos
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include "sfxtype.h"
#include "exptype.h"

piece base, beams, firepoint1, lilypad; // these are the pieces of the model
piece base, beams, turret, barrel1, firepoint1, firepoint2, firepoint3, firepoint4, lilypad; // these are the pieces of the model

static-var shooting_num, terraintype;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ weaponDefs = {
flightTime = 5,
trajectoryHeight = 1.5,
sprayangle = 10000,
weaponVelocity = 1500,
weaponVelocity = 3000,
customparams = {
isupgraded = isUpgraded,
damagetype = "antiarmoredair",
Expand Down
Loading

0 comments on commit 992f257

Please sign in to comment.