Aller au contenu

Photo

New Follower Fine-Tuning (Mostly Solved!)


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

#1
Jonathan Seagull

Jonathan Seagull
  • Members
  • 418 messages
Hi all,

I've got my custom follower all set up and he seems to be running fine after joining the party.  I just have three relatively minor issues (currently) to ask about.  This is an add-in to the main campaign, by the way.

First, after I add him to my team via the partypicker, it seems to create a duplicate (in a different spot; I think the party member is the duplicate).  So there is one that is in my party, and another that is just standing there as he did before, and I can talk to both of them.  Do I need to despawn the original or is something else causing this?

Second, when I travel to the party camp, he stays with with me (in my party), so we're both running around.  How do I set it so that he is removed from my party upon entering the camp?

And on a related note, along with that, how do I add him into the camp in a specific spot after I've recruited him (just as Alistair, Zevran, Sten, et al. are)?  Do I need to follow this tutorial or has an alternative method been discovered since then?

Thanks in advance for help with any or all of these issues!

Edit:  I knew I forgot something!  How do I go about adding interjections for this follower into existing scenes (e.g. if I want him to say something during the Landsmeet, or while discussing how to deal with Connor, etc.).  I haven't been able to find information on this.

Modifié par Jonathan Seagull, 23 août 2010 - 05:24 .


#2
Karma

Karma
  • Members
  • 391 messages
1) I'll need to see your script to be sure, but it sounds like you spawned the creature to place him in the area and then created the follower again during the hiring process.



2) I wrote up a follower tutorial on the wiki that explains how to do this. Check http://social.biowar...lower_tutorial2 It's not done yet, but it might help get you started with the scripting bits.



Related note: That's a fairly easy way to do it. Or you could check out a local copy of the area you want to spawn the follower in. Insert a waypoint where you want the follower spawned. Use the location of the waypoint as the location of your spawned follower.



Edit: You have to duplicate the stage and conversation, add in your lines, set up the stage cameras/places, and set the new dialogue and stage to overwrite the originals. Obviously overwriting files can be problematic for compatibility, so do this as little as possible.

#3
Jonathan Seagull

Jonathan Seagull
  • Members
  • 418 messages
Thanks, satans_karma! You're tutorial was also quite helpful. I did have one question, though: In the hiring script (long version) you have, it includes spots for "INSERT COPIED CREATURE TAG" and "INSERT TAG OF ORIGINAL CREATURE." What are these referring to?

As for the interjections, I have a feeling I'm going to have to just explore some of the existing convos/interjections to really get the idea of how to go about it, but thanks for pointing me in the right direction.

I'm glad you talked about approval, though, because I keep forgetting about it. I'm going to try to test out some of the scripts you gave in the wiki tonight, so I'll let you know how they work. Thanks again!

Modifié par Jonathan Seagull, 21 août 2010 - 02:51 .


#4
Karma

Karma
  • Members
  • 391 messages
I've been working on hiring NPCs that already exist in the game (i.e. Cullen, Jowan, Gorim, and Ser Gilmore). In effort to override as little original content as possible, I chose to deactivate the original NPC ("original creature") and activate the clone ("copied creature") when I hire them. If you are creating a follower who does not yet exist in the game (and from your original post, it sounds like you are), you don't have to worry about the original creature. Matter of fact, that line has been commented out already, so you can just ignore it or delete it if you prefer. The copied creature is your follower. So you'll put your new follower's tag in for "INSERT COPIED CREATURE TAG."

#5
Jonathan Seagull

Jonathan Seagull
  • Members
  • 418 messages
Ah, okay thanks! I just noticed a small typo (I think) in section 5 of the wiki:

In the column that says "repeatable" check "yes" for "FOLLOWERNAME_IN_PARTY" and "FOLLOWERNAME_IN_PARTY."


Should the second be the _IN_CAMP flag?

Edit:  Sorry, one more question about your hiring script!  Under SetFollowerApprovalDescription(oFollower, 371487), is the number meant to be changed to one of the numbers (or is that the number; I'm losing track) I've associated with the follower, or should it be left as is?

Modifié par Jonathan Seagull, 21 août 2010 - 02:55 .


#6
Karma

Karma
  • Members
  • 391 messages
Yes, it should be in camp. I'll change it when I get a chance. FIXED  (I also added a script to help you spawn your follower in an area)

Leave that number as it is. That's the number that corresponds to "neutral" approval. It's a totally different number.

Modifié par satans_karma, 21 août 2010 - 04:51 .


#7
Jonathan Seagull

Jonathan Seagull
  • Members
  • 418 messages
Ah, thanks. I just encountered an interesting problem. I went to test the latest updates I had made, walked up to my follower, and found that he...had no head. Or neck. Having a headless follower could be fun, but I'd prefer this one not be. I'm not sure exactly what might have caused that.

Also, I tried your script for spawning him at camp, but found once again that Headless Joe remained in my party at camp. I also couldn't interact with him to start a conversation, although when I went to a different area I could. I'll have to look through his files and see if everything is in order.

Wait, perhaps I misunderstood.  Is your script meant only to originally spawn the follower at camp to start off so that you can meet/hire him?  If so, I supposed that probably wouldn't work for mine, who I've already hired.

Hmm, well the head issue might have something to do with the fact that his custom head morph no longer appears to be in the list, although it's still entered for Head Morph.  It's worth noting that just before this happened, I took everything out of the toolsetexport folder and placed it in the override folder for the first time, then did Empty Export Directories.  I wonder if something got lost....And his headmorph file is most definitely still in the override directory.  Does it also need to be somewhere else?

Modifié par Jonathan Seagull, 21 août 2010 - 05:37 .


#8
Karma

Karma
  • Members
  • 391 messages
I have no idea about the headless thing. Perhaps you forgot to assign a head morph in his creature properties?

EDIT: There are like 4 toolsetexport folders. You will probably have to reopen the mrh morph and post it to local again.

It doesn't actually spawn him at camp. It actually moves him to his spot in camp after he's been hired. I'm not sure why he's still following you around though; that's what the script is supposed to stop from happening... unless something is misspelled somewhere. That being said, I don't use the same script, so it's never been fully tested. Did the script compile?

Modifié par satans_karma, 21 août 2010 - 05:40 .


#9
Jonathan Seagull

Jonathan Seagull
  • Members
  • 418 messages
Yeah, that's what I wound up doing with the head and it's fine now. As for the script, it does indeed compile. Here is the exact script as I use it:



#include "utility_h"

#include "wrappers_h"

#include "party_h"

#include "camp_functions_h"

#include "plt_isaac_main_plot"

void main()

{

object oFollower = GetObjectByTag("PARTY_ISAAC");

//Follower's position <--- you should change vector below to your desired position in camp

vector vTent = Vector(124.363f,132.569f,-0.973541f);

location lTent = Location(GetArea(GetHero()), vTent, -159.7f);

command cMoveFollower = CommandJumpToLocation(lTent);

Camp_PlaceFollowersInCamp();

if(GetFollowerState(oFollower) != FOLLOWER_STATE_ACTIVE)

{

SetFollowerState(oFollower, FOLLOWER_STATE_AVAILABLE);

AddCommand(oFollower, cMoveFollower);

WR_SetObjectActive(oFollower, TRUE);

WR_SetPlotFlag(PLT_ISAAC_MAIN_PLOT, PARTY_ISAAC_IN_PARTY, FALSE, FALSE);

WR_SetPlotFlag(PLT_ISAAC_MAIN_PLOT, PARTY_ISAAC_IN_CAMP, TRUE, FALSE);

}

else

{

SetFollowerState(oFollower, FOLLOWER_STATE_AVAILABLE);

AddCommand(oFollower, cMoveFollower);

WR_SetObjectActive(oFollower, TRUE);

WR_SetPlotFlag(PLT_ISAAC_MAIN_PLOT, PARTY_ISAAC_IN_PARTY, FALSE, FALSE);

WR_SetPlotFlag(PLT_ISAAC_MAIN_PLOT, PARTY_ISAAC_IN_CAMP, TRUE, FALSE);

}

}



---------------------

As an aside, can you remind me where this script is being called from? Should it be included (#include) in the main module script?

#10
Karma

Karma
  • Members
  • 391 messages
I'm assuming the actual tag of your creature is party_isaac, so try not capitalizing PARTY_ISAAC. Maybe it's case sensitive.

This script is going to get called by the PRCSCR - the excel document converted to a gda file. If you haven't done that yet, that could be why it's not working.

Modifié par satans_karma, 21 août 2010 - 06:52 .


#11
Jonathan Seagull

Jonathan Seagull
  • Members
  • 418 messages
Yep, that's the tag. I changed it to lowercase, but I'll have to let you know whether or not that did anything tomorrow, since my area transition back to the world map seems to be broken at the moment and I should really get to bed. I have done the PRCSCR file, though.

Modifié par Jonathan Seagull, 21 août 2010 - 07:13 .


#12
Jonathan Seagull

Jonathan Seagull
  • Members
  • 418 messages
Just got back into town and wanted to let you know, satans_karma, that after testing the scripts with a lowercase tag I still could not get the camp spawning script (or the firing script) to work. I'll have to keep playing around with it tomorrow to see if there are problems somewhere else. But thanks again for all your help so far!

#13
Jonathan Seagull

Jonathan Seagull
  • Members
  • 418 messages
Ack. I may have been a little too tired last night. I looked through the stuff again today and found that the tags in certain places were not properly updated. Everything, including camp spawning and firing, seems to be working perfectly now. Thanks again, satans_karma!

Side Note:  It does seem that the tags are case sensitive.  I had them as All Caps because I thought I was supposed to use the exact formatting as the guide.  So yes, case sensitive.

The only issue still present is that of the duplicate follower, but I'm not too worried about that one right now.

Modifié par Jonathan Seagull, 23 août 2010 - 05:23 .


#14
Karma

Karma
  • Members
  • 391 messages
Can you send me your hiring script and tell me how you place him in your area?

#15
Midnari

Midnari
  • Members
  • 16 messages
I sorta have an issue with your script as well. I'm stuck at the Core Module script and keep getting three errors



E: 03:49:50 - midnight_module_core.nss - Unable to get the resource information for "camp_functions_h" of type "nss"



E: 03:49:51 - events_h.nss - events_h.nss(?): Script must contain either a main or StartingConditional



Though, I'll admit this is my first time using scripts. I'm going over and over your script cause I'm srue I missed something, any ideas?

#16
0x30A88

0x30A88
  • Members
  • 1 081 messages
The second error is just to ignore, never compile ..._h scripts alone, they are compiled with the script calling their function.



The first error tells you that a "camp_functions_h" named script is missing.

#17
Karma

Karma
  • Members
  • 391 messages
Just out of curiosity, Midnari, do you see a lot of folders and files in your palette window when you click on the All icon? If you're missing camp_functions_h, your toolset database could be corrupted.

#18
Midnari

Midnari
  • Members
  • 16 messages
I see about 25 folders and a few single files when I open up the tab.  By the way, you really did good on that tutorial. I'm pretty sure if it wasn't for my missing file, I'd be all right. However, I should ask, if that is the case, how would I go about getting those resources? Or would I simply have to reinstall the game. Though I'm not entirely sure the thing is corrupted. So far, I can quite a bit but this thing is evading me far more than I'd like.

But again, understand this is the first time I've ever used script. It's possible that I'm typing something in wrong or forgetting something.

Modifié par Midnari, 02 octobre 2010 - 02:28 .


#19
Karma

Karma
  • Members
  • 391 messages
If the folders are showing up, that's a good sign. In the search bar, look for camp_functions_h. Make sure that you have it. As Gisle said, you get that error when the file is missing. If it is there, try compiling again. If you don't have it, we can recreate it. 

Also, you're working within your own module, correct?

Modifié par satans_karma, 02 octobre 2010 - 02:48 .


#20
0x30A88

0x30A88
  • Members
  • 1 081 messages
I copy-pasted the one i found in the main campaign, copy this one and name it camp_functions_h.



#include "party_h"

#include "utility_h"

#include "wrappers_h"

#include "plt_gen00pt_party"

#include "sys_rewards_h"

#include "sys_ambient_h"

#include "camp_constants_h"



const string WP_CAMP_FOLLOWER_PREFIX = "wp_camp_";



void Camp_ActivateShrieks()

{



object [] arParty = GetPartyPoolList();

object [] arShrieks = UT_GetAllObjectsInAreaByTag(CAMP_SHRIEK_ATTACKER_NORM, OBJECT_TYPE_CREATURE);



int nPartySize = GetArraySize(arParty);

int nIndex;



for(nIndex = 0; nIndex < nPartySize; nIndex++)

{



// Max 4 Normal Shrieks.

if( nIndex >= 3 )

{

return;

}



else

{

object oAttacker = arShrieks[nIndex];



if( !IsInvalidDeadOrDying(oAttacker) )

{



WR_SetObjectActive(oAttacker, TRUE);



SetTeamId(oAttacker, CAMP_TEAM_DARKSPAWN_CAMP_ATTACKERS);



Log_Trace(LOG_CHANNEL_PLOT, "Activating normal shriek #: ", IntToString(nIndex + 1));



}



}



}



}



void Camp_FollowerAmbient(object oFollower, int bStart)

{



string sTag = GetTag(oFollower);

string sArea = GetTag(GetArea(oFollower));



Log_Trace(LOG_CHANNEL_PLOT, "Follower: " + sTag, "Found in Area: " + sArea);



// No movement phase, just animation.

SetLocalInt(oFollower, AMBIENT_ANIM_STATE, AMBIENT_ANIM_RESET);



int nAnim;



// Set ambient system variables

if(bStart)

{



// The Redcliff Castle main floor - climax.

// Alistair, Loghain and Morrigan are not in this area.

if(sTag == CAM_CASTLE_CLIMAX)

{



if (sTag == GEN_FL_DOG) nAnim = 4; // Relaxed.

else if(sTag == GEN_FL_WYNNE) nAnim = 85; // Listener Passive 3

else if(sTag == GEN_FL_STEN) nAnim = 19; // Arms crossed.

else if(sTag == GEN_FL_ZEVRAN) nAnim = 67; // Bored Loitering 1

else if(sTag == GEN_FL_OGHREN) nAnim = 103; // Bored Stationary.

else if(sTag == GEN_FL_LELIANA) nAnim = 14; // Listener Passive 2



Ambient_Start(oFollower, AMBIENT_SYSTEM_ENABLED, AMBIENT_MOVE_NONE, AMBIENT_MOVE_PREFIX_NONE, nAnim, AMBIENT_ANIM_FREQ_ORDERED);



}



// If in the party camp.

else/*((sTag == CAM_AR_ARCH1) || (sTag == CAM_AR_CAMP_PLAINS) || (sTag == CAM_AR_ARCH3))*/

{



if (sTag == GEN_FL_DOG) nAnim = 4; // Relaxed.

else if(sTag == GEN_FL_WYNNE) nAnim = 85; // Listener Passive 3

else if(sTag == GEN_FL_STEN) nAnim = 24; // Guard Wander Left and Right

else if(sTag == GEN_FL_ZEVRAN) nAnim = 67; // Bored Loitering 1

else if(sTag == GEN_FL_OGHREN) nAnim = 103; // Bored Stationary

else if(sTag == GEN_FL_LELIANA) nAnim = 71; // Chat by fire.

else if(sTag == GEN_FL_MORRIGAN) nAnim = 70; // Warm by fire.

else if(sTag == GEN_FL_ALISTAIR) nAnim = 100; // Squat by fire.

else if(sTag == GEN_FL_LOGHAIN) nAnim = 68; // Bored Loitering 2



Ambient_Start(oFollower, AMBIENT_SYSTEM_ENABLED, AMBIENT_MOVE_NONE, AMBIENT_MOVE_PREFIX_NONE, nAnim, AMBIENT_ANIM_FREQ_ORDERED);



}



Log_Trace(LOG_CHANNEL_PLOT, "Starting Ambient Animations for: " + sTag, "Playing Animation: " + IntToString(nAnim));



}



else

{



Ambient_Stop(oFollower);



}



}



void Camp_PlaceFollowersInCamp()

{

object oAlistair = Party_GetFollowerByTag(GEN_FL_ALISTAIR);

object oMorrigan = Party_GetFollowerByTag(GEN_FL_MORRIGAN);

object oDog = Party_GetFollowerByTag(GEN_FL_DOG);

object oWynne = Party_GetFollowerByTag(GEN_FL_WYNNE);

object oShale = Party_GetFollowerByTag(GEN_FL_SHALE);

object oSten = Party_GetFollowerByTag(GEN_FL_STEN);

object oZevran = Party_GetFollowerByTag(GEN_FL_ZEVRAN);

object oOghren = Party_GetFollowerByTag(GEN_FL_OGHREN);

object oLeliana = Party_GetFollowerByTag(GEN_FL_LELIANA);

object oLoghain = Party_GetFollowerByTag(GEN_FL_LOGHAIN);





// Activating any followers that are in the party





if(WR_GetPlotFlag( PLT_GEN00PT_PARTY, GEN_ALISTAIR_RECRUITED))

{

WR_SetPlotFlag(PLT_GEN00PT_PARTY, GEN_ALISTAIR_IN_CAMP, TRUE, TRUE);

WR_SetObjectActive(oAlistair, TRUE);

}

if(WR_GetPlotFlag( PLT_GEN00PT_PARTY, GEN_DOG_RECRUITED))

{

WR_SetPlotFlag(PLT_GEN00PT_PARTY, GEN_DOG_IN_CAMP, TRUE, TRUE);

WR_SetObjectActive(oDog, TRUE);

}

if(WR_GetPlotFlag( PLT_GEN00PT_PARTY, GEN_WYNNE_RECRUITED))

{

WR_SetPlotFlag(PLT_GEN00PT_PARTY, GEN_WYNNE_IN_CAMP, TRUE, TRUE);

WR_SetObjectActive(oWynne, TRUE);

}

if(WR_GetPlotFlag( PLT_GEN00PT_PARTY, GEN_SHALE_RECRUITED))

{

WR_SetPlotFlag(PLT_GEN00PT_PARTY, GEN_SHALE_IN_CAMP, TRUE, TRUE);

WR_SetObjectActive(oShale, TRUE);

}

if(WR_GetPlotFlag( PLT_GEN00PT_PARTY, GEN_STEN_RECRUITED))

{

WR_SetPlotFlag(PLT_GEN00PT_PARTY, GEN_STEN_IN_CAMP, TRUE, TRUE);

WR_SetObjectActive(oSten, TRUE);

}

if(WR_GetPlotFlag( PLT_GEN00PT_PARTY, GEN_ZEVRAN_RECRUITED))

{

WR_SetPlotFlag(PLT_GEN00PT_PARTY, GEN_ZEVRAN_IN_CAMP, TRUE, TRUE);

WR_SetObjectActive(oZevran, TRUE);

}

if(WR_GetPlotFlag( PLT_GEN00PT_PARTY, GEN_OGHREN_RECRUITED))

{

WR_SetPlotFlag(PLT_GEN00PT_PARTY, GEN_OGHREN_IN_CAMP, TRUE, TRUE);

WR_SetObjectActive(oOghren, TRUE);

}

if(WR_GetPlotFlag( PLT_GEN00PT_PARTY, GEN_LELIANA_RECRUITED))

{

WR_SetPlotFlag(PLT_GEN00PT_PARTY, GEN_LELIANA_IN_CAMP, TRUE, TRUE);

WR_SetObjectActive(oLeliana, TRUE);

}

if(WR_GetPlotFlag( PLT_GEN00PT_PARTY, GEN_MORRIGAN_RECRUITED))

{

WR_SetPlotFlag(PLT_GEN00PT_PARTY, GEN_MORRIGAN_IN_CAMP, TRUE, TRUE);

WR_SetObjectActive(oMorrigan, TRUE);

}

if(WR_GetPlotFlag( PLT_GEN00PT_PARTY, GEN_LOGHAIN_RECRUITED))

{

WR_SetPlotFlag(PLT_GEN00PT_PARTY, GEN_LOGHAIN_IN_CAMP, TRUE, TRUE);

WR_SetObjectActive(oLoghain, TRUE);

}





// Place all active party members in their spots

object [] arParty = GetPartyPoolList();

int nSize = GetArraySize(arParty);

int i;

object oCurrent;

string sWP;

object oWP;

int nXP;

int nHeroXP = GetExperience(GetHero());

// int nMinFollowerXP = FloatToInt(MIN_CAMP_FOLLOWER_XP * IntToFloat(nHeroXP));



// first, remove all map pins (in case someone left the group)

object [] arPins = GetObjectsInArea(OBJECT_SELF);

int nObjectsSize = GetArraySize(arPins);

int j;

object oCurrentObject;

for(j = 0; j < nObjectsSize; j++)

{

oCurrentObject = arPins[j];

if(GetObjectType(oCurrentObject) == OBJECT_TYPE_WAYPOINT && StringLeft(GetTag(oCurrentObject), 8) == WP_CAMP_FOLLOWER_PREFIX)

SetMapPinState(oCurrentObject, FALSE);

}





// then add the proper ones



for(i = 0; i < nSize; i++)

{

oCurrent = arParty[i];

if(GetObjectActive(oCurrent) && !IsHero(oCurrent))

{

sWP = WP_CAMP_FOLLOWER_PREFIX + GetTag(oCurrent);

UT_LocalJump(oCurrent, sWP);

oWP = GetObjectByTag(sWP);

SetMapPinState(oWP, TRUE);

SetImmortal(oCurrent, TRUE);

nXP = GetExperience(oCurrent);

RW_CatchUpToPlayer(oCurrent);



// Start the follower ambient system.

Camp_FollowerAmbient(oCurrent, TRUE);



}

}



}

#21
Midnari

Midnari
  • Members
  • 16 messages
Thanks, but before I go off and bury myself further, where should I add this to? Scripts, I would assume =p But which folder would it go under or does it really matter?

Actually, I can't save it under that name regardless. The file is supposedly there, according to the computer. Even though I can't search it out or find it.

"The resource name given is already in use and can not be used to create a new resource of this type."

However, I did search it out and nothing could be found. On Da Toolset or on my actual computer.

And yeah, I'm using my own module. So I'm not quite sure what to do here. Either the file is hiding in wait, or the thing really really doesn't like me. Created follower, waypoint has been added, I even have a companion mod from you. With the Non playable characters now being companions. Not sure if that means anything or not when it comes to those files though.

Sorry, seems like a got a bit more information now. I figured I'd try something. It didn't work, however, when I did, I also learned camp_constants_h is also missing. I think all of the camp things are missing but I doubt they'll let me add them either, as I've already found out with Camp_functions_h

Modifié par Midnari, 02 octobre 2010 - 03:13 .


#22
Karma

Karma
  • Members
  • 391 messages
When you search, are you searching under the "all" icon or something else? It should be in the "Party Camps" folder. Do you see that folder when you select the "all" icon?

#23
Midnari

Midnari
  • Members
  • 16 messages
Yeah, I checked it. The only thing remotely close to 'Camps' in the folders are objects. Like a campfire. Not even a visable Party_camp folder. I think your earlier assessment is right because, as I said, I tried to add the folder, but it said it was already in use, however I don't see a single Camp folder in the toolset.

#24
Karma

Karma
  • Members
  • 391 messages
Do you remember having any problems when installing the toolset?



I have 60 folders showing when I click the "ALL" icon in the palette window. How many do you see?

#25
Midnari

Midnari
  • Members
  • 16 messages
Oh yeah... I had a lot of problems getting that puppy installed. However, the last time I tried I managed to install it without much problem. 25. I think I'm going to just need to uninstall it and then reinstall it. Maybe that'll fix the issue.

Well I reinstalled it and I still only have 28 unopened folders. However, when I did install and configure it again. I went to open it and it said that it could not open the module it was apparently programmed too, so it opened a default module. Maybe that's the issue?


Edit: I researched the problem. Though I was using my own module earlier, it must have still been in demo mode somehow... I fixed that problem, but with my luck, I'll have a few more before the end of the night. =p Thanks for the help guys, I apologize for wasting your time. But you did me a good favor, I wouldn't have known what was up if you hadn't told me how many files I should have had.

I tried to make my own module again and it reverted back to demo mode even after I set it to single player. I found out why for that though, in case anyone else ever has this problem. It's the Higherarcy. I don't k now how to remove demo from the module management. But if you select Single on the higherarcy and then do the same for anyone you create, you'll have full access.

I'm a damn n00b <_<

Modifié par Midnari, 02 octobre 2010 - 06:20 .