I'm trying to have my creature ship join my party, and take control for the area. Ship is added to roster on module load, added to party on client enter via this script:
[nwscript]// k_sphere_client_enter
/*
On Client Enter script for sphere interior map area.
*/
// JH/EF-OEI: 01/17/08
// b.b. 5/16/11
#include "ginc_overland"
#include "ginc_overland_constants"
/*--------------------------\\
| Party Actor Functions |
\\--------------------------*/
int StartingConditional()
{
object oPC = GetFirstEnteringPC();
object oShip;
effect eEffect;
while(GetIsObjectValid(oPC))
{
if(GetIsPC(oPC))
{
PrettyDebug("Swapping UI for " + GetName(oPC));
//ActivateOLMapUI(oPC);
}
oPC = GetNextEnteringPC();
}
object oLeader = GetFactionLeader(GetFirstPC(TRUE));
//Add ship to party
//oShip = SpawnRosterMember("Ship",GetLocation(oLeader));
AddRosterMemberToParty("Ship",oLeader);
SetPartyActor(oShip,oLeader);
object oParty = GetFirstFactionMember(oLeader, FALSE);
while(GetIsObjectValid(oParty))
{
PrettyDebug(GetName(oParty));
if(GetLocalInt(oParty, "pcshrunk") == FALSE)
{
ApplyEffectToObject(DURATION_TYPE_PERMANENT, EffectSetScale(0.05, 0.05, 0.05),oParty);
SetLocalInt(oParty, "pcshrunk", TRUE);
SetLocalInt(oParty, "bLoaded", TRUE);
}
//if(oParty != GetFactionLeader(oParty))
SetScriptHidden(oParty, TRUE, FALSE);
oParty = GetNextFactionMember(oLeader, FALSE);
}
string sSpawnScript = GetLocalString(OBJECT_SELF, "sSpawnScript");
//ApplyEffectToObject(DURATION_TYPE_PERMANENT, EffectPolymorph(0, 1),oPC);
if( sSpawnScript!= "")
{
ExecuteScript(sSpawnScript, OBJECT_SELF);
}
int nDay = GetCalendarDay();
int nMonth = GetCalendarMonth();
int nYear = GetCalendarYear();
if(!IsMarkedAsDone())
{
InitializeNeutralEncounter(oPC);
SetGlobalInt(VAR_CURRENT_DAY, nDay);
SetGlobalInt(VAR_CURRENT_MONTH, nMonth);
SetGlobalInt(VAR_CURRENT_YEAR, nYear);
int nGoodiesTotal = GetLocalInt(OBJECT_SELF, VAR_GOODIES_TOTAL);
int nGoodiesPerSpawn = nGoodiesTotal / 10;
float fDelay = 0.0f;
DelayCommand(fDelay, GerminateGoodies(nGoodiesPerSpawn));
fDelay += 1.0f;
DelayCommand(fDelay, GerminateGoodies(nGoodiesPerSpawn));
fDelay += 1.0f;
DelayCommand(fDelay, GerminateGoodies(nGoodiesPerSpawn));
fDelay += 1.0f;
DelayCommand(fDelay, GerminateGoodies(nGoodiesPerSpawn));
fDelay += 1.0f;
DelayCommand(fDelay, GerminateGoodies(nGoodiesPerSpawn));
fDelay += 1.0f;
DelayCommand(fDelay, GerminateGoodies(nGoodiesPerSpawn));
fDelay += 1.0f;
DelayCommand(fDelay, GerminateGoodies(nGoodiesPerSpawn));
fDelay += 1.0f;
DelayCommand(fDelay, GerminateGoodies(nGoodiesPerSpawn));
fDelay += 1.0f;
DelayCommand(fDelay, GerminateGoodies(nGoodiesPerSpawn));
fDelay += 1.0f;
DelayCommand(fDelay, GerminateGoodies(nGoodiesPerSpawn));
fDelay += 1.0f;
ResetSpecialEncounterTimer();
MarkAsDone();
}
return FALSE;
}[/nwscript]
Problem now is, both the PC and ship are invisible, control is kept with PC (though I can switch back and forth) and the creatures in the area (will-o-wisps with planetoid model sefs) don't appear when I approach. I've played with the script a number of ways. Never have I had the ship initially given control (always had to click on its icon). PC is always invisible (hidden), and the best solution I got was the planetoid creatures (and a clone of the ship, which I'd also placed) appearing when I clicked over to ship. Also, vfx on ship doesn't ever appear (bubble with light) though it did on the clone.
Area is not an overland map per say. I just want to be able to force control to the ship character and keep it thusly if I can.
Am I misunderstanding things here?
SetPartyActor not working for me here
Débuté par
Boozehound Blue
, mai 23 2011 08:41
#1
Posté 23 mai 2011 - 08:41
#2
Posté 23 mai 2011 - 10:31
Dark Waters got around the problem by removing all companions and polymorphing the player into a ship. Unfortunately you occasionally saw the player polymorph back during area transitions, although I suppose you could fade to black before transitioning ("Pay no attention to that man behind the [black] curtain").
There were also many times in Dark Waters when player control was forced onto another companion (during the memory sequences, and once when controlling a lizardman-thingy).
There were also many times in Dark Waters when player control was forced onto another companion (during the memory sequences, and once when controlling a lizardman-thingy).
#3
Posté 23 mai 2011 - 11:24
I had hoped to have the ship separate from the player, that I may create some custom classes/feats/inventory etc.
Is this SetPartyActor function not intended to work the way I'm envisioning or what? Is it simply not possible to set control to the ship. I can hide the player, and I can make a screen to block character switching, I suppose. I didn't play SoZ, so don't know how they worked it, but their campaign script (k_ol_client_enter or such) was meaningfully different, it appeared to me.
Another possible solution was to have the player stand on a ship deck in an otherwise inaccessible portion of the map, so that their ship cannot pathfind to them (and vice versa). Then one could toggle between navigation and ship management. idk.
As far as Dark Waters goes, I played very little. It appears though some of those companion convos (like the prologue) may have been faked.
Is this SetPartyActor function not intended to work the way I'm envisioning or what? Is it simply not possible to set control to the ship. I can hide the player, and I can make a screen to block character switching, I suppose. I didn't play SoZ, so don't know how they worked it, but their campaign script (k_ol_client_enter or such) was meaningfully different, it appeared to me.
Another possible solution was to have the player stand on a ship deck in an otherwise inaccessible portion of the map, so that their ship cannot pathfind to them (and vice versa). Then one could toggle between navigation and ship management. idk.
As far as Dark Waters goes, I played very little. It appears though some of those companion convos (like the prologue) may have been faked.
#4
Posté 24 mai 2011 - 01:50
The difficult part of playing Dark Waters is getting through that initial monsterously long cut-scene. I almost gave up as well, after having 'played' it for about half an hour and barely being in control of the player at all. It was a lot longer still before you got to killl anything. Plus the constant reference to a monotheistic deity was weird.
If you can make it through part 1, then parts 2 and 3 more than make up for it (sailing, sea battles, digging for treasure... the whole pirate experience). Plus the numerous mini-games (alphabet assault being among my favourites).
If you can make it through part 1, then parts 2 and 3 more than make up for it (sailing, sea battles, digging for treasure... the whole pirate experience). Plus the numerous mini-games (alphabet assault being among my favourites).
#5
Posté 24 mai 2011 - 05:04
Got my script to work. I had forgotten to assign oShip to the actual object in the process of experimentation.
I still can't get the bubble vfx to show on my ship, and all the planetoid creatures suddenly burst into view when I reach a magic distance. Perhaps the latter can be helped by increasing the ships perception distance....
I still can't get the bubble vfx to show on my ship, and all the planetoid creatures suddenly burst into view when I reach a magic distance. Perhaps the latter can be helped by increasing the ships perception distance....





Retour en haut






