When it comes time to spawn companions in an area, I am currently hitting a bit of a brick wall. I have created a generic onload script for the area:
// Area OnClientEnter Bare Bones.nss
// client_enter_laboratory <--- Sabranic 1/5/16
/*
Area OnClientEnter event handler template.
Bare bones, useful to setup cutscene(s) to fire when the party enters via a party transition.
*/
// BMA-OEI 8/08/06
#include "ginc_cutscene"
int StartingConditional()
{
// Event fired via non-party transition (Load Game, Client Join, etc.)
if ( FiredFromPartyTransition() == FALSE )
{
return ( FALSE );
}
// Get party leader, force control of owned PC
object oPC = GetFirstEnteringPC();
object oLeader = GetFactionLeader( oPC );
oPC = SetOwnersControlledCompanion( oLeader );
object oSpeaker;
string sDialog;
// *** CUTSCENES START ***
// Cutscene: TITLE_GOES_HERE
// Uncomment and replace ( FALSE ) with condition to play cutscene
/*
if ( FALSE )
{
// Pre-cutscene setup
//
oSpeaker = GetNearestObjectByTag( "TAG_OF_OWNER", oPC ); // Conversation owner
sDialog = "DIALOG_GOES_HERE"; // Conversation file
FireAndForgetConversation( oSpeaker, oPC, sDialog );
return ( TRUE );
}
*/
// *** CUTSCENES END ***
// No cutscene pending, revert control to original character
SetOwnersControlledCompanion( oPC, oLeader );
return ( FALSE );
}
Ok everything is peachy. Now I go to add the adapted spawning code from the guide:
int bSpawned = GetLocalInt(OBJECT_SELF, "SPAWNED");
if(!bSpawned)
{
// Spawn Safiya (id is eve)
SpawnNonPartyRosterMemberAtHangout("eve");
SetLocalInt(OBJECT_SELF, “SPAWNED”, TRUE);
}
The adapted code looks like this:
// Area OnClientEnter Bare Bones.nss
// client_enter_laboratory <--- Sabranic 1/5/16
/*
Area OnClientEnter event handler template.
Bare bones, useful to setup cutscene(s) to fire when the party enters via a party transition.
*/
// BMA-OEI 8/08/06
#include "ginc_cutscene"
int bSpawned = GetLocalInt(OBJECT_SELF, "SPAWNED");
if(!bSpawned)
{
// Spawn Safiya (id is eve)
SpawnNonPartyRosterMemberAtHangout("eve");
SetLocalInt(OBJECT_SELF, “SPAWNED”, TRUE);
}
int StartingConditional()
{
// Event fired via non-party transition (Load Game, Client Join, etc.)
if ( FiredFromPartyTransition() == FALSE )
{
return ( FALSE );
}
// Get party leader, force control of owned PC
object oPC = GetFirstEnteringPC();
object oLeader = GetFactionLeader( oPC );
oPC = SetOwnersControlledCompanion( oLeader );
object oSpeaker;
string sDialog;
// *** CUTSCENES START ***
// Cutscene: TITLE_GOES_HERE
// Uncomment and replace ( FALSE ) with condition to play cutscene
/*
if ( FALSE )
{
// Pre-cutscene setup
//
oSpeaker = GetNearestObjectByTag( "TAG_OF_OWNER", oPC ); // Conversation owner
sDialog = "DIALOG_GOES_HERE"; // Conversation file
FireAndForgetConversation( oSpeaker, oPC, sDialog );
return ( TRUE );
}
*/
// *** CUTSCENES END ***
// No cutscene pending, revert control to original character
SetOwnersControlledCompanion( oPC, oLeader );
return ( FALSE );
}
It throws the following error: Invalid declaration type - it seems to hate "if(!bSpawned)"
Trying to figure out what I am doing wrong here.





Retour en haut







