Author Topic: Fake spell not working?  (Read 443 times)

Legacy_ScottyChaos

  • Newbie
  • *
  • Posts: 36
  • Karma: +0/-0
Fake spell not working?
« on: February 26, 2013, 02:19:30 pm »


               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?
               
               

               
            

Legacy_Thayan

  • Sr. Member
  • ****
  • Posts: 435
  • Karma: +0/-0
Fake spell not working?
« Reply #1 on: February 26, 2013, 03:41:04 pm »


               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
               
               

               
            

Legacy_ScottyChaos

  • Newbie
  • *
  • Posts: 36
  • Karma: +0/-0
Fake spell not working?
« Reply #2 on: February 26, 2013, 04:21:25 pm »


               

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?
               
               

               
            

Legacy_Thayan

  • Sr. Member
  • ****
  • Posts: 435
  • Karma: +0/-0
Fake spell not working?
« Reply #3 on: February 26, 2013, 04:45:08 pm »


               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.
               
               

               
            

Legacy_ScottyChaos

  • Newbie
  • *
  • Posts: 36
  • Karma: +0/-0
Fake spell not working?
« Reply #4 on: February 26, 2013, 05:04:15 pm »


               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);
}
               
               

               
            

Legacy_Thayan

  • Sr. Member
  • ****
  • Posts: 435
  • Karma: +0/-0
Fake spell not working?
« Reply #5 on: February 26, 2013, 05:50:03 pm »


               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.
               
               

               
            

Legacy_ScottyChaos

  • Newbie
  • *
  • Posts: 36
  • Karma: +0/-0
Fake spell not working?
« Reply #6 on: February 28, 2013, 02:37:17 pm »


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

               
            

Legacy_ScottyChaos

  • Newbie
  • *
  • Posts: 36
  • Karma: +0/-0
Fake spell not working?
« Reply #7 on: February 28, 2013, 02:38:08 pm »


               And I think the GestaltStartCutscene is from the cutscene maker that FesterPot helped me find.