Author Topic: nw_o2_skeleton modification  (Read 605 times)

Legacy_Knight_Shield

  • Hero Member
  • *****
  • Posts: 812
  • Karma: +0/-0
nw_o2_skeleton modification
« on: August 18, 2012, 06:02:04 pm »


               I would like to spawn the creature at the placeable by triggeer instaed of this being in heartbeat of placeable.

You already know if 10 placeables on map then thats 10 heartbeats ,so if I can modify to go into trigger say get closest palceable spawn creature.


//////script///////


void ActionCreate(string sCreature, location lLoc)
{   
CreateObject(OBJECT_TYPE_CREATURE, sCreature, lLoc);
}
void main()
{   object oCreature = GetNearestCreature(CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_IS_PC); 
 if (GetIsObjectValid(oCreature) == TRUE && GetDistanceToObject(oCreature) < 10.0) 
 { 
  effect eMind = EffectVisualEffect(VFX_FNF_SUMMON_UNDEAD);   
string sCreature = "NW_SKELWARR01"; 
  // * 10% chance of a skeleton chief instead   
if (Random(100) > 90)   
{   
    sCreature = "NW_SKELCHIEF";    } 
  location lLoc = GetLocation(OBJECT_SELF);   
DelayCommand(0.3, ActionCreate(sCreature, lLoc)); 
  ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eMind, GetLocation(OBJECT_SELF));    SetPlotFlag(OBJECT_SELF, FALSE);   
DestroyObject(OBJECT_SELF, 0.5);   
}
}
               
               

               


                     Modifié par Knight_Shield, 18 août 2012 - 05:04 .
                     
                  


            

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0
nw_o2_skeleton modification
« Reply #1 on: August 18, 2012, 06:29:18 pm »


               I tried this with an area of effect on a placeable. It is effective, and eliminates heartbeat scripts. I called this: AOE Powered Gargoyles.

Let me know if that is of any use to you.
               
               

               
            

Legacy_ffbj

  • Hero Member
  • *****
  • Posts: 1097
  • Karma: +0/-0
nw_o2_skeleton modification
« Reply #2 on: August 18, 2012, 10:29:33 pm »


               Instead of destoying the trigger you can always just reset it to a specified time.
Like:

 int iReset = GetLocalInt(OBJECT_SELF, "RESET");
         if(iReset == 1)
         return;
   //above placed before the trigger fires
   DelayCommand,SetLocalInt(OBJECT_SELF, "RESET", 1);
   /above placed /after the trigger fires
 DelayCommand (200.0, SetLocalInt(OBJECT_SELF, "RESET", 0));//alter reset up or down.
  //at the end to reset the trigger
               
               

               


                     Modifié par ffbj, 18 août 2012 - 09:38 .
                     
                  


            

Legacy_Knight_Shield

  • Hero Member
  • *****
  • Posts: 812
  • Karma: +0/-0
nw_o2_skeleton modification
« Reply #3 on: August 19, 2012, 12:51:27 am »


                Ok I put this in a trigger near placable.





void main()
{object oPC = GetEnteringObject();
if (!GetIsPC(oPC)) return;
int nActive = GetLocalInt(OBJECT_SELF, "ACTIVE");
if ((nActive == 0) !=0)
{
object oStatue = GetNearestObjectByTag("skeletonbones");
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_COM_CHUNK_STONE_MEDIUM), GetLocation(oStatue));ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectDamage(GetCurrentHitPoints(oStatue)), oStatue);
object oTarget = GetNearestObjectByTag("skeletonbones");location lTarget = GetLocation(oTarget);
object oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "NW_SKELWARR01", lTarget);
//effect eMind = EffectVisualEffect(VFX_FNF_SUMMON_UNDEAD);

SetIsTemporaryEnemy(oPC, oSpawn);
//AssignCommand(oSpawn, ActionAttack(oPC));DelayCommand(0.5, ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_AC_BONUS), GetLocation(oSpawn)));SetLocalInt(OBJECT_SELF, "ACTIVE", 1);
DelayCommand(300.0, SetLocalInt(OBJECT_SELF, "ACTIVE", 1));
}
if ((nActive == 1) !=0)
{
return;
}
}



I would like to add this but cant seem to get it .


 if (Random(100) > 90)    {        sCreature = "NW_SKELCHIEF";    }




I also have a different script to respawn placable so I could remove it respawning from this one.
               
               

               


                     Modifié par Knight_Shield, 18 août 2012 - 11:57 .
                     
                  


            

Legacy_ffbj

  • Hero Member
  • *****
  • Posts: 1097
  • Karma: +0/-0
nw_o2_skeleton modification
« Reply #4 on: August 19, 2012, 08:08:11 am »


               You have not defined sCreature as a string anywhere string sCreature;

string sCreature;
 if (Random(100) > 90)    {        sCreature = "NW_SKELCHIEF";    }

Although you say that is from another script so I can only conjecture why it does not work, but that's my guess.

Additionally in the current script you have this at the bottom:
EffectVisualEffect(VFX_IMP_AC_BONUS), GetLocation(oSpawn)));SetLocalInt(OBJECT_SELF, "ACTIVE", 1);
DelayCommand(300.0, SetLocalInt(OBJECT_SELF, "ACTIVE", 1));//same as the above line?
//I think here in the delaycommand line you want to reset the trigger to O/Zero or just delete the local at that point, since you just set it Active to 1.  Also I find the nomenclature somewht confusing, in that when something is active it should work while here if it is active set to 1 it returns.  That last part is just a matter of taste.
               
               

               


                     Modifié par ffbj, 19 août 2012 - 07:18 .
                     
                  


            

Legacy_Knight_Shield

  • Hero Member
  • *****
  • Posts: 812
  • Karma: +0/-0
nw_o2_skeleton modification
« Reply #5 on: August 20, 2012, 03:35:34 pm »


               Yes this was from another script.


string sCreature;
if (Random(100) > 90)    {        sCreature = "NW_SKELCHIEF";    }

I tried this out .I run through level aand they spawn great and placable respawns.The only thing is the triggers wont fire .I have atleast 10 triggers in same area.I will try setting to 0 like you suggested.
               
               

               
            

Legacy_ffbj

  • Hero Member
  • *****
  • Posts: 1097
  • Karma: +0/-0
nw_o2_skeleton modification
« Reply #6 on: August 20, 2012, 03:51:07 pm »


               Yeah that should work. What would you think about an altar or some such edifice, that attracts certain sorts of creatures to it.  These would be monsters or creatures in the area and if they go near enough to the edifice/devise/whatever it would capture thie souls.  Storing the creatures for later when something it did not like wandered too close.  A of a well of souls sort of thing, and just like a box of chocolates ya never know what you are gonna get.
It's a concept.