SRB2 Message Board

SRB2 Message Board (https://mb.srb2.org/index.php)
-   Lua (https://mb.srb2.org/forumdisplay.php?f=105)
-   -   Golden Monitors (https://mb.srb2.org/showthread.php?t=43401)

Steel Titanium 04-24-2018 09:15 PM

Golden Monitors
 
1 Attachment(s)
It's pretty much known for a while now that 2.2 will have a new set of monitors, gold monitors that respawn. So with that, I have recreated the monitors in 2.1, free to use in your map.

https://i.imgur.com/FPe9n8P.gif
A golden version of most monitors is included(Expect for random monitor, as I'm not sure if that's possible to make with Lua).

This also optionally supports Sapheros's S3K shields, and a wad file for that is included, the actual S3K Shields is required to be added for it to work properly.

To anyone who plans on making a custom shield, include a gold monitor of it in the wad, with this used as a basis.

A map is also included, with some monitors you can play around with, just warp to map 01.

Special thanks to toaster and Monster psychic cat, toaster for providing reference and help, and Monster psychic cat for providing help.
Special thanks to Teapot(Lunar) for providing a wad with the sprites.

Original creation of concept goes to K.S

Changelog:
Spoiler:

28/04/18

  • Removed proximity check
  • Added special sparkle states
  • Changed the radius and height of the monitors to 16*FRACUNIT and 36*FRACUNIT
  • The monton sound effect has the proper flags now.
  • Removed the flip flag from the monitor on the test map.

Prime 2.0 04-26-2018 06:23 AM

Welcome to Releases!

Zwip-Zwap Zapony 04-26-2018 12:46 PM

"Do note though, the sparkles only spawns when you're in within range of 950 fracunits from the monitor's radius." How does this work in/apply to multiplayer?

Lach 04-26-2018 02:17 PM

Quote:

Originally Posted by Zwip-Zwap Zapony (Post 800313)
"Do note though, the sparkles only spawns when you're in within range of 950 fracunits from the monitor's radius." How does this work in/apply to multiplayer?

I took a look at the code—the monitors spawn sparkles when any player is in the 950 FRACUNIT vicinity.

K.S. 04-27-2018 07:19 AM

Okay, so, first off, there's absolutely no need for a proximity check, and none of my reference implementations nor the 2.2 implementation have them. (The only reason bubbles need them is because they play sounds on popping.)

Second off, sparkles have three states associated with them, to smoothly fade out. Note that this also eliminates the need for a fuse.

Code:

// Extra animated effect for BIGBOXes
freeslot(
        "MT_BOXSPARKLE",
        "S_BOXSPARKLE1",
        "S_BOXSPARKLE2",
        "S_BOXSPARKLE3"
)

mobjinfo[MT_BOXSPARKLE] = {
        spawnstate = S_BOXSPARKLE1,
        speed = 3*FRACUNIT,
        flags = MF_NOGRAVITY|MF_SCENERY|MF_NOBLOCKMAP|MF_NOCLIPHEIGHT
}
states[S_BOXSPARKLE1] =        {SPR_NSPK, TR_TRANS40, 20, nextstate = S_BOXSPARKLE2}
states[S_BOXSPARKLE2] =        {SPR_NSPK, TR_TRANS60, 10, nextstate = S_BOXSPARKLE3}
states[S_BOXSPARKLE3] =        {SPR_NSPK, TR_TRANS80,  5, nextstate = S_NULL}

function A_BigMonitorSparkle(actor, var1, var2)
        local ngangle = FixedAngle(((leveltime * 21) % 360) << FRACBITS)
        local xofs = sin(ngangle) * (actor.radius>>FRACBITS)
        local yofs = cos(ngangle) * (actor.radius>>FRACBITS)

        for i = FRACUNIT*2,FRACUNIT*3,32767
                P_SetObjectMomZ(P_SpawnMobjFrom(actor, xofs, yofs, 0, MT_BOXSPARKLE), i)
        end
end

Third, the sound effect actually has the SF_X2AWAYSOUND flag applied to it that I don't think you set.

Fourth, the boxes have a radius of 16*FRACUNIT and a height of 36*FRACUNIT.

(Lastly, it ... kinda sucks doing literally everything to make these things from concept to finish, and getting zero credit in the end.)



Also, if you want to see the reference implementation for yourself, drop me a line on discord. The only reason I don't just straight post it is because it's actually a complete rewrite/simplification of the system monitors use, so it also includes regular monitors ... and the fact that it auto-generates mobj types and states, which I don't think SRB2 Doom Builder appreciates.

toaster 04-27-2018 09:12 AM

The only thing I'll add to K.S.'s post is that for performance reasons the "final product" currently goes through the four nights sparkle frames in S_BOXSPARKLE1-4 rather than the first frame but more translucent, but what they said was true up until very recently, so no worries there.

(I enjoy seeing what people come up with reverse-engineering only a baseline reference instead of republishing extant code, is why I didn't ask you for your Lua stuff to show Steel. *hugs*)

Steel Titanium 04-28-2018 09:22 PM

So a new update is out, this is pretty much to make it a bit closer to the original thing. Which means...

  • Removed proximity check
  • Added special sparkle states
  • Changed the radius and height of the monitors to 16*FRACUNIT and 36*FRACUNIT
  • The monton sound effect has the proper flags now.
On the test map, removed the flip flag on the ring monitor, it was never intended, and that was completely accidental.

Biielz 05-12-2018 03:14 PM

make these monitors replace tag/match/hns/ctf/teammatch monitors
Quote:

i love cheese

Chaolino 07-12-2018 11:20 PM

https://media.giphy.com/media/2A5C6k...6ud7/giphy.gif

Maybe that is not suposed to happen..
I can't "equip" the s3k shields

MK.exe 07-13-2018 08:46 AM

Thats probably a issue on the s3&k shields

Steel Titanium 08-01-2018 03:46 AM

I completely forgot about the post, anyways make sure the S3K Shields WAD is added before the Golden Monitors WAD, seems to only work if you load the files in that order, for some reason.


All times are GMT. The time now is 03:00 AM.

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