SRB2 Message Board  

Go Back   SRB2 Message Board > Sonic Robo Blast 2 > Releases > Lua

Reply
 
Thread Tools
Object Shadows Details »»
Object Shadows
Version: 95% guarantee that it's not Shadow the Hedgehog, by TehRealSalt (/me FLEX ᕦ(◉ᴥ◉)ᕥ) TehRealSalt is offline
Developer Last Online: Jun 2017

Category: Version: SRB2 Rating: (2 votes - 3.80 average)
Released: 04-15-2015 Last Update: 02-04-2017 Installs: 3
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 your (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, 234 views)

Screenshots

Click image for larger version

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

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

Name:	Object Shadows & MD2.jpg
Views:	277
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
Sryder13
'That brit'
Judge
 
Sryder13'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.
__________________
Quote:
<MonsterIestyn> try ctrl+f masturbation and get to the point
Sryder13 is offline   Reply With Quote
Old 05-01-2015   #3
TehRealSalt
/me FLEX ᕦ(◉ᴥ◉)ᕥ
Developer
 
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.
TehRealSalt is offline   Reply With Quote
Old 05-02-2015   #4
Larztard
Yeah...
 
Larztard'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.
__________________
YouTube

Last edited by Larztard; 05-02-2015 at 04:09 PM.
Larztard is offline   Reply With Quote
Old 05-30-2015   #5
golteam
 
golteam's Avatar
Default


This Lua script doesn't work in Match, Tag and CTF.
golteam is offline   Reply With Quote
Old 05-30-2015   #6
"Lat'"
Une très mauvaise idée...
 
"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:
*~Alyssa* How about we make it rain some cookies?
By the way we have some SRB2 related chats.
"Lat'" is offline   Reply With Quote
Old 02-18-2016   #7
TehRealSalt
/me FLEX ᕦ(◉ᴥ◉)ᕥ
Developer
 
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>).

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   Reply With Quote
Old 02-18-2016   #8
Demnyx Onyxwing
Wishes to change his name
 
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   Reply With Quote
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   Reply With Quote
Old 02-18-2016   #10
Demnyx Onyxwing
Wishes to change his name
 
Demnyx Onyxwing's Avatar
Default

OpenGL does that by default, just need to use the "shadow" command.
Demnyx Onyxwing is offline   Reply With Quote
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   Reply With Quote
Old 02-18-2016   #12
Boinciel
ヒトデパンと奇妙なジャム
Developer
 
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 online now   Reply With Quote
Old 02-18-2016   #13
TehRealSalt
/me FLEX ᕦ(◉ᴥ◉)ᕥ
Developer
 
TehRealSalt's Avatar
Default

Fixed the reverse gravity shadow error, and slight gfx offset adjustments.

Last edited by TehRealSalt; 02-18-2016 at 10:23 PM.
TehRealSalt is offline   Reply With Quote
Old 02-04-2017   #14
TehRealSalt
/me FLEX ᕦ(◉ᴥ◉)ᕥ
Developer
 
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.
TehRealSalt is offline   Reply With Quote
Reply

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 08:39 PM.


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