To make any given creature your party leader and delete the default PC, run the following script:
#include "events_h"
#include "wrappers_h"
#include "utility_h"
#include "core_h"
void main()
{
object oPC = GetHero();
event ev = GetCurrentEvent();
int nEventType = GetEventType(ev);
switch(nEventType)
{
case EVENT_TYPE_ENTER:
{
object oLeader = UT_GetNearestCreatureByTag(oPC,"insert_ID_here");
WR_SetFollowerState(oLeader, FOLLOWER_STATE_ACTIVE);
SetPartyLeader(oLeader);
WR_SetFollowerState(oPC, FOLLOWER_STATE_INVALID);
SetObjectActive(oPC, 0);
Safe_Destroy_Object(oPC,0);
}
}
HandleEvent(ev, RESOURCE_SCRIPT_AREA_CORE);
}
The event stuff can be changed to any other suitable event. As mentioned below, you can in fact set this as an area script and event_type_enter will run as soon as the area loads.
Where I've put insert_ID_here, put the tag of your creature (in quotes), for example "gen00fl_alistair". You can also use a constant to refer to a creature ID.
object oLeader = etc and object oPC = etc find your creature and the default protagonist respectively in the game world. From there, you use the WR functions to mark your characters as valid/invalid party members. Then you switch the leader to your new party member creature, set the old PC to inactive and delete it.
Modifié par FergusM, 15 janvier 2010 - 09:40 .





Retour en haut







