Spawning creature through fade in

Weird question perhaps, but is there a way to spawn in a creature slowly, through scripting. I know how to spawn a creature, but it would be nice if it could fade in and not just appear directly. Is there some way to do that?

The way I always spawn in creature is through SpawnCreatureAtWP with the include script ginc_object.
The function CreateObject (I think I might have used that too at some time) I see now has a bUseAppearAnimation. If you set that to TRUE, what does that do?

Hi andgalf.
answer on your question:"Bioware uses this to have things fly (with wings) or flee, and beholders come up out of the ground in Hordes of the Underdark, or more importantly, move away though the ground holes available.

Using nAnimation set to 2 will make a few creatures use a second special disappear/appear animation they may have - most notably for beholders, “floating up out of the ground”.

The target this effect is applied to must be a creature for it to work. This effect should not be applied instantly or permanently, only temporarily."

you can find more interesting and useful here


i hope it help

Thanks. I’ve read through the whole thing and it seems that the animation we’re talking about is either: come up from the ground or fly down from the sky. Neither of these is what I’m after, but I guess I could still try it out and see how it looks.

I tried with bUseAppearAnimation = TRUE but that didn’t do anything actually. I haven’t tested the other stuff you mentioned yet.

I tried something else, but sadly it didn’t quite work either. Under properties of the creature, I set the Appearance(visual effect) to fx_ambient_fade but that made the character fade out instead of fading in. Too bad I can’t seem to find anything that does it in reverse.

i quickly edited the fade effect and changed it to a fade in one. coyping to the override should work.
link to nwn2 fade in effect

i am also not sure if the appear animations still work in nwn2. afaik there are no such animations, and if the effect appear and effect disappear still fire needs to be tested.

1 Like

@Semper Thanks, but I can’t download your file from google drive. I think you have to make it available to all that has the link (I’ve made such links myself and know that this is unfortunately an issue).

sry, please try again. if it does not work, i’ll use another file hoster to upload. can’t be bothered to create a new project for a special effect :smiley:

It worked now. Thanks. I’ll try it out.

@Semper It almost works now. However, the fx/animation loops so the creature fades in time and time again, instead of only once.

i uploaded another version of the effect where the maximum duration of all events is capped at 1.5s. if this does not work, the effect has to be added via script with a temporary duration of 1.5s.

Thanks. I’ll try again.

Yes! Now it works! Thank you so much @Semper!! :grinning:

I did a script instead. It looks like this (if others want to use this):

#include "ginc_object"

void RunTheEffect()
{

//Apply visual effect to creature. Script example by Dann Pigdon 2012 from Handy_VFX. Edited by andgalf 2021.
//Requires fx_ambient_fade_in.sef by Semper put in the override folder or in a hak pak.

object oTarget = GetObjectByTag("creature");
string sVFX = "fx_ambient_fade_in.sef";
//Assign VFX to spell id 100 (light spell)
effect eDrink = SetEffectSpellId(EffectNWN2SpecialEffectFile(sVFX), 100);
SetWeaponVisibility(oTarget, 0, 0);//Make weapons and shields invisible
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eDrink, oTarget,1.5);


}

void main()
{

object oCreature = SpawnCreatureAtWP("creature", "creature_wp");

DelayCommand(0.1,RunTheEffect());


}
2 Likes

So, I tried using this effect again, but for some reason it doesn’t look that good. I think it looked good before, but I don’t remember…

The problem seems to be that I have to first spawn the creature and then try fading it in. So there’s a short glitch when the creature is spawned and then it reverts to fading in. And the fading in goes really fast.

Maybe this effect works as intended if using it in the Appearance (visual effect), but I have another effect there already for this creature that I’m using.

EDIT: I tried switching the effects, and that almost worked, however, as stated earlier in this thread, if one applies fx_ambient_fade_in.sef to the creature’s appearance it loops.

EDIT2: I sort of solved it in a roundabout way. Instead of spawning in the creature, I placed it in the world out of sight, and then jumped the creature to the waypoint. It’s a very short fade in because of that. Still not pleased with how it looks. If one looks at the effect by @Semper in the Visual Effects Editor, it looks quite nice, even though I feel that the animation would benefit from fading in a little bit slower towards the end. Still can’t use that however, since the creature needs to be invisible from the start. If applied to Appearance (Visual Effect) it is invisible from the start, but then the animation loops instead. Sigh

EDIT3: Tried yet another thing by using the CreateObject function when spawning the creature instead and setting int bUseAppearAnimation=TRUE but that didn’t change much at all.
Is there no way to do a Appearance(Visual Effect) as a one shot?

EDIT4: Alright, I’ll just have to give up then. I’ve tried everything I can think of now.

My latest attempt is this script here (as you can see from all the grayed out stuff I’ve tried a lot of different things, it’s a mess, I know):

void RunTheEffect()
{

//Apply visual effect to creature. Script example by Dann Pigdon 2012 from Handy_VFX. Edited by andgalf 2021.
//Requires fx_ambient_fade_in.sef by Semper put in the override folder or in a hak pak.

object oTarget = GetObjectByTag("niva");
string sVFX = "fx_ambient_fade_in.sef";
//string sVFX = "fx_ghost_glow_a8.sef";
//Assign VFX to spell id 100 (light spell)

effect eDrink = SetEffectSpellId(EffectNWN2SpecialEffectFile(sVFX), 100);
SetWeaponVisibility(oTarget, 0, 0);//Make weapons and shields invisible
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eDrink, oTarget,1.5);


}

void main()
{

//object oSatyr = SpawnCreatureAtWP("niva", "nivaappe_wp");
object oNiva = GetObjectByTag("niva");
object oWP = GetObjectByTag("nivaappe_wp");
RunTheEffect();
//location lLocation = GetLocation(oWP);
//CreateObject(OBJECT_TYPE_CREATURE,"niva",lLocation,TRUE);

//AssignCommand(oNiva, ClearAllActions());
DelayCommand(0.6,AssignCommand(oNiva, ActionJumpToObject(oWP)));
//AssignCommand(oNiva, ActionJumpToObject(oWP));
//
//RunTheEffect();
//SetScriptHidden(oNiva,FALSE);
//DelayCommand(0.1,RunTheEffect());


}

andgalf… You could make a duplicate small room/ cave/ whatever in the same area, have a conversation or script run that starts a mini cutscene and at the point of spawning fade in the creature in the new room. Using cameras you will only see the fading in creature while the other appears normally.

I don’t know how to make fades but if you can set a time with a cutscene you can delay it for as long as you want so if the fade’s 5 seconds delay that conversation node by 5 or just run a sound that lasts that long then you won’t need a delay.

Just make sure to use different creature tags and faction it neutral or it’ll be banging on the walls if the “real” one goes hostile.

To duplicate placeables for the cutscene group and export them to your override as a prefab then bring them back from the prefabs tab, that way anything in the background of the fake room will look exactly the same. You can environment object the whole lot it won’t matter.

I’m trying to read what you say here again and again, but I don’t fully grasp what you mean.

I mean, the problem, as I see it, is the fades themselves so the “…fade in the creature in the new room”. I don’t know how to do that.

As you see from my script above, I have the creature in another area, I then jump the creature to the new area which creates something of a fade in, but it is very jerky, and I don’t like that. You mean, if I place this creature in the same area, and then jump, it will be different?

Trying again to understand what you’re trying to tell me, why do I need duplicate rooms?

By the way, my latest attempt has been to spawn in a creature with the fade in effect, destroy it, and then spawn in an identical creature without the effect at the same spot. It doesn’t look much better than before though. I mean there’s such a nice fade out when you dismiss and send companions away that I think there should be a nice fade in effect somewhere that you could apply through scripting.

Ok I’ll try to explain… I thought fades could be controlled and you could adjust them accordingly, I didn’t realise it’s part of the game mechanics when you spawn. Maybe you can fade in using invisibility or some sort of spirit effect or script hidden stuff I don’t know. Anyway this might work better than what you’ve currently got…

You have an area with black space around the actual walkable bit so put down a few tiles that look the same as the ones in the room where the creature will appear. This gives you an area that nobody can see or go to.

So start the camera rolling on the fake area the creature is going to spawn in, just film the wall with a 2 second delay on it. Then with a waypoint or whatever you bring your creature into that area which will fade it in all the while being filmed so long as everything has the same camera and is on the NPC conversation node.

Meanwhile in the real area where the party are you bring in the actual creature that will interact with them and it doesn’t matter how he fades in because he’ll just be there after the cutscene. Destroy the fake creature if you want and if you don’t want the fake area to show on the map put a big black thing on the ceiling to block it out.

Basically put all the effects on a creature somewhere else and film it, nobody will notice that it wasn’t the one now staring at them because it’s a cutscene that looks like it’s in the same area.

I’ve stuck quite a few hidden areas in places so you can run a cutscene that shows things happening somewhere else, that way the new area doesn’t have to load. So you can enter some caves but you can now see the chaos you have caused in the castle etc. I even duplicated a tavern right next door to the original that nobody could go to for a pure cutscene, that way I knew exactly where everybody would be.

I forgot if you want to delay things as it films the fade and to prevent it running to the next line put in a sound effect that will keep it on that conversation line for as long as the sound plays. Nothing to stop the player clicking it but that’s irrelevant because this is happening fast and the cameras will still show the fade in.

Ok, now I understand what you’re saying.

Don’t know if this solution will make it better though. For this to work, I would have to cut away just as the fade in effect disappears and begins to loop on the character in the fake room (it’s sef effect as you see in my script), and I could do such a thing already by just using static cameras because I know pretty much exactly where the others are since they are jumped to waypoints, and then spawn in a new character without the fade in effect on when cutting away. But I don’t want to do this sadly.

What I am after is a nice fade in that then immediately goes over to the character talking without cutting away.

EDIT: Since there already is a fade away effect that looks really nice (not sure how to call that from scripting though. It’s the one I use when dismissing a companion through the Party Roster GUI) one would think that there should be an effect that does the opposite, but apparently not. This is something that only @travus or @kevL_s would know, I bet.

EDIT 2: Doing even more testing it seems that if I use CreateObject or SpawnCreatureAtWP the creature always appears instantly. However if I have a companion and I use a script like this:

#include "ginc_companion"

void main(string sCompanion, string sWP)
{
	object oFaction = GetObjectByTag(sCompanion);
	object oPC = GetFirstPC();
	object oDest = GetObjectByTag(sWP);
	//SetIsRosterMemberSelectable(sCompanion,FALSE);
	RemoveRosterMemberFromParty(sCompanion, oPC, FALSE);
	
	AssignCommand(oFaction, ClearAllActions());
    AssignCommand(oFaction, JumpToObject(oDest));



}

when the companion jumps, she fades away really nicely. I wonder if that jumping animation somehow could be reversed and used in a script.

EDIT3: Maybe my eyes are deceiving me but when really comparing it actually seems that the fade in when using ga_jump from another place to the place where you are at, the creature actually fades in a bit. Maybe it’s the exact as jumping away but it just looks a tiny bit better when jumping away instead of jumping to where you are.