Author Topic: Script kills conversation and request for script to initiate WP walking  (Read 389 times)

Legacy_ugge85

  • Newbie
  • *
  • Posts: 8
  • Karma: +0/-0


               Making scripts with Lilac's. I can't figure out how to make peope disappear easy so I made this destroy object script. It's used in a conversation but aborts it for some reason.. Tried both with and without animations.

---

void main()
{

object oPC = GetPCSpeaker();

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

//Visual effects can't be applied to waypoints, so if it is a WP
//the VFX will be applied to the WP's location instead

int nInt;
nInt = GetObjectType(oTarget);

if (nInt != OBJECT_TYPE_WAYPOINT) ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_TORNADO), oTarget);
else ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_TORNADO), GetLocation(oTarget));

DestroyObject(oTarget, 3.0);

}

---

Also looking for a script that can be placed in a conversation (and in the npc's onspawn?) to initiate a npc to start a wp route when triggered.

Any scripters around? ;D

Have searched for it.. but begining to suspect my internet is stuck in a time loop from around 2005-6 Oo

edit: and it's not destroying the npc the conversation is attached to, if that would cause problem. it's a multi conv
               
               

               


                     Modifié par ugge85, 22 décembre 2010 - 05:19 .
                     
                  


            

Legacy_NorthWolf

  • Full Member
  • ***
  • Posts: 143
  • Karma: +0/-0
Script kills conversation and request for script to initiate WP walking
« Reply #1 on: December 22, 2010, 04:41:20 pm »


               For the object destruction, there's three guesses I have:



1.) The script never gets called. Make sure it's properly called in the Actions Taken tab.

2.) The NPC is set to Plot or Immortal. Try inserting: SetIsDestroyable(TRUE) right before you call DestroyObject.

3.) Your tag is wrong in the GetObjectByTag. I would suggest you try just assigning OBJECT_SELF to oTarget, as I'm pretty sure scripts run in a conversation run off the NPC speaker.



For your other problem, there's a standard script for walking waypoints called "nw_walk_wp". If that doesn't work for you the "nw_i0_generic" include has a function called WalkWayPoints() that causes the called to, well... walk their waypoints.
               
               

               
            

Legacy_ugge85

  • Newbie
  • *
  • Posts: 8
  • Karma: +0/-0
Script kills conversation and request for script to initiate WP walking
« Reply #2 on: December 22, 2010, 06:11:37 pm »


               I went those points thru and I had accidently placed the script in the wrong tab, namely the "text appears if.."

Thx. And thx for telling me those wp scripts. They'll come in handy.
               
               

               


                     Modifié par ugge85, 22 décembre 2010 - 07:50 .