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?
Fake spell not working?
Débuté par
ScottyChaos
, févr. 26 2013 02:19
#1
Posté 26 février 2013 - 02:19
#2
Posté 26 février 2013 - 03:41
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
ActionCastFakeSpellAtLocation
ActionCastFakeSpellAtObject
#3
Posté 26 février 2013 - 04:21
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?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
#4
Posté 26 février 2013 - 04:45
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.
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
Posté 26 février 2013 - 05:04
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);
}
#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
Posté 26 février 2013 - 05:50
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.
#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
Posté 28 février 2013 - 02:37
He's not transitioning into the area, it's the beginning of the game. I want this to be the very first cutscene.
#8
Posté 28 février 2013 - 02:38
And I think the GestaltStartCutscene is from the cutscene maker that FesterPot helped me find.





Retour en haut






