[Bug?] Actors inheriting from SpectralMonster/AlienSpectre1
Moderator: GZDoom Developers
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.
Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.
Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
- StroggVorbis
- Posts: 866
- Joined: Wed Nov 08, 2017 4:23 pm
- Graphics Processor: nVidia with Vulkan support
- Location: Germany
[Bug?] Actors inheriting from SpectralMonster/AlienSpectre1
So, I've been trying to replace Strife's AlienSpectres with equivalents that don't possess the SPECTRAL flag, making them susceptible to conventional weaponry.
The only problem I face with this is that A_AlienSpectreDeath doesn't respond to the death of my custom actors, meaning I no longer get log changes or QuestItems.
Is this a bug or do I need to provide an adjusted DIALOGUE lump?
Before anyone asks, yes I did give all of them their original ConversationID.
EDIT: I looked at the A_AlienSpectralDeath function and if I understood correctly it checks for the actors by name, this would mean that I'm out of luck without using ZScript, as two actors cannot have the same name.
The only problem I face with this is that A_AlienSpectreDeath doesn't respond to the death of my custom actors, meaning I no longer get log changes or QuestItems.
Is this a bug or do I need to provide an adjusted DIALOGUE lump?
Before anyone asks, yes I did give all of them their original ConversationID.
EDIT: I looked at the A_AlienSpectralDeath function and if I understood correctly it checks for the actors by name, this would mean that I'm out of luck without using ZScript, as two actors cannot have the same name.
Last edited by StroggVorbis on Thu Nov 15, 2018 7:16 am, edited 1 time in total.
-
- Posts: 4949
- Joined: Sun Nov 14, 2010 12:59 am
Re: [Bug?] Actors inheriting from SpectralMonster/AlienSpect
The function checks for AlienSpectre[1-5] classes specifically to do its thing. So if the caller is none of those classes, it won't do anything.
- TheMightyHeracross
- Posts: 2100
- Joined: Sun Aug 18, 2013 9:41 am
- Location: Philadelphia, PA
Re: [Bug?] Actors inheriting from SpectralMonster/AlienSpect
Ah, the joys of Strife modding!
As Blue Shadow said, according to the Wiki page for [wiki]A_AlienSpectreDeath[/wiki], the function has hard-coded behavior which is different for the five AlienSpectres. Because your monster is not one of these five I am assuming that the function is being called, it's checking the actor, but finding that the actor is not one of those five, and therefore is doing nothing.
Fortunately, you can recreate this behavior using action functions. Call these action functions in the monster's DECORATE instead of the hardcoded function:
See [wiki]SendToCommunicator[/wiki]. Some of the other AlienSpectre death scripts are a bit more complex and you'll probably need some simple ACS.
As Blue Shadow said, according to the Wiki page for [wiki]A_AlienSpectreDeath[/wiki], the function has hard-coded behavior which is different for the five AlienSpectres. Because your monster is not one of these five I am assuming that the function is being called, it's checking the actor, but finding that the actor is not one of those five, and therefore is doing nothing.
Fortunately, you can recreate this behavior using action functions. Call these action functions in the monster's DECORATE instead of the hardcoded function:
Code: Select all
Floor_LowerToLowest(999, 8)
SendToCommunicator(95, 0, 1, 0)
- StroggVorbis
- Posts: 866
- Joined: Wed Nov 08, 2017 4:23 pm
- Graphics Processor: nVidia with Vulkan support
- Location: Germany
Re: [Bug?] Actors inheriting from SpectralMonster/AlienSpect
Thank you both for the quick responses, I was in the middle of editing my post and after the page got refreshed I'm just seeing them
- StroggVorbis
- Posts: 866
- Joined: Wed Nov 08, 2017 4:23 pm
- Graphics Processor: nVidia with Vulkan support
- Location: Germany
Re: [Bug?] Actors inheriting from SpectralMonster/AlienSpect
I tried following your example, but still haven't managed to get it to work.TheMightyHeracross wrote:Code: Select all
Floor_LowerToLowest(999, 8) SendToCommunicator(95, 0, 1, 0)
Like this?
Code: Select all
Actor AlienSpecter1 : AlienSpectre1 replaces AlienSpectre1
{
Conversationid 67
-SPECTRAL
States
{
Death:
AL1P A 6 Bright A_SpectreChunkSmall
AL1P B 6 Bright A_Scream
AL1P C 6 Bright A_SpectreChunkSmall
AL1P DE 6 Bright
AL1P F 6 Bright A_SpectreChunkSmall
AL1P G 6 Bright
AL1P H 6 Bright A_SpectreChunkSmall
AL1P IJK 6 Bright
AL1P LM 5 Bright
AL1P N 5 Bright A_SpectreChunkLarge
AL1P OPQ 5 Bright
AL1P R 5 Bright A_AlienSpectreDeath
TNT1 A 0 Floor_LowerToLowest(999, 8)
TNT1 A 0 SendToCommunicator(95, 0, 1, 0)
Stop
}
}
- TheMightyHeracross
- Posts: 2100
- Joined: Sun Aug 18, 2013 9:41 am
- Location: Philadelphia, PA
Re: [Bug?] Actors inheriting from SpectralMonster/AlienSpect
Ah my mistake. You can't run SendToCommunicator in DECORATE like that because it's not actually being run by the player. For the player to get the communicator message the player themself has to execute the function. Looks like we're gonna need ACS.
This is what I got to work:
Then, load this script in LOADACS:
To test this, make sure you give yourself the Communicator in the console first! You will not receive log messages without the Communicator item.
This is what I got to work:
Code: Select all
Actor AlienSpecter1 : AlienSpectre1 replaces AlienSpectre1
{
Conversationid 67
-SPECTRAL
States
{
Death:
AL1P A 6 Bright A_SpectreChunkSmall
AL1P B 6 Bright A_Scream
AL1P C 6 Bright A_SpectreChunkSmall
AL1P DE 6 Bright
AL1P F 6 Bright A_SpectreChunkSmall
AL1P G 6 Bright
AL1P H 6 Bright A_SpectreChunkSmall
AL1P IJK 6 Bright
AL1P LM 5 Bright
AL1P N 5 Bright A_SpectreChunkLarge
AL1P OPQ 5 Bright
AL1P R 5 Bright ACS_NamedExecuteAlways("Die", 0, 0, 0, 0)
Stop
}
}
Code: Select all
#library "TEST"
#include "zcommon.acs"
script "Die" (void)
{
Floor_LowerToLowest(999, 8);
SetActivator(0, AAPTR_PLAYER1);//This changes the activator to the player, so they can receive Blackbird's message.
SendToCommunicator(95, 0, 1, 0);
}
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49056
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: [Bug?] Actors inheriting from SpectralMonster/AlienSpect
Why is ZScript not an option? Then you could just make a copy of the original function and change the names.
- StroggVorbis
- Posts: 866
- Joined: Wed Nov 08, 2017 4:23 pm
- Graphics Processor: nVidia with Vulkan support
- Location: Germany
Re: [Bug?] Actors inheriting from SpectralMonster/AlienSpect
Thanks, this did the trick! Although, is it possible to do this in Decorate only through the help of something like A_RearrangePointers? There must be a way to redirect/transfer the AlienSpectre's SendToCommunicator special pointer to its target/killer, i.e. the player
If there isn't, I'm fine with that, it's not that I'm lazy, just that I'm in the middle of another playthrough and adding ACS would make my save unusable.
If there isn't, I'm fine with that, it's not that I'm lazy, just that I'm in the middle of another playthrough and adding ACS would make my save unusable.
- StroggVorbis
- Posts: 866
- Joined: Wed Nov 08, 2017 4:23 pm
- Graphics Processor: nVidia with Vulkan support
- Location: Germany
Re: [Bug?] Actors inheriting from SpectralMonster/AlienSpect
I'll try that out too, even though I've got bad feelings that I'll be unable to do this all by myselfGraf Zahl wrote:Why is ZScript not an option? Then you could just make a copy of the original function and change the names.
I'll get back to you guys shall I hit a roadblock
EDIT: So, probably not the most elegant solution, but for starters I copied everything from alienspectre.txt inside gzdoom.pk3 into a ZScript lump and edited the names of all spectres to specters, same for the codepointer and its corresponding function and it works as intended. I only had to relocate the conversationIDs from the former Decorate lump into mapinfo, as the .zsc wouldn't accept it. And since the actors in my save file already had the same name, it loaded up without problems. But then I realized I could've avoided all of this trouble by simply adding the +spectral flag to all weapons, what a day
EDIT 2: Nevermind, +SPECTRAL can only be applied to projectiles, and this has the unintentional side effect of splash damage not hurting the player.