Aller au contenu

Photo

How do I do this?


  • Veuillez vous connecter pour répondre
1 réponse à ce sujet

#1
AnnoyingDisplayName

AnnoyingDisplayName
  • Members
  • 53 messages
I don't know if this is the right forum or not so I have same question topic on Toolset script forum. My question was how do I use "AddNonPartyFollower". I'm trying to create a script to make my NPC to follow me in some area without me having to add them into my party. Many Thanks to someone willing to help me.
EDIT: I looked up the script called "bhn200cr_cousland_follower" and "bhn200ar_castle_after_siege"  that was created by the developers. I tried to modify it but my NPCs are not still following me. These the scripts that I looked at

"bhn200cr_cousland_follower.nss"
//::///////////////////////////////////////////////
//:: Creature Events
//:: Copyright © 2003 Bioware Corp.
//:://////////////////////////////////////////////
/*
    Creature events for Cousland nonparty followers
*/
//:://////////////////////////////////////////////
//:: Created By: Cori
//:: Created On: 30/01/09
//:://////////////////////////////////////////////
#include "log_h"
#include "utility_h"
#include "wrappers_h"
#include "events_h"
void main()
{
    event ev = GetCurrentEvent();
    int nEventType = GetEventType(ev);
    string sDebug;
    object oPC = GetHero();
    object oParty = GetParty(oPC);
    int nEventHandled = FALSE;
    switch(nEventType)
    {
        ////////////////////////////////////////////////////////////////////////
        // Sent by: AI scripts
        // When: The current creature dies
        ////////////////////////////////////////////////////////////////////////
        case EVENT_TYPE_DEATH:
        {
            object oKiller = GetEventCreator(ev);
            int nFollower = GetLocalInt(OBJECT_SELF,CREATURE_DO_ONCE_A);
            //If the creature has been flagged as a non-party follower
            if(nFollower == TRUE)
            {
                object oArea = GetArea(OBJECT_SELF);
                //subtract from the nonpartyfollower counter, so more can be added later
                int nNonPartyFollowers = GetLocalInt(oArea,AREA_COUNTER_1)-1;
                SetLocalInt(oArea,AREA_COUNTER_1,nNonPartyFollowers);
            }
            break;
        }
    }
    if (!nEventHandled)
    {
        HandleEvent(ev, RESOURCE_SCRIPT_CREATURE_CORE);
    }
}

Other ScriptImage IPB "bhn200ar_castle_after_siege.nss"

void BHN_CheckNonPartyFollower(object oCousland,string sWaypoint)
{
    object oArea = GetArea(oCousland);
    int nNonPartyFollowers = GetLocalInt(oArea,AREA_COUNTER_1);
    if(nNonPartyFollowers < 2)
    {
        nNonPartyFollowers = nNonPartyFollowers + 1;
        SetLocalInt(oArea,AREA_COUNTER_1,nNonPartyFollowers);
        //SET check for on death script
        SetLocalInt(oCousland,CREATURE_DO_ONCE_A,TRUE);
        AddNonPartyFollower(oCousland);


If I was to change it so that my people would follow me as nonpartymember, what parts should I modify to make it effective to my NPCs?

Modifié par AnnoyingDisplayName, 31 décembre 2009 - 07:24 .


#2
AnnoyingDisplayName

AnnoyingDisplayName
  • Members
  • 53 messages
I need some help from someone who knows the script well.