Author Topic: help fixing a few things...  (Read 764 times)

Legacy_zero-feeling

  • Sr. Member
  • ****
  • Posts: 287
  • Karma: +0/-0
help fixing a few things...
« on: August 06, 2010, 02:31:37 am »


               so, first of all, is there a way to post scripts in boxes yet?

second, having a bit of trouble with this script...

the script works fine except for a few things i can't seem to make work. first, the beams don't shut off, not sure why, i'm not a very talented scripter...
second, i'd like the pillar in this script to re-appear after the dragon has been killed, about 2 minutes after...
third, i'd like this script to only be able to work once (one instance of the dragon being summoned at a time) and finally, i'd like the script to only run again 15 minutes after the dragon as been killed, meanning the summoning runes are useless until 15 minutes after the dragon has been killed.

i hope i explained the problems enough, if not, i can try more.

here's the script.

#include "pqj_inc" // for quest check
#include "nw_i0_2q4luskan"
void main()
{
   object oPC = GetLocalObject (OBJECT_SELF, "PC");
   if (!GetIsPC(oPC)) return;
   int nInt = RetrieveQuestState("q_helden",oPC);
   if (nInt == 40)
      return;
   object oTarget;
      oTarget = OBJECT_SELF;
      nInt = GetObjectType(oTarget);
   if (nInt != OBJECT_TYPE_WAYPOINT) ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_SUNSTRIKE), oTarget);
   else ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_SUNSTRIKE), GetLocation(oTarget));
      oTarget = GetObjectByTag("rune_pillar");
      nInt = GetObjectType(oTarget);
   effect eEffect;
      eEffect = EffectVisualEffect(VFX_COM_CHUNK_STONE_MEDIUM);
   if (nInt != OBJECT_TYPE_WAYPOINT)
      DelayCommand(1.0, ApplyEffectToObject(DURATION_TYPE_INSTANT, eEffect, oTarget));
   else
      DelayCommand(1.0, ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eEffect, GetLocation(oTarget)));
      DelayCommand(1.0, DestroyObject(oTarget, 3.0));
      oTarget = GetObjectByTag("invis_rune");
      nInt = GetObjectType(oTarget);
   if (nInt != OBJECT_TYPE_WAYPOINT) ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_FIRESTORM), oTarget);
   else ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_FIRESTORM), GetLocation(oTarget));
   location lTarget;
      oTarget = GetWaypointByTag("WP_summon");
      lTarget = GetLocation(oTarget);
      DelayCommand(2.0, CreateObjectVoid(OBJECT_TYPE_CREATURE, "heldenguardian", lTarget));
      eEffect = EffectVisualEffect(VFX_FNF_SUMMON_CELESTIAL);
      DelayCommand(2.0, ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eEffect, lTarget));
      {
         effect eVFX = GetFirstEffect(OBJECT_SELF);
         while(GetIsEffectValid(eVFX))
         {
            if(GetEffectType(eVFX) == EFFECT_TYPE_VISUALEFFECT) RemoveEffect(OBJECT_SELF, eVFX);
            eVFX = GetNextEffect(OBJECT_SELF);
         }
         DeleteLocalInt(GetObjectByTag("rune_ice"), "Activated");
         DeleteLocalInt(GetObjectByTag("rune_fire"), "Activated");
         DeleteLocalInt(GetObjectByTag("rune_evil"), "Activated");
         DeleteLocalInt(GetObjectByTag("rune_holy"), "Activated");
      }
}
               
               

               
            

Legacy_GhostOfGod

  • Hero Member
  • *****
  • Posts: 1490
  • Karma: +0/-0
help fixing a few things...
« Reply #1 on: August 06, 2010, 09:32:54 am »


               Where exactly does this script go?
               
               

               
            

Legacy_zero-feeling

  • Sr. Member
  • ****
  • Posts: 287
  • Karma: +0/-0
help fixing a few things...
« Reply #2 on: August 07, 2010, 07:06:08 am »


               oops, i forgot to mention this is part two of a three part script, here is the second script:



#include "pqj_inc"

void main()

{

  object oPC = GetLastUsedBy();

  if (!GetIsPC(oPC)) return;

  if(RetrieveQuestState("q_chalice", oPC) != 40) return;

  if(GetLocalInt(OBJECT_SELF, "Activated") == 1) return;

   //Checktag and assign VFX

   string sTag = GetTag(OBJECT_SELF);

   int nBeam;

   if(sTag == "rune_ice") nBeam = VFX_BEAM_COLD;

   else if(sTag == "rune_fire") nBeam = VFX_BEAM_FIRE;

   else if(sTag == "rune_evil") nBeam = VFX_BEAM_EVIL;

   else if(sTag == "rune_holy") nBeam = VFX_BEAM_HOLY;

   //Set a local int to indicate the rune is activated

   SetLocalInt(OBJECT_SELF, "Activated", 1);

   object oTarget = GetObjectByTag("rune_black");

   ApplyEffectToObject(DURATION_TYPE_PERMANENT, EffectBeam(nBeam, GetObjectByTag("rune_black"), BODY_NODE_CHEST), GetObjectByTag(sTag));

   //If all four are activated activate the rune pillar

   if(GetLocalInt(GetObjectByTag("rune_ice"), "Activated") == 1 &&

      GetLocalInt(GetObjectByTag("rune_fire"), "Activated") == 1 &&

      GetLocalInt(GetObjectByTag("rune_evil"), "Activated") == 1 &&

      GetLocalInt(GetObjectByTag("rune_holy"), "Activated") == 1)

      {

      SetLocalObject(oTarget, "PC", oPC);

      ExecuteScript("ap_rune_pillar", oTarget);

      ExecuteScript("ap_pillar_summon", OBJECT_SELF);

      SetUseableFlag(OBJECT_SELF, FALSE);

      DelayCommand(900.0, SetUseableFlag(OBJECT_SELF, TRUE));

      }

}



this script goes on the rune stones, the other two, activated by this one.



script 3:



#include "nw_i0_generic"

void main()

{



  object oPC = GetLastUsedBy();



  if (!GetIsPC(oPC)) return;



  object oTarget;

  object oSpawn;

  location lTarget;

     oTarget = GetWaypointByTag("watcher_one");

     lTarget = GetLocation(oTarget);

     oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "heldenwatcher", lTarget);

     oTarget = oSpawn;

        SetIsTemporaryEnemy(oPC, oTarget);

        AssignCommand(oTarget, ActionAttack(oPC));

        AssignCommand(oTarget, DetermineCombatRound(oPC));



  int nInt;

     nInt = GetObjectType(oTarget);



  if (nInt != OBJECT_TYPE_WAYPOINT) DelayCommand(0.5, ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_SUMMON_EPIC_UNDEAD), oTarget));

  else DelayCommand(0.5, ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_SUMMON_EPIC_UNDEAD), GetLocation(oTarget)));

     oTarget = GetWaypointByTag("helden_two");

     lTarget = GetLocation(oTarget);

     oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "heldenwatcher", lTarget);

     oTarget = oSpawn;

        SetIsTemporaryEnemy(oPC, oTarget);

        AssignCommand(oTarget, ActionAttack(oPC));

        AssignCommand(oTarget, DetermineCombatRound(oPC));



     nInt = GetObjectType(oTarget);



  if (nInt != OBJECT_TYPE_WAYPOINT) DelayCommand(0.5, ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_SUMMON_EPIC_UNDEAD), oTarget));

  else DelayCommand(0.5, ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_SUMMON_EPIC_UNDEAD), GetLocation(oTarget)));

}





thanks
               
               

               
            

Legacy_420

  • Sr. Member
  • ****
  • Posts: 370
  • Karma: +0/-0
help fixing a few things...
« Reply #3 on: August 08, 2010, 06:01:13 pm »


               

zero-feeling wrote...

so, first of all, is there a way to post scripts in boxes yet?

No but using [ code][ /code] helps with the formatting.

first, the beams don't shut off, not sure why, i'm not a very talented scripter...

Try this:

effect eVFX = GetFirstEffect(OBJECT_SELF);
while(GetIsEffectValid(eVFX))
{
if(GetEffectType(eVFX) == EFFECT_TYPE_BEAM) RemoveEffect(OBJECT_SELF, eVFX);
eVFX = GetNextEffect(OBJECT_SELF);
}

second, i'd like the pillar in this script to re-appear after the dragon has been killed, about 2 minutes after...

For this one, place a Waypoint where you want the pillar to spawn, then in the dragon's OnDeath script make the  one of the other objects in the area (like "rune_black") execute a script.

So, do something like this in the dragon's OnDeath:

object oRune = GetNearestObjectByTag("rune_black");
SetLocalInt(oRune, "DoOnce", 1);
ExecuteScript("spawnpillar", oRune);

Then the script "spawnpillar" should look something like this:

void main()
{
if(GetLocalInt(OBJECT_SELF, "DoOnce") == 1)
    {
    DeleteLocalInt(oRune, "DoOnce");
    DelayCommand(120.0, ExecuteScript("spawnpillar", OBJECT_SELF));
    }
else
    {
    CreateObject(OBJECT_TYPE_PLACEABLE, "rune_pillar", GetLocation(GetNearestObjectByTag("PillarWP")));
    }
}

third, i'd like this script to only be able to work once (one instance of the dragon being summoned at a time)

Just check to see if the dragon is valid at teh top of the first script (the one that calls the other two scripts).


if(GetIsObjectValid(GetNearestObjectByTag("DragonTag"))) return;

and finally, i'd like the script to only run again 15 minutes after the dragon as been killed, meanning the summoning runes are useless until 15 minutes after the dragon has been killed.

It looks like you are doing that already by making the runes usable state to FALSE then delaying the command 900 seconds (15 minutes) then setting usable to TRUE. Is this not working the way it's intended?

-420
               
               

               


                     Modifié par 420, 09 août 2010 - 04:35 .
                     
                  


            

Legacy_420

  • Sr. Member
  • ****
  • Posts: 370
  • Karma: +0/-0
help fixing a few things...
« Reply #4 on: August 08, 2010, 06:02:35 pm »


               Double post (whoops).
               
               

               


                     Modifié par 420, 09 août 2010 - 04:35 .
                     
                  


            

Legacy_diggerplus

  • Newbie
  • *
  • Posts: 6
  • Karma: +0/-0
help fixing a few things...
« Reply #5 on: August 09, 2010, 06:53:15 am »


               thanks 420, and for the record, these new forums seem to be a lot harder to get help on... are there any other forums now that are better for getting help?



thanks
               
               

               
            

Legacy_420

  • Sr. Member
  • ****
  • Posts: 370
  • Karma: +0/-0
help fixing a few things...
« Reply #6 on: August 09, 2010, 05:37:29 pm »


               

diggerplus wrote...

thanks 420, and for the record, these new forums seem to be a lot harder to get help on... are there any other forums now that are better for getting help?

thanks

That's partly my fault. I haven't been checking the forums as often since they moved. I'll make more of an effort to check them on a daily basis.

-420
               
               

               
            

Legacy_Genisys

  • Hero Member
  • *****
  • Posts: 961
  • Karma: +0/-0
help fixing a few things...
« Reply #7 on: August 09, 2010, 05:56:38 pm »


               

diggerplus wrote...

thanks 420, and for the record, these new forums seem to be a lot harder to get help on... are there any other forums now that are better for getting help?

thanks


As one of the builders said it before...

"NWN is winding down..."

I believe this to be true, so you may not find as much support...

Also, these are new forums, obviously they are not going to be as heavially used as the original, because people are lazy and don't want to move over to the new one...

I'm starting to wonder if we will even continue to see any support at all from bioware, for that matter...
               
               

               


                     Modifié par Genisys, 09 août 2010 - 04:58 .