Author Topic: Goblins appear and children run after them ;)  (Read 316 times)

Legacy_simomate

  • Full Member
  • ***
  • Posts: 162
  • Karma: +0/-0
Goblins appear and children run after them ;)
« on: March 29, 2011, 02:02:02 am »


               I think I asked this like 6months ago, but I couldn't get it working. Anyhow, I cant find the old thread so I'll make a new

Basically, the player speaks to the kids and show them something. Then non-hostile goblins should appear (I don't want any fighting you see) and say something. Then the kids should exclaim, "Hey its those goblins!" or something like that. The children would then chase the goblins in the forest (And then the main character will have to rescue them of course xD)

Now I think I could do this by making a trigger or something that makes the goblins appear when the player says the right thing. They would be non-hostile of course. Then make the children and the goblin run into the forest and disappear. However, I can't workout how to get the goblins to appear during the converstation.
               
               

               
            

Legacy_Greyfort

  • Sr. Member
  • ****
  • Posts: 442
  • Karma: +0/-0
Goblins appear and children run after them ;)
« Reply #1 on: April 10, 2011, 06:33:53 am »


               Thats the magic of the tabs in the conv=[conversation scrpt.]  In your conv if you look to the bottom right you will see some tabs. Text appears when... and action taken. this tab is there for the npc talking and the player characters reply.

kid[npc red color] Hi did you know we have criters in these woods...
player[pc blue color] Yeah I know about the creatures kid...
player[pc blue color] No what creatures...for ease have the below script fire or" action taken" tab here.

// crtr_goblin
void main()
{

int a;

object oPC = GetPCSpeaker();
//                           "kid tag here"
object oKid = GetObjectByTag("NW_MALEKID01");

/////////////////////////////////////////////////////////////////
// creat goblin location based on oTarget from lexicon
// stalker script (but in an NPC's OnHeartbeat script)
// supplied by Cheiron
    object oTarget=oKid;// oPC;//oKid;
    object oArea = GetArea(oTarget);
    vector vPosition = GetPosition(oTarget);

    float fOrientation = GetFacing(oTarget);
    // this is where AngleToVector shows it's powers!!
    vector vNewPos = AngleToVector(fOrientation);
    // creates random effect location to be created at.
    float fRndmX = IntToFloat( Random(1) );
    float fRndmY = IntToFloat( Random(1) );
//   you need to adjust the - or + to get the effect you want.
    float vX = vPosition.x + fRndmX;
    float vY = vPosition.y + fRndmY;
    float vZ = vPosition.z;

    vNewPos = Vector(vX, vY, vZ);
location lLocation = Location(oArea, vNewPos, fOrientation);

// you can use nwn goblin ResRef "nw_goblina" or create one "ResRef of gob"
object oGoblin = CreateObject(OBJECT_TYPE_CREATURE,"nw_goblina",lLocation);

//////////////////////////////////////////////////////////
// if you use nwn goblin YOU MUST do below script
//    ClearPersonalReputation(oPC,oGoblin);
   AssignCommand(oGoblin, ClearAllActions(TRUE));
   // Change NPC to Commoner Faction so no longer hostile
   ChangeToStandardFaction(oGoblin, STANDARD_FACTION_COMMONER);
}
               
               

               
            

Legacy_Greyfort

  • Sr. Member
  • ****
  • Posts: 442
  • Karma: +0/-0
Goblins appear and children run after them ;)
« Reply #2 on: April 13, 2011, 09:55:14 pm »


               I can also put togeather a small mod example if it would help you just send me a PM with your email and I will Get that done for ya.