SRB2 Message Board  

Go Back   SRB2 Message Board > Archived > Outdated Releases (2.1.X) > Lua (2.1.X)

 
 
Thread Tools
Object Shadows Details »»
Object Shadows
Version: 95% guarantee that it's not Shadow the Hedgehog, by TehRealSalt ((σᴥσ)) TehRealSalt is offline
Developer Last Online: Aug 2020

Category: Version: SRB2 Rating: (2 votes - 3.80 average)
Released: 04-15-2015 Last Update: 02-04-2017 Favourites: 4
SOCs Scripts Re-Useable Content Models Sprites/Graphics

This relatively simplistic addon adds drop shadows for both players and objects.

You may use the console variables "playershadows" and "objectshadows" to toggle them, and "addshadow <object>" to add a shadow to an object type. By default, object shadows are off as they can eat performance depending on what objects are whitelisted by the server. Add shadows to objects placed in huge quantities, such as rings, at you (and your computer's) own risk.

Also included is a MD2 for it, made to be perfectly 1:1 with the actual sprite in terms of look and size. To use it, add "OSHD OSHD.md2 2.0 0.0" to your md2.dat.

Special thanks go out to RedEnchilada for helping me with the original version of the script, and MonsterIestyn for finding a method to retrieve the validity of MT_ constants without Lua throwing an error message.

Download Now

File Type: zip objectshadows.zip (3.1 KB, 1435 views)

Screenshots

Click image for larger version

Name:	lua_playershadows.png
Views:	1386
Size:	42.2 KB
ID:	7498   Click image for larger version

Name:	lua_playershadows.gif
Views:	2369
Size:	1.09 MB
ID:	7499   Click image for larger version

Name:	Object Shadows & MD2.jpg
Views:	1430
Size:	102.3 KB
ID:	9611  

Supporters / CoAuthors

Show Your Support

  • The author of this addon has given explicit permission for its content to be re-used and/or reproduced.

Comments
Old 05-01-2015   #2
Sryder
'That brit'
Judge
 
Sryder's Avatar
Default

It's a pretty simple script, but it works. My only complaint is that it was a bit hard to actually see the shadow a lot of the time for me. It could also scale itself depending on the height difference from the character, maybe with a console variable? Finally, a console variable to disable them might also be nice in case people wanted to use the OpenGL sprite shadows, no point having 2 sets of shadows. Nothing I'm going to keep this back over though.
Sryder is offline  
Old 05-01-2015   #3
TehRealSalt
(σᴥσ)
Judge
 
TehRealSalt's Avatar
Default

Yep, I posted a gif of this a week or so ago and got some of the same critique; I just have to get around to implementing them.
__________________
Twitter | Not really around here anymore, working on my indie game over at Patreon
TehRealSalt is offline  
Old 05-02-2015   #4
Larz T
Siced
 
Larz T's Avatar
Default

Everything looks good so far... I thought I would just point this out:

Spoiler:



EDIT: Hmm... The shadow doesn't seem to appear anywhere else when the player is holding on to something. Disregard this post.
__________________
Quote:
Originally Posted by MaykeAdventuresZForever View Post
I been playing this since I was 9 years old and all I felt was anger.
YouTube

Avatar art done by TehRealSalt

Last edited by Larz T; 05-02-2015 at 04:09 PM.
Larz T is offline  
Old 05-30-2015   #5
golteam
Default


This Lua script doesn't work in Match, Tag and CTF.
golteam is offline  
Old 05-30-2015   #6
Lat'
Absolute territory where
 
Lat''s Avatar
Default

It's pretty dumb but the script doesn't check if there is a player mobj on the map, resulting in a "crash" when the script attempts to launch on a spectator player.

I know I'm dumb at Lua, but adding this at the start of the Hook fixes the problem:

Code:
addHook("ThinkFrame", function()
	for player in players.iterate do
	if not player.mo return end
__________________
Quote:
Originally Posted by MADVAL2 View Post
glad there is no Zero Two in this pack,i really get mad everytime i see Zero Two
Lat' is offline  
Old 02-18-2016   #7
TehRealSalt
(σᴥσ)
Judge
 
TehRealSalt's Avatar
Default

I meant to update this sooner (as in, the "sooner than nearly a year" type of sooner) to fix that bug, but I wanted to add more features. I was going to add even more to it, but I kinda like how it is now. (BTW, just to note, the above fix only half-worked. It prevents the error, but the shadow won't appear once you stop spectating. I had to do something slightly different. Thanks for helping, though; it pointed me towards my current fix!)

Now the sprite is darker, it shrinks depending on how high above the ground you are, and it has a cvar for turning them on/off (playershadows <bool>).
__________________
Twitter | Not really around here anymore, working on my indie game over at Patreon

Last edited by TehRealSalt; 08-06-2016 at 06:18 AM. Reason: aaaaa i forgot i changed the name of the cvar later
TehRealSalt is offline  
Old 02-18-2016   #8
Demnyx Onyxwing
Demnyx Onyxfur
 
Demnyx Onyxwing's Avatar
Default

Minor bug, the shadow doesn't flip with gravity.
Spoiler: Also made a small model for it.
Demnyx Onyxwing is offline  
Old 02-18-2016   #9
MetalKnux101
Iron Claws
 
MetalKnux101's Avatar
Default

What about if the shadows were actually shaped like the characters and objects that the shadows mimic? I'm pretty sure I saw something like that before. Probably a build of SRB2 CB. I'm not a big fan of the dark blob shadows.
MetalKnux101 is offline  
Old 02-18-2016   #10
Demnyx Onyxwing
Demnyx Onyxfur
 
Demnyx Onyxwing's Avatar
Default

OpenGL does that by default, just need to use the "shadow" command.
Demnyx Onyxwing is offline  
Old 02-18-2016   #11
MetalKnux101
Iron Claws
 
MetalKnux101's Avatar
Default

Quote:
Originally Posted by Demnyx Onyxwing View Post
OpenGL does that by default, just need to use the "shadow" command.
Would there be a way to convert it in to software mode?
MetalKnux101 is offline  
Old 02-18-2016   #12
Boinciel
ヒトデパンと奇妙なジャム
Administrator
 
Boinciel's Avatar
Default

You'd need to fix splats in Software first.
__________________
I'm deleting WOW + FURYHUNTER your not int his BLAPCK robo ass memes because that was a bad pun MonsterIestyn

hubjim
Boinciel is offline  
Old 02-18-2016   #13
TehRealSalt
(σᴥσ)
Judge
 
TehRealSalt's Avatar
Default

Fixed the reverse gravity shadow error, and slight gfx offset adjustments.
__________________
Twitter | Not really around here anymore, working on my indie game over at Patreon

Last edited by TehRealSalt; 02-18-2016 at 10:23 PM.
TehRealSalt is offline  
Old 02-04-2017   #14
TehRealSalt
(σᴥσ)
Judge
 
TehRealSalt's Avatar
Default

New update.
  • Now supports objects other than players. Turned off by default, use "objectshadows on" to enable them. A very small pool of objects are supported by default, but you can add more with the "addshadow" command.
  • Refactored code. No one will notice but it's a lot nicer for me to work with.
  • Included an MD2 I made a while back. It's made to be look exactly like the sprite version, down to the dimensions of it.
  • Changed the name.
__________________
Twitter | Not really around here anymore, working on my indie game over at Patreon
TehRealSalt is offline  
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 02:23 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2020, vBulletin Solutions, Inc.