Is it possible to teleport a thing with a fade in? When I write "Fade in," I mean something similar to the "Crossfade" effect in ZDoom when opening a map or similar to how the demons teleport in Doom64?
I have an area where spawning enemies in with fog is too obvious and spawning them in without fog is too abrupt.
Fade in Teleport
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
- AgentSpork
- Posts: 106
- Joined: Fri Aug 22, 2003 7:38 pm
Here's a script I wrote (with some assistance from Kaiser) for the exact effect you're looking for:
You can use it to fade in an alreaedy existing monster, or use it in a similar fashion to Thing_SpawnFacing and spawn a monster and then fade it in.
Code: Select all
script 120 (int thingID, int thingSpawn, int newTID) //Fade thing in from nothing (or spawn a monster and then fade it in)
{
//Spawn a monster if thingSpawn > 0 (use T_<whatever> for thingSpawn argument)
if(thingSpawn > 0)
{
Thing_SpawnFacing(thingID,thingSpawn,1,thingID);
}
int i = 0.1;
int j = 0;
ThingSound(thingID,"Respawn",127);
Thing_Activate(thingID);
SetActorProperty(thingID,APROP_RenderStyle,STYLE_Translucen);
for(j = 1; j < 10; j++) //Fade the monster in
{
SetActorProperty(thingID,APROP_Alpha, i);
i += 0.1;
delay(2);
} SetActorProperty(thingID,APROP_Alpha, 1.0);
//Change thing TID?
if(newTID > 0)
{
Thing_ChangeTID(thingID,newTID);
}
}
-
- Posts: 41
- Joined: Sat Nov 20, 2004 4:10 pm
- Location: America
- AgentSpork
- Posts: 106
- Joined: Fri Aug 22, 2003 7:38 pm
It's pretty simple, really. Say you wanted to spawn/fade in an imp at a map spot tagged 1, you'd just do ACS_Execute(120,0,1,T_IMP,0);. The thindID argument is for the thing tag of the map spot, the thingSpawn argument is used for spawning a monster, a list of which you can find here, and the newTID argument gives the spawned thing a new thing ID.
If you wanted to make things even simpler, you could create a function for that script like so:
That way, instead of having to use ACS_Execute(120,whatever) every time, you'd just have to use the Thing_FadeIn function. It makes things easier to remember.
If you wanted to make things even simpler, you could create a function for that script like so:
Code: Select all
Function void Thing_FadeIn (int thingID, int thingSpawn, int newTID)
{
ACS_ExecuteAlways(120,0,thingID,thingSpawn,newTID);
}
-
- Posts: 41
- Joined: Sat Nov 20, 2004 4:10 pm
- Location: America
- Bio Hazard
- Posts: 4019
- Joined: Fri Aug 15, 2003 8:15 pm
- Location: ferret ~/C/ZDL $
- Contact:
Or you can just putAgentSpork wrote:That way, instead of having to use ACS_Execute(120,whatever) every time, you'd just have to use the Thing_FadeIn function. It makes things easier to remember.
Code: Select all
#define Thing_FadeIn 120
Code: Select all
ACS_Execute(Thing_FadeIn,0,1,T_IMP,0);
- Tormentor667
- Posts: 13556
- Joined: Wed Jul 16, 2003 3:52 am
- Preferred Pronouns: He/Him
- Operating System Version (Optional): Windows 11
- Graphics Processor: nVidia (Modern GZDoom)
- Location: Germany
- Contact: