Aller au contenu

Photo

What happened to my "FOLLOWER_STATE_AVAILABLE" party member? [Solved]


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

#1
Challseus

Challseus
  • Members
  • 1 032 messages
Hello all.

So, I'm having some minor issues attemtping to transition removed party members between areas that are a part of the same area list. I'm currently using the function, SetLocation(), with normal NPC's with no issues. In fact, it works with some removed party members (more on that below), but the side effect is not desireable.

When I'm removing party members, when you get through all the wrapped functionality of UT_FireFollower, it comes down to the function, SetFollowerState(). Now, by default, it passes the constant, FOLLOWER_STATE_AVAILABLE to it. This is all well and good, until I try to call SetLocation. The removed party transitions somewhere, thing is, I have no idea where that somewhere is!

Now, if I pass the parameter, FOLLOWER_STATE_INVALID, to SetFollowerState, the transitions work perfectly. Except for one thing... Any abilities/items/etc. stored in the quickslots are gone. They're still available to the party member, just removed from the quickslots. Oh, and any custom tactics that were set on them when they spawned are wiped away as well. Not exactly what I want.

So, I have a bunch of workarounds that I won't go into, but before I hack things up, I was wondering if there was some other method I was perhaps missing? I mean, what happened to that party member when they were transitioned? Where the hell are they?! Posted Image

Modifié par Challseus, 03 juillet 2010 - 11:17 .


#2
TimelordDC

TimelordDC
  • Members
  • 923 messages
I assume all the tests were done with the same location? Eliminating the possibility that the location is the problem.

Perhaps when they are set to FOLLOWER_STATE_AVAILABLE, the party member is moved to the char_stage area? Have you tried setting the area component of the location to the area you want to transition to - just in case the game is trying to get the location in char_stage and moving them there?



Of course, for FOLLOWER_STATE_INVALID, I guess the game doesn't want to store a bunch of information about NPCs that are no longer in the party pool.

#3
Challseus

Challseus
  • Members
  • 1 032 messages
Hey.

So yeah, I'm using the same location in each test. When I run it with the FOLLOWER_STATE_INVALID, it works, with the FOLLOWER_STATE_AVAILABLE, it does not work. Furthermore, I explicitly set the area of the location in a wrapper script I created:

/**
 * This method will jump a creature between areas to another object.
 */
void TransitionToObject(object oCreature, object oTarget)
{
    vector v = GetPosition(oTarget);
    location loc = Location(GetArea(oTarget), v, 0.0);
    SetLocation(oCreature, loc);
}

Oh well, thanks for the help. I'll just fall back to plan b.

EDIT - Just re-read your post. Going to try to force the use of the particular area, to see what happens.
EDIT 2 - No dice...

Modifié par Challseus, 30 juin 2010 - 02:20 .


#4
Proleric

Proleric
  • Members
  • 2 346 messages
Have you considered using UT_PCJumpOrAreaTransition instead of SetLocation?

I had the same issue with follower quickslots. In general, I find that follower code can be fragile unless I do things exactly like the OC, hence the suggestion above.

Modifié par Proleric1, 01 juillet 2010 - 04:25 .


#5
Challseus

Challseus
  • Members
  • 1 032 messages

Proleric1 wrote...

Have you considered using UT_PCJumpOrAreaTransition instead of SetLocation?

I had the same issue with follower quickslots. In general, I find that follower code can be fragile unless I do things exactly like the OC, hence the suggestion above.


Hey Proleric.

So, I'm using SetLocation because I *only* want to transition a temporarily removed party member. The former will jump the entire party, at least that is what I get when looking at its implementation. My use of SetLocation also assumes that the areas are in the same area list. I'm not worrying about the other case at the moment.

For instance, a healer joins my party, and I fight with them for a while. Now, we get to a town that has been attacked by darkspawn, and the healer decides to walk into a building to heal some of the sick, while I (the main PC) stays outside to get more details on what happened.

I wanted to be able to have them walk towards the house, and when they get to the door, transition into the house (via a trigger on the ground). When I eventually make my way into the house, they should be in there. If they are removed with the "FOLLOWER_STATE_INVALID" constant, they will be, minus quickslot and tactics settings. If I use "FOLLOWER_STATE_AVAILABLE", I literally have no idea where they have gone. However, if I add them back to the party, they show up shortly after the call.

Hmm, now that I think about, I guess I can call a GetArea(GetObjectByTag("partymember")) to see if that returns anything, but the problem still stands.

Any thoughts...

#6
FergusM

FergusM
  • Members
  • 460 messages
Just a random thought, but when are you moving them to the new area? When they reach the door? You could try calling it again when the PC enters that area.

#7
Proleric

Proleric
  • Members
  • 2 346 messages
Apologies, you did say that the party member was "removed", but I missed it.

To be honest, I had so much difficulty with this that I decided to do everything in the Party Picker once the follower has been hired.

If we could figure out exactly how the OC removes a companion temporarily, I'd say the trick is to remove them, play a "walking into building" cutscene, then (when the player enters the building) activate a copy of the companion which is already placed inside the building.

One example in the OC would be where the player goes into the Fade from Redcliffe to save Connor from the demon.

That assumes the party picker is disabled - I'm not sure if there's an OC example where a follower leaves but the party picker is still enabled?

Sorry this isn't much help!

#8
Challseus

Challseus
  • Members
  • 1 032 messages

FergusM wrote...

Just a random thought, but when are you moving them to the new area? When they reach the door? You could try calling it again when the PC enters that area.


Heh, that's actually what my hack work around was. That has a drawback however. Even though they are properly transitioned when the PC enters the area, when I leave, then come back, they're gone again. Where to, who the hell knows... I know I can hack it even further by transitioning them everytime I enter the area while a certain plot flag is set, or whatever, but I want to move on to something else at the moment, hoping a more elegant solution presents itself.

Thanks for the thoughts, though.

#9
Challseus

Challseus
  • Members
  • 1 032 messages

Proleric1 wrote...

Apologies, you did say that the party member was "removed", but I missed it.

To be honest, I had so much difficulty with this that I decided to do everything in the Party Picker once the follower has been hired.

If we could figure out exactly how the OC removes a companion temporarily, I'd say the trick is to remove them, play a "walking into building" cutscene, then (when the player enters the building) activate a copy of the companion which is already placed inside the building.

One example in the OC would be where the player goes into the Fade from Redcliffe to save Connor from the demon.

That assumes the party picker is disabled - I'm not sure if there's an OC example where a follower leaves but the party picker is still enabled?

Sorry this isn't much help!

No worries. Yeah, having copies of party members could work as well. However, I have absolutely no reason why, but I am just against it in principle, unless it's a last resort. I'm just weird like that Posted Image There's gotta be a way to do this the right way.

One thing you mentioned was enabling/disabling the party picker. How does one go about doing that? Maybe that would solve all my problems. As Timelord suggested, maybe when they are removed/transitioned, they are ending up there? I haven't done any development with the party picker (my mod won't need it), so my knowledge of it is around 0%.

#10
Proleric

Proleric
  • Members
  • 2 346 messages
There's an area variable called PARTY_PICKER_ENABLED, which determines whether the player can select the party picker.

There are also functions, SetPartyPickerGUIStatus and ShowPartyPickerGUI. The first one determines whether the player can select the party picker, while the second displays the party picker. The OC sets the status to PP_GUI_STATUS_USE before calling ShowPartyPickerGUI.

I'm not sure whether the functions override the area settings (or vice-versa), as I'm currently using the latter only.

Regarding the possibility of making a copy of the follower, the OC often handles multiple locations that way, so I tend to go with the flow.

#11
FergusM

FergusM
  • Members
  • 460 messages
Oh, something that might be relevant; the party picker is located in an area called char_stage that is always loaded. If you're looking for the area where your party member goes, it's probably there.

#12
Challseus

Challseus
  • Members
  • 1 032 messages
Woo hoo! Okay, I think I've got it solved. I added a quick call when entering the area, like so:

Debug("AREA NAME = " + GetName(GerArea(GetObjectByTag("partymember"))));

This returned the exact area they're supposed to be in, so that was a good sign. Then, I had a light bulb moment! Maybe removing party members with the "FOLLOWER_STATE_AVAILABLE" constant, and transitioning them to another area sets their active status to FALSE under the hood. Well, I explicitly called SetObjectActive, set it to TRUE, and of course, the party member was where they should be.

So, I think that about wraps this up. I can finally move on with my life Posted Image

EDIT - Of course, when you leave the area, and come back, they're inactive again. Oh well, now that I know what the issue is, I can start to build the workarounds.

Modifié par Challseus, 03 juillet 2010 - 03:10 .


#13
Proleric

Proleric
  • Members
  • 2 346 messages
That's a major leap forward! Are the quickslots populated correctly, too?

#14
Challseus

Challseus
  • Members
  • 1 032 messages

Proleric1 wrote...

That's a major leap forward! Are the quickslots populated correctly, too?


Yep, quick slots are good, as well as any tactics you had previously set. They're still set inactive when you leave the area, but it's a minor thing. I've already gotten a workaround in place, where all "FOLLOWER_STATE_AVAILABLE" party members are set active if not so, when the PC enters an area. May not apply to other modules, but for mine, they way I handle party members, it's just fine.

So glad to be done with this one. Gave me nightmares Posted Image