Aller au contenu

Photo

Fake spell not working?


  • Veuillez vous connecter pour répondre
7 réponses à ce sujet

#1
ScottyChaos

ScottyChaos
  • Members
  • 25 messages
I seem to have run into a conundrum while trying to figure out how to make a script for the fake spell cast. I'm trying to get an NPC to essentially "Summon" the PC into existence, but for some reason when I use the script generator, nothing happens. This is what I have so far:

void main()
{

object oPC = GetEnteringObject();

if (!GetIsPC(oPC)) return;

int DoOnce = GetLocalInt(OBJECT_SELF, GetTag(OBJECT_SELF));

if (DoOnce==TRUE) return;

SetLocalInt(OBJECT_SELF, GetTag(OBJECT_SELF), TRUE);

object oCaster;
oCaster = GetObjectByTag("NW_ANTIOUS");

object oTarget;
oTarget = GetObjectByTag("SUMMON_PC");

AssignCommand(oCaster, ActionCastSpellAtLocation(SPELL_RESURRECTION, GetLocation(oTarget), METAMAGIC_ANY, FALSE, PROJECTILE_PATH_TYPE_DEFAULT, TRUE));

}

I've set it to cast on a certain location (IE where the pc appears) but the NPC simply just doesn't do anything.
Am I doing something wrong? Am I missing some script?

#2
Thayan

Thayan
  • Members
  • 244 messages
You're using ActionCastSpellAtLocation. Try using one of the 'Fake' functions instead. They should allow you to bypass the requirement of having to cast the spell at a dead creature object:
ActionCastFakeSpellAtLocation
ActionCastFakeSpellAtObject

#3
ScottyChaos

ScottyChaos
  • Members
  • 25 messages

Thayan wrote...

You're using ActionCastSpellAtLocation. Try using one of the 'Fake' functions instead. They should allow you to bypass the requirement of having to cast the spell at a dead creature object:
ActionCastFakeSpellAtLocation
ActionCastFakeSpellAtObject

Thank you very much. That cleared it up. Now my second issue is that I want to delay the PC appearance by using vfx_dur_cutscene_invisibility as someone commented in another post of mine. How do I apply that to my PC and then remove it in the same scene?

#4
Thayan

Thayan
  • Members
  • 244 messages
Put the following somewhere in the script after if (DoOnce==TRUE) return;

ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_DUR_CUTSCENE_INVISIBILITY), oPC, 6.0);

Change 6.0 to however many seconds you want them to be invisible.

#5
ScottyChaos

ScottyChaos
  • Members
  • 25 messages
I did what you said, but the character didn't disappear. This is what I have for the cutscene:

#include "in_g_cutscene"

void main()
{

object oPC = GetEnteringObject();
GestaltStartCutscene(oPC,"summon_pc");

if (!GetIsPC(oPC)) return;

int DoOnce = GetLocalInt(OBJECT_SELF, GetTag(OBJECT_SELF));

if (DoOnce==TRUE) return;

ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_DUR_CUTSCENE_INVISIBILITY), oPC, 3.0);

SetLocalInt(OBJECT_SELF, GetTag(OBJECT_SELF), TRUE);

object oCaster;
oCaster = GetObjectByTag("NW_ANTIOUS");

object oTarget;
oTarget = GetObjectByTag("SUMMON_PC");

AssignCommand(oCaster, ActionCastFakeSpellAtLocation(SPELL_RESURRECTION, GetLocation(oTarget), PROJECTILE_PATH_TYPE_DEFAULT));
GestaltStopCutscene(2.0,oPC);
}

#6
Thayan

Thayan
  • Members
  • 244 messages
Is this script running from the area's OnEnter event? If so, you should delay firing the script until the PC has actually entered the area (and is not still transitioning to it) through something like this:

#include "in_g_cutscene"

void ScriptDelay(object oPC)
{
GestaltStartCutscene(oPC,"summon_pc");

if (!GetIsPC(oPC)) return;

int DoOnce = GetLocalInt(OBJECT_SELF, GetTag(OBJECT_SELF));

if (DoOnce==TRUE) return;

ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_DUR_CUTSCENE_INVISIBILITY), oPC, 3.0);

SetLocalInt(OBJECT_SELF, GetTag(OBJECT_SELF), TRUE);

object oCaster;
oCaster = GetObjectByTag("NW_ANTIOUS");

object oTarget;
oTarget = GetObjectByTag("SUMMON_PC");

AssignCommand(oCaster, ActionCastFakeSpellAtLocation(SPELL_RESURRECTION, GetLocation(oTarget), PROJECTILE_PATH_TYPE_DEFAULT));
GestaltStopCutscene(2.0,oPC);
}

void main()
{
object oPC = GetEnteringObject();
object oArea = GetArea(oPC);
if(oArea == OBJECT_INVALID) {
DelayCommand(0.5, ScriptDelay(oPC));
return;
}
}

Also, I'm not sure what the GestaltStartCutscene function is doing. So if you're still having problems comment that out when testing to see if that is causing problems.

#7
ScottyChaos

ScottyChaos
  • Members
  • 25 messages
He's not transitioning into the area, it's the beginning of the game. I want this to be the very first cutscene.

#8
ScottyChaos

ScottyChaos
  • Members
  • 25 messages
And I think the GestaltStartCutscene is from the cutscene maker that FesterPot helped me find.