Lava Shader 2.3, Drop in package for your map

Lava Shader 2.3, Drop in package for your map

Discuss Lua based Spring scripts (LuaUI widgets, mission scripts, gaia scripts, mod-rules scripts, scripted keybindings, etc...)

Moderator: Moderators

User avatar
The Yak
Posts: 351
Joined: 20 May 2012, 05:36

Lava Shader 2.3, Drop in package for your map

Post by The Yak »

Image

http://springfiles.com/spring/lua-scrip ... op-package

Now on github: https://github.com/The-Yak/lavashader

2.3:
-added new lavatex by qray
-fixed lavalevel errorspam with some games
-renamed lava2.1.lua to lava.lua (for easy overwriting for future updates)

2.2 changes:
-extended lava beyond map edges
-removed foam.tga (unused)
-optimized lavasplosions (thanks nixtux)

2.1 Changes:
-fixed messed up partially see through units if /luashaders off
-added readme

----------------------------------------

For example usage see map Violence_3

----------------------------------------

Includes:
-Lava gadget (GPL)
-hover playable lava
-working GLSL shader
-dynamic edge glow
-several different seamless lava textures (default seen above)
-improved lavasplosions (thanks [BoS]nixtux)
-hover damage workaround
-lava ambiance widget

How do I use this shit in my map?

Just extract the .7z into your map folder. That's all, works out of the box. Set voidwater=0 in your mapconfig or you will see water flicker above lava on some settings.

How do I change the lavatexture?

Find all instances of lavacolor3.png in lava.lua and change to desired image (make sure it's in /LuaRules/images/). One changes texture for GLSL shader and one for fallback mode.

Can I change the height of the lavaplane?

Yes, just change lavaLevel, but this will break hover playability. Right now it is set equal to waterlevel.

Can this extend beyond map edges/onto an infinite plane?

As of version 2.2 somewhat, not an infinite plane but a large one

Who is behind this?

Assembled by The_Yak
Knorke, Beherith, Anarchid, The_Yak - Lava gadget
Audionautics, e__ - Lava SFX from freesound.org
lava textures - yhughes, mavrosh, sadronmeldir, qray
Kloot - Hover waterdamage workaround
[BoS]nixtux - Improved lavasplosions
Last edited by The Yak on 05 May 2015, 20:59, edited 11 times in total.
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: Lava Shader 2.0, Drop in package for your map

Post by smoth »

this looks pretty awesome!
User avatar
PicassoCT
Journeywar Developer & Mapper
Posts: 10450
Joined: 24 Jan 2006, 21:12

Re: Lava Shader 2.0, Drop in package for your map

Post by PicassoCT »

User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: Lava Shader 2.0, Drop in package for your map

Post by Forboding Angel »

I like you. Have I ever told you that?
User avatar
Beherith
Posts: 5145
Joined: 26 Oct 2007, 16:21

Re: Lava Shader 2.0, Drop in package for your map

Post by Beherith »

Sweet stuff, thanks man!
User avatar
The Yak
Posts: 351
Joined: 20 May 2012, 05:36

Re: Lava Shader 2.0, Drop in package for your map

Post by The Yak »

update 2.1:
-fixed messed up partially see through units if /luashaders off
-added readme
User avatar
The Yak
Posts: 351
Joined: 20 May 2012, 05:36

Re: Lava Shader 2.2, Drop in package for your map

Post by The Yak »

-update 2.2
Image

Lava is now extended beyond map edges, lavasplosions have optimized drawRadius (thanks again nixtux)
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: Lava Shader 2.2, Drop in package for your map

Post by smoth »

any possibility you will consider allowing it to receive fog.
User avatar
Cheesecan
Posts: 1571
Joined: 07 Feb 2005, 21:30

Re: Lava Shader 2.2, Drop in package for your map

Post by Cheesecan »

This is excellent, I asked for this a few years ago when I was working on a new map. Now I could theoretically finally finish it, if I felt like it. :-)
User avatar
The Yak
Posts: 351
Joined: 20 May 2012, 05:36

Re: Lava Shader 2.2, Drop in package for your map

Post by The Yak »

smoth wrote:any possibility you will consider allowing it to receive fog.
What do you mean by allowing to receive? Does the lua fog gadget not work with lava? Or are you referring to mapconfig fog setting?
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: Lava Shader 2.2, Drop in package for your map

Post by smoth »

Map fog.
User avatar
The Yak
Posts: 351
Joined: 20 May 2012, 05:36

Re: Lava Shader 2.2, Drop in package for your map

Post by The Yak »

Not a bad idea at all but I've got other stuff going on and won't be working on lava shader anytime in the near future
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: Lava Shader 2.2, Drop in package for your map

Post by smoth »

No problem, just wanted to raise awareness of it. I figured it probably slipped your mind
User avatar
qray
Posts: 377
Joined: 02 Feb 2009, 18:49

Re: Lava Shader 2.2, Drop in package for your map

Post by qray »

I would like to use the drop-in package in a new map. But unfortunately I am getting spammed with this error message with the latest version 2.2 from springfiles:

Code: Select all

[f=0000000] Error: LuaRules::RunCallIn: error = 2, GameFrame, [Internal Lua error: Call failure] [string "LuaRules/Gadgets/lava2.1.lua"]:249: attempt to perform arithmetic on global 'lavaLevel' (a nil value)
stack traceback:
	[string "LuaRules/Gadgets/lava2.1.lua"]:249: in function 'GameFrame'
	[string "LuaRules/gadgets.lua"]:838: in function <[string "LuaRules/gadgets.lua"]:836>
	(tail call): ?
I have to admit, that I do not fully understand the gadget yet. In line 249 there's:

Code: Select all

_G.lavaLevel = lavaLevel+math.sin(f/30)*2
If I get it right, "_G "has sth. to do with global variables shared between synced and unsynced? But it seems this does not work correctly as lavalevel is not defined in the unsynced part .
What puzzles me a bit, that the same calculation is done also in the synced part in line 82. This might contradict my understanding that this is a global variable :wink:

Am I the only one getting this error message or did this just go unnoticed so far? Would a SendToUnsynced to transfer the lavalevel value from synced to unsynced help here?


To reproduce: I get this error also in the current version 4.1 of Violence


EDIT:
Attached an additional lava texture option I made, in case you like to include it.
Attachments
lavacolor5.png
(2.01 MiB) Not downloaded yet
User avatar
PicassoCT
Journeywar Developer & Mapper
Posts: 10450
Joined: 24 Jan 2006, 21:12

Re: Lava Shader 2.2, Drop in package for your map

Post by PicassoCT »

Code: Select all

if not _G.lavaLevel then _G.lavaLevel =lavaLevel+math.sin(f/30)*2 end
_G.lavaLevel = lavaLevel+math.sin(f/30)*2
User avatar
The Yak
Posts: 351
Joined: 20 May 2012, 05:36

Re: Lava Shader 2.2, Drop in package for your map

Post by The Yak »

That error spam is already fixed, but I don't have my computer for the time being and can't upload the new version, sorry.

The 2 calculations you have observed for lavalevel are redundant, one of them needs to be removed (I forget which) and this will fix it.

You can play the map with ZK to avoid error spam for the time being.
User avatar
qray
Posts: 377
Joined: 02 Feb 2009, 18:49

Re: Lava Shader 2.2, Drop in package for your map

Post by qray »

Cool, that's very good news! I'll wait then for the update.
The Yak wrote:You can play the map with ZK to avoid error spam for the time being.
For the development phase it's not a show stopper here. Just wanted to get rid of them before map release :-) (and report the bug)
User avatar
The Yak
Posts: 351
Joined: 20 May 2012, 05:36

Re: Lava Shader 2.3, Drop in package for your map

Post by The Yak »

updated to 2.3

EDIT: Also commited to github https://github.com/The-Yak/lavashader
User avatar
qray
Posts: 377
Joined: 02 Feb 2009, 18:49

Re: Lava Shader 2.3, Drop in package for your map

Post by qray »

Great. Thanks a lot!
Works like a charm now :-)
User avatar
The Yak
Posts: 351
Joined: 20 May 2012, 05:36

Re: Lava Shader 2.3, Drop in package for your map

Post by The Yak »

Lavasplosions are now broken again for all maps that I tested. Anyone know why?
Post Reply

Return to “Lua Scripts”