Aller au contenu

Photo

Companion despawning


  • Veuillez vous connecter pour répondre
21 réponses à ce sujet

#1
PJ156

PJ156
  • Members
  • 2 983 messages
I have used a ga_roster_despawn script from a convo to take an npc out of the party just at the end of the module. This is so that I can respawn the npc in a location away from the pc in the next module for her to rejoin at a later point in the story..

What I am finding is the npc despawns okay but in the new mod thay are back in the party. How should I manage this to do what I need. Should I need to ga_party_remove as well. I am at a bit of a loss here ...

If I cannot fix this I have to rework the whole of the module opening to accomodate the npc still bgeing there. Possible but frustrating :)

PJ

#2
Claudius33

Claudius33
  • Members
  • 258 messages
I usually do it by script. But yes, you must remove the npc from the party before despawning her.

In addition you absolutely must despawn a roster member not in the party before leaving a module. Otherwise s/he will regain the level and inventory s/he had when you left the module if you ever come back later to it.

#3
bealzebub

bealzebub
  • Members
  • 352 messages
could you just put a despawn on your new .mod's OnModuleLoaded or OnClient enter? That way it is before the PC sees them, but they are still in the party.

#4
PJ156

PJ156
  • Members
  • 2 983 messages
Thanks guys, I have now tried both of these and she does not leave the party.

I will try some other thoghts and come back with more later. I have tried quiet a few combinations now and I a very tempted to work around it.

The peoblem I have is that the early modules were built with little thoughts towards connecting them. Thay are a mess ... the problem could be anything unrelated to the spawn despawn process I just can't see what.

PJ

#5
Bardil2

Bardil2
  • Members
  • 5 messages
Use the script below to remove from party and then ga_force_exit. Seems to work OK, but I've not tested exhaustively (still writing the campaign that I used this in). The member can be respawned in another module of the campaign and will have all the gear that he had on exiting.

/*
Alternative to the supplied ga_roster_party_remove, which removes the companion
from the party and despawns them. This script will remove sRosterName from the party
but does not despawn them.
Can be used as an action in a conversation.
*/
#include "ginc_companion"

void main(string sRosterName)
{
object oPC = GetPCSpeaker();
RemoveRosterMemberFromParty(sRosterName, oPC, FALSE);
}

#6
PJ156

PJ156
  • Members
  • 2 983 messages
Thanks Bardil I will try that.

PJ

#7
Guest_Iveforgotmypassword_*

Guest_Iveforgotmypassword_*
  • Guests
ga_destroy works too and is fine if you intend to bring in a completely new version ( hair cut skills etc ).

#8
Bardil2

Bardil2
  • Members
  • 5 messages
Hi PJ -- Did you ever solve this?

#9
PJ156

PJ156
  • Members
  • 2 983 messages
I didn't sorry. I tried the script and it did not work for me in the way you describe.

I have worked round it now but I like to know why something is broke and this one just leaves me cold ...

Ah well, thanks for the help,

PJ

#10
Guest_Iveforgotmypassword_*

Guest_Iveforgotmypassword_*
  • Guests
Come to thik of it I remember having this problem with the GPS Packhorse and what I did was jumped it around out of sight so it rejoined the party when they arrived at the area it was waiting in. There is also something to do with setting a meeting point butI've never done it why not have a look at the OC and check a companions script as they can come and go as you please. It might even be one of the ready made ones if not just copy and paste it.

#11
Bardil

Bardil
  • Members
  • 3 messages
If you haven't already done so, you could try this function to change modules:
SaveRosterLoadModule("NewModName"); (requires #include"ginc_companion").

Again, this worked OK for me. Roster members not in the party were still not in the party on arriving in the new module.

#12
PJ156

PJ156
  • Members
  • 2 983 messages
Thanks again for the replies gents.

I will try that transisition when I get cack to this part later on. I have tried to look at the OC scripts but I have not isolated them. There is a companion system on the vault I intend looking at and I know Alupinu has done something like this in Fanglewood. The solutions are there it is finding the will power to impliment them in this group of modules which seem resistant to my wish to join them together :)

PJ

#13
Guest_Iveforgotmypassword_*

Guest_Iveforgotmypassword_*
  • Guests
Bardil has a good point and that's the script I use on transitions to new modules it even worked with a rather troublesome horse here it is..

#include "ginc_companion"
void main()
{
object oPC=GetClickingObject();
if(!GetIsPC(oPC))return;
int nInt;
nInt=GetLocalInt(oPC,"NW_JOURNAL_ENTRYwhatever has to be done");
if (nInt<8)
{
FloatingTextStringOnCreature("You shall not pass !",oPC);
return;
}
SaveRosterLoadModule("name of mod","tag of waypoint");
}

The nint bit just depends on the journal entry required to exit. If there are no conditions and the band of heroes can romp off to the next adventure scrap everything from int nInt to the Save Roster line.

#14
PJ156

PJ156
  • Members
  • 2 983 messages
I have not had the toolset time to work on this but i am back at it now and this is still causing me some stress.

I could not find the saveroster ... script but I think it needs EC_superinclude to weed it out. None the less on reading the descrition I don't think this is doing what I need to.

Here is what I am trying to do:

in Mod 1 the npc leaves you to go home ... she has no home in the sense that some module have an inn where the nocs make thier base. I despawn her then remove her from the roster. If I do not remove her from the roster then she appears at the strts of the new mod as do all npc's removed from the party but not from the roster.

In mod 2 I want to spawn the npc half way through the mod at the location where the PC meets her again.

For this I use

RosterAdd
RosterSpawn

She does not spawn .... ?

The only way I can spawn her is to calle her from her blueprint using SPAWN_CREATURE however I cannot then seem to get the ga_party_add script to work.

Its is all very frustrating. This should be simple stuff ?

Help and comments welcomed :)

PJ

#15
kevL

kevL
  • Members
  • 4 061 messages
have a look through 'ginc_companion'


some time ago i stumbled across the method used in the official campaigns: right at the beginning when the PC first enters the first module, *all* possible companions are added to the roster, and the CampaignNPC flag is set on them:

//This function flags a Roster Member as being a Campaign NPC
//Campaign NPCs are NPCs that are saved to the roster to make them
//persist across modules, but will not appear on the Roster Member
//Select Screen on clients as NPCs available for adding to the party.
//Note that scripts can still add and remove Campaign NPCs to the party,
//but the client will never be able to add them via the UI
//Returns false if it was unable to find the Roster Member to set them
//as a campaign NPC
int SetIsRosterMemberCampaignNPC( string sRosterName, int nCampaignNPC );


So instead of removing her from the roster just despawn her and try setting the CampaignNPC flag; it might not solve all the problems but it looks like the direction to go

( she might need a hangout to preserve her gamestate, idk )

#16
PJ156

PJ156
  • Members
  • 2 983 messages
Thanks, I will try that now and then I have another idea as well.

Yours first though.

PJ

#17
kevL

kevL
  • Members
  • 4 061 messages
g'Luck

#18
PJ156

PJ156
  • Members
  • 2 983 messages
Okay I have something and perhaps I have resolved this at the moment.

The campaign npc but not remove from the roster did not work sorry KevL, the npc remained in the party in mod 2 even though she despawned in mod 1.

It got the brain juices flowing though and this is what i did. I did not despawn the character in mod 1 I kept her in the party on transition to mod 2 and then despawned her in mod 2. I then respawned her where I needed her in the second mod. In this way she seems to have done what I need her to.

It is a compromise that I have to work the story so that all the critical npcs are in the party at the end of the mod I guess I will carry them to the next mod and spawn them to where I need them.

Story wise I can do this but for my next project I need something a bit more robust.

I think this is closed for now. thanks for the help guys. if there is more enlightenment out there please do post.

Cheers,

PJ

#19
Bardil

Bardil
  • Members
  • 3 messages
Hi PJ,

What you're trying to do is exactly what I do in my campaign, so I don't understand why it's not working for you as well. In my case the companion leaves in mod 2, doesn't feature at all in mod 3 and then comes back sometime in mod 4 (when he returns he's still got all the equipment, etc. that he had when he left)..
Sorry, don't know what else to suggest.

Bardil

#20
kevL

kevL
  • Members
  • 4 061 messages
I'm just wondering if there's another script somewhere, like ModuleLoad event or something like that, that's funky.

#21
Claudius33

Claudius33
  • Members
  • 258 messages
What is the exact order in which you want to implement thedespawning?

Mod 1 : recruit NPC
End of Mod 1 : despawn NPC (caution she absolutely must be removed from party first)
Mod 2 : move to a specific place to meet the NPC and recruit her again.

I did that in 16 Cygni 2, the NPCs reapppearing in 16 Cygni 3, so modules and modules after ... Worked like a charm. They came back in the exact state they had left, each in a diffrent locationj and module. I didn't removed them from the roster at all!

All NPC were defined as CampaingNPC. I have use ga_roster_party_remove_all, nDespawn set to 1, IgnoreSelectable set to 1 to remove from pârty and despawn tyhem but keeping them in the roster.
Then I immediatly issue a ga_roster_party_add for the NPC I wanted to keep alongside the PC.

You may  :
- have a conflicting script in the OnEnterModule, OnEnterArea ...
- or you recruited the NPC in Mod 2 before entering Mod1 but didn't despawn her.
- or you have two instances of the NPC in Mod2 (same tag) which may trigger some troubles ...

#22
PJ156

PJ156
  • Members
  • 2 983 messages
Thanks for the additional replies guys I am going to review the suggestions. One of the main problems is that, if I do not remove fromt he roster after despaning then the auto spawned on entry to the next module regardless of if the were in the party at the end of the last mod. I guess I could despawn them then but I have a solution now. I will try some of these others though. i am keen to find out what the issue is rather than fudging through it.

Thanks again,

PJ