Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
doomisfun

Enemies that fade into visibility...

Recommended Posts

I have been wondering for some time how the effect of an enemy fading into view is acheived. I am not talking about teleportation of any kind, rather an enemy that is invisible that fades into visibility and begins attacking, after being triggered. An example of this can be seen in the first level of Simplicity where a hell knight and I believe a couple of imps do this.

If anyone can explain this to me I would be grateful.

Share this post


Link to post

A lot of ports support "stealth monsters". These are monsters that are invisible most of the time but when they attack or are hit they fade into view (and out again). Personally, I usually find them to be a major pain in the hoop unless they are used well.

Share this post


Link to post

No thats not what I meant either, the enemies fade into view and stay that way. Like I said check out the first level of simplicity.

I agree that stealth monster are annoying though.

Share this post


Link to post

I examined the first level in simplicity and have found a few things.

First off, the invisible enemies have the dormant flag checked.

I then opened the behaviour lump up and here are the parts that are pertinent:

Thing_SetInvisible(7);

-This is in the opening script and seems straightforward enough, it makes the hell knight invisible.

Script 22 (void)
{
Thing_FadeIn(7,0,0);
}

-This is executed by walking over the line and fades the hell knight into view and he becomes undormant. This all seems fine and dandy but I still cannot get it to work in my level. I also noticecd that both "Thing_SetInvisible" and "Thing_FadeIn" are not in the blue font that commands are usually in when editing scripts with doom builder. It is as if doom builder does not recognize them as commands and they use the normal black text. I am still perplexed with this problem and I think I'm missing something crucial.

Again, any insights would be appreciated...

Share this post


Link to post

Sorry for the triple post, but i need to add that when I try to compile my behavior lump, it fails telling me that these functions (Thing_SetInvisible and Thing_FadeIn) are used but not defined. Now I am really scratching my head.

Share this post


Link to post

It's a script I made with some help from Kaiser, and the Thing_FadeIn is simply a function made to execute that script (for convenience's sake)

Here's the code:

script 120 (int thingID, int thingSpawn, int newTID) //Fade thing in from nothing (and alternatively spawn a monster)
{
	//Spawn a number if thingSpawn is greater than 0
	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_Translucent);
	for(j = 1; j < 10; j++) //Fade Monster in
	{
		SetActorProperty(thingID,APROP_Alpha, i);
		i += 0.1;
		delay(2);
	} SetActorProperty(thingID,APROP_Alpha, 1.0);

	//Change thing TID? (not necessary, but helpful)
	if(newTID > 0)
	{
	Thing_ChangeTID(thingID,newTID);
	}
}

//Function for said script

Function void Thing_FadeIn (int thingID, int thingSpawn, int newTID)
{
	ACS_ExecuteAlways(120,0,thingID,thingSpawn,newTID);
}
You could of course modify that script to fade a monster out and remove it from the map entirely as well, with some simple modifications.

Share this post


Link to post

Ok, thanks a million spork. You really do kick ass. I am sure I can get it working now, but we will see...

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×