custom TeleportFog
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!)
custom TeleportFog
I’m trying to create a custom TeleportFog effect but I’m running into issues. I tried overriding the TeleportFog class with replaces, but it conflicts with the original class. How can I properly create and use a custom teleport fog without causing errors? Any help would be appreciated!
Re: custom TeleportFog
Replacing TeleportFog will work, you just have to give your custom class a unique name.
Re: custom TeleportFog
I already did that—my class is named CustomTeleportFog, and I even added the actor parameter TeleFogSourceType "CustomTeleportFog", but it still doesn’t work.
Re: custom TeleportFog
Could you show your code?
Re: custom TeleportFog
Code: Select all
class CustomTeleportFog : Actor
{
override void PostBeginPlay()
{
Super.PostBeginPlay();
A_PlaySound("jbonus", CHAN_BODY);
}
override void Tick()
{
// Custom logic, if needed
Super.Tick();
}
States
{
Spawn:
SPEX ABCDEFGHIJKLMNOPQRSTUVWXYZ 1 Bright;
Stop;
}
}
Re: custom TeleportFog
You didn't actually replace the vanilla TeleportFog, you have to use the replaces keyword for this, like so:
class CustomTeleportFog : Actor replaces TeleportFog
class CustomTeleportFog : Actor replaces TeleportFog
Re: custom TeleportFog
I had already tried that as well, but it still doesn't work. Do you perhaps have a simple WAD with an example?
Re: custom TeleportFog
I have just copied your code, added the replacement line and changed the sound/sprites to make it appear on my end.
Could you send your project here so I can see your file structure and test it?
Could you send your project here so I can see your file structure and test it?
Re: custom TeleportFog
I was more curious about the sprites and sounds folders, as well as your SNDINFO.
Re: custom TeleportFog
Just a thought: Have you checked that your actor actually works regardless of whether it replaces the default teleport fog or not?
What happens if you type:
summon CustomTeleportFog
at the console? Does your actor appear?
What happens if you type:
summon CustomTeleportFog
at the console? Does your actor appear?
Re: custom TeleportFog
@Enjay
Yes, CustomTeleportFog does appear when summoned that way.
Yes, CustomTeleportFog does appear when summoned that way.
Re: custom TeleportFog
@Enjay
Yes, CustomTeleportFog does appear when summoned that way.
Yes, CustomTeleportFog does appear when summoned that way.
Re: custom TeleportFog
OK, so the actor is fine - there is just something about the how replacing the original is being implemented.
However, when I tried this (which is just you code with the sprite name replaced and "replaces TeleportFog" added, it works on my system.
So, there must be something about the structure of your project file that means the actor isn't being allowed to replace the default teleport fog.
Do you get any messages at the console? If you don't already have developer mode set, type developer 2 at the console and then restart to possibly get more error messages than you would with developer mode set to the default of 0.
However, when I tried this (which is just you code with the sprite name replaced and "replaces TeleportFog" added, it works on my system.
Code: Select all
class CustomTeleportFog : Actor replaces TeleportFog
{
override void PostBeginPlay()
{
Super.PostBeginPlay();
A_PlaySound("jbonus", CHAN_BODY);
}
override void Tick()
{
// Custom logic, if needed
Super.Tick();
}
States
{
Spawn:
VILE ABCDEFGHIJKLMNOPQRSTUVWXYZ 1 Bright;
Stop;
}
}
Do you get any messages at the console? If you don't already have developer mode set, type developer 2 at the console and then restart to possibly get more error messages than you would with developer mode set to the default of 0.