The Gray Death

Post your example zscripts/ACS scripts/etc here.

The Gray Death

Postby Hey Doomer » Fri Oct 22, 2021 2:55 am

This is a minimal implementation of "fade to black." It's interesting how effective a small amount of code can be. This inventory item, which changes the screen to grayscale, is given at death:

Code: Select allExpand view
Actor GoGray : PowerUpGiver
{
   +Inventory.AlwaysPickup
   +Inventory.AutoActivate
   Inventory.MaxAmount 0

   Powerup.Duration 0x7FFFFFFF
   Powerup.Colormap 1.0, 1.0, 1.0
   Powerup.Type "LightAmp"

   States
   {
   }
}


Here's the ZScript event handler:

Code: Select allExpand view
class gd_EventHandler : EventHandler
{
  override
  void PlayerDied(PlayerEvent e) {
   PlayerInfo player = players[e.PlayerNumber];
   player.mo.GiveInventory("GoGray", 1);
  }
}


and finally here's the ACS that fades to black and tilts the player to one side.

Code: Select allExpand view
script 9999 DEATH
{
    FadeTo (0, 0, 0, 1.0, 5.0);
    ChangeActorRoll(0, 0.25, true);
}


This doesn't work with R667's DAMAGEFX mod. Hard to tell why without seeing that ACS source. (Is there any event debugging?)

Changelog
Spoiler:
You do not have the required permissions to view the files attached to this post.
Last edited by Hey Doomer on Thu Oct 28, 2021 2:50 am, edited 1 time in total.
Hey Doomer
 
Joined: 25 Sep 2021
Operating System: Windows 11
OS Test Version: No (Using Stable Public Version)
Graphics Processor: ATI/AMD with Vulkan Support

Re: The Gray Death

Postby Enjay » Fri Oct 22, 2021 3:13 am

I can't check this right now but it's a neat little idea. You may be interested to know that GZDoom supports scripts with names. Using a named script means your code is far less likely to conflict with other mods.

Code: Select allExpand view
script "HeyDoomerGrayDeath" DEATH
{Blah...}
User avatar
Enjay
Everyone is a moon, and has a dark side which he never shows to anybody. Twain
 
 
 
Joined: 15 Jul 2003
Location: Scotland

Re: The Gray Death

Postby Ac!d » Wed Oct 27, 2021 7:00 am

It is possible to remove the "Gray Death" when you resurrect ?

Code: Select allExpand view
Class gd_EventHandler : EventHandler
{
    Override Void PlayerSpawned(PlayerEvent e)
    {
        PlayerInfo player = players[e.PlayerNumber];
        player.mo.A_SetBlend("0 0 0",1.0,105);
    }
    Override Void PlayerDied(PlayerEvent e)
    {
        PlayerInfo player = players[e.PlayerNumber];
        player.mo.GiveInventory("GoGray ",1);
    }

    // This is my try, but it doesn't seems to work.
    Override Void PlayerRespawned(PlayerEvent e)
    {
        PlayerInfo player = players[e.PlayerNumber];
        player.mo.TakeInventory("GoGray ",1);
    }
}
User avatar
Ac!d
Perfection is a way, not an end. - Korean Proverb
 
Joined: 02 Apr 2019
Location: France
Discord: Ac!d#2732

Re: The Gray Death

Postby Hey Doomer » Thu Oct 28, 2021 2:55 am

Interesting. I tried different DECORATE flags on the inventory item to no avail.

Finally I added this to the ACS code, which seems to work:

Code: Select allExpand view
script "GrayRespawn" RESPAWN
{
    TakeInventory("PowerLightAmp", 1);
    FadeRange (0, 0, 0, 0.0, 0, 0, 0, 0.0, 0.0);
    ChangeActorRoll(0, 1.0, true);
}


I haven't extensively tested this with the resurrect cheat. I'm not sure what happens if the player also dies with another LightAmp powerup, for example.
Hey Doomer
 
Joined: 25 Sep 2021
Operating System: Windows 11
OS Test Version: No (Using Stable Public Version)
Graphics Processor: ATI/AMD with Vulkan Support

Re: The Gray Death

Postby Ac!d » Fri Oct 29, 2021 2:54 am

Ac!d wrote:It is possible to remove the "Gray Death" when you resurrect ?


Problem solved.

Code: Select allExpand view
    Override Void PlayerRespawned(PlayerEvent e)
    {
        PlayerInfo player = players[e.PlayerNumber];
        player.mo.TakeInventory("PowerLightAmp",1);
    
User avatar
Ac!d
Perfection is a way, not an end. - Korean Proverb
 
Joined: 02 Apr 2019
Location: France
Discord: Ac!d#2732


Return to Script Library

Who is online

Users browsing this forum: No registered users and 1 guest