Aller au contenu

Photo

Mengtzu's Monster Follower Tutorial


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

#1
Mengtzu

Mengtzu
  • Members
  • 258 messages
After spending several days cursing at followers, I think I've grokked them.

Accordingly, I made a tutorial on the wiki which I'd love for people to sanity-check before I link it publicly, especially the monster function.

Also, if a Bioware employee would like to say "oh, you just need to set gen_plot_magicfollower and the correct class, specialisation and autolevel template will be determined by sorcery" that would also be great ^_^

#2
FalloutBoy

FalloutBoy
  • Members
  • 580 messages
I just went through a similar ordeal over the past couple days. I did things a little differently, but not necessarily better. I would describe it but I'm worn out right now. I basically copied and renamed the script and plot gen00pt_party, removed anything related to the OC companions and added flags for my new ones. Then there was a bunch of 2DA editing similar to what you did except I also made new classes and packages for each of them. I may have had to do minor tweaks in some core scripts, I don't remember. Too tired right now.

Modifié par FalloutBoy, 06 janvier 2010 - 08:39 .


#3
gordonbrown82

gordonbrown82
  • Members
  • 544 messages
great job general content wise at least.

#4
AnnoyingDisplayName

AnnoyingDisplayName
  • Members
  • 53 messages
Do you have any knowledge on non party followers? That would help me a lot!

#5
wait what

wait what
  • Members
  • 15 messages
Can you please re-explain more clearly the steps in applying the basic scripts for enabling the hiring of the follower and the conversation to hire them.

ie. step-by-step guide to producing our first follower and hiring them with a conversation.



That first section on the hiring and convo scripts are rather vague to me. Its really difficult for me to understand. What do you mean by "otherwise you'll have to incorporate the event into your own script"? Which of my own scripts?

I really appreciate the work youve done to inform us all. but please improve the tutorial by making that bit more clear and straight-forward.



If you feel like doing a video tutorial then FastStone Capture is a great free program that will allow you to do a high quality one for free.



thanks much

#6
gordonbrown82

gordonbrown82
  • Members
  • 544 messages
i think in general it's good to have step-to-step instructions on how to do everything. that means that if a reader doesn't understand the more abstract instructions he/she can at least just follow the guide and learn how to do the thing.

Modifié par gordonbrown82, 07 janvier 2010 - 06:02 .


#7
gordonbrown82

gordonbrown82
  • Members
  • 544 messages
i suppose it's more of a drag to write though.

#8
Mengtzu

Mengtzu
  • Members
  • 258 messages
I'll check that out, see if I can make it more explicit :)

#9
Mengtzu

Mengtzu
  • Members
  • 258 messages
I added some examples for setting a module script and an action script from a conversation, I hope that cleared it up. I put in some links to other tutorials, since scripting fundamentals are a bit outside the scope of this article.  Let me know if there's any other spots like that!

Modifié par Mengtzu, 07 janvier 2010 - 10:54 .


#10
wait what

wait what
  • Members
  • 15 messages
thanks a lot. that seems to have made it rather more clear.



i have a question about the Script selected in Manage Modules > Properties (will call it the module global script). is this particular script file into which many different types of script code/text can be added?

Can you please show an example of a module global script?



I've made one already, but it only has one piece of code in there (the code to activate the character generation process at the start of the module game). So Im wondering how Im supposed to add additional pieces of code without breaking it.

#11
Mengtzu

Mengtzu
  • Members
  • 258 messages
 OK, generally if you want to add something to a module script, you want it to handle a different type of event.

If you've copied one of the chargen examples to make your module script, it should look something like this:




#include "events_h"

#include "global_objects_h"

#include "sys_chargen_h"




void main()
{


event ev = GetCurrentEvent();

int nEventType = GetEventType(ev); //extract event type from current event

int nEventHandled = FALSE; //keep track of whether the event has been handled


switch(nEventType)
{


case EVENT_TYPE_MODULE_START:

{

PreloadCharGen(); //preloads resources needed for character generation

StartCharGen(GetHero(),0); //initiates character generation


break;

}


}


if (!nEventHandled) //If this event wasn't handled by this script, let the core script try

{

HandleEvent(ev, RESOURCE_SCRIPT_MODULE_CORE);

}


}





See the switch(nEventType) ? Thats the bit where the script says "OK, I've got an event, what sort of events do you care about and what do you want to do with them?"

Most of the time when you edit a module script, you'll be adding in extra case blocks inside the {} for that switch, like so:

case EVENT_TYPE_WHATEVER:
{

DoSomething();
DoSomethingElse();

break;

}

The EVENT_TYPE_* are constants, you can find them by clicking the green C button in the scripting pane to the right when you open a script, and typing EVENT_TYPE into the filter.  You'll need to have #include utility_h" to see them.

You can add as many of those case blocks into that switch statement as you like.

For example, let's say we were doing the advanced version of my tutorial, now we want to intercept the follower joining or leaving the party.  That's two extra case blocks, like so:


#include "events_h"
#include "global_objects_h" 
#include "sys_chargen_h"
#include "utility_h"                                 //Remember to add any new includes your case blocks need.
#include "wrappers_h"                      
 #include "plt_bc_create_party"          //Including any plots you're using!

void main() {

event ev = GetCurrentEvent();
int nEventType = GetEventType(ev); //extract event type from current event
int nEventHandled = FALSE; //keep track of whether the event has been handled

switch(nEventType) { 

case EVENT_TYPE_MODULE_START:
{
PreloadCharGen(); //preloads resources needed for character generation
StartCharGen(GetHero(),0); //initiates character generation
break;
}

case EVENT_TYPE_PARTYMEMBER_ADDED:  //This is my first new case block      
 {

            object oFollower = GetEventObject(ev, 0);          
 SetLocalInt(oFollower, CREATURE_REWARD_FLAGS, 0);        
   SetFollowerState(oFollower, FOLLOWER_STATE_ACTIVE);

            if (GetTag(oFollower) == "bc_party_miera") {              
 WR_SetPlotFlag(PLT_BC_CREATE_PARTY, PARTY_MIERA_IN_PARTY, TRUE);          
 }

            break;        
}

        case EVENT_TYPE_PARTYMEMBER_DROPPED:              //This is my second    
   {
              object oFollower = GetEventObject(ev, 0);

              if (GetTag(oFollower) == "bc_party_miera") {            
   WR_SetPlotFlag(PLT_BC_CREATE_PARTY, PARTY_MIERA_IN_PARTY, FALSE);              
}

break;

        }

}

if (!nEventHandled) //If this event wasn't handled by this script, let the core script try
{
HandleEvent(ev, RESOURCE_SCRIPT_MODULE_CORE);


}


I hope that helps, I know script doesn't display clearly here :(

Modifié par Mengtzu, 08 janvier 2010 - 12:26 .


#12
wait what

wait what
  • Members
  • 15 messages
lol yes my module script is called chargen2.



ok, im understanding it a little better now.



i'll try following the tutorial again, however there is a couple more things ive noticed in the tutorial.



The override char_stage section.

When I double-click char_stage in the Palette Window list, it just opens a read only copy. Therefore I cant place the waypoint that way. How can I get an editable type of the char_stage?



Also when you give instructions for moving the char_stage.are and char_stage.lst files you say toolsetoverride folder when it should be toolsetexport.



Thanks again for your help

#13
Mengtzu

Mengtzu
  • Members
  • 258 messages
Good catches, I've fixed that up.



You need to check out the char_stage, I forgot all about it.

#14
wait what

wait what
  • Members
  • 15 messages
When moving the char_stage.are file, is it also essential to move the char_stage.lst file also?

Because I dont seem to have the char_stage.lst file in the same directory as the .are.

Also, which export menu option exactly should I choose to export the char_stage file?
This warning message shows up when i try some export options:
"W: - Found a duplicate file name between the core and the module resources. "char_stage.are"

Im getting close to getting it working.
Ive gotten to the point where I have conversation with the custom char, am able to select the recruit dialogue option, then the character stage appears (so something must be working), but only the player character shows up - the custom char does not.

Sorry for all the questions but Im keen to get it up and running.


OH. problem is probably that i forgot to add the chars tag instead of the one for your tutorial. :blink: so my char will hopefully appear on the character stage now.

Modifié par wait what, 08 janvier 2010 - 03:11 .


#15
wait what

wait what
  • Members
  • 15 messages
OK, am able to recruit the character, it appears on the character stage - so that is all working nice.



But now Im having trouble with setting their abilities.



I dont really want an autolevel selection. I just want to set all their skills/spells/stats/level so that when I recruit them they have those exact things I set.



In the creature properties editor, Ive tried setting the min level/max level to 4.

Ive also set the Package to (None) and PackageAI to (none), and selected the individual Skills, Spells, Talents in the Abilities section.

General Package Type is set to Party Member, and Rank is set to Player.

Settings all appear to be correct.



But when I recruit the character, they are at level 1, without the abilities i selected for them in the creature properties editing.



I just want to have the follower character delivered upon recruitment with the level and ability that I chose for them, and then have the player decide how to level them up rather than using an autolevel template.

#16
Mengtzu

Mengtzu
  • Members
  • 258 messages
The character is completely recreated in either player_core or hireCustomFollower (whichever you're using), so you'd have to do that afterwards. It is possible, but you're going to run into the bug with the skill tree not appearing, amongst other issues (the skill picker grants them XP, so it's very difficult to have them stay much below the PC in level).



You can grant the abilities (skills/talents/spells) you want using the AddAbility() function, set attributes with SetCreatureProperty(oHero, PROPERTY_ATTRIBUTE_STRENGTH, 16.00) and the like, and grant points to be spent with SetCreatureProperty(oHero,PROPERTY_SIMPLE_SKILL_POINTS, 2.00) and similar.



However I think you do need to go through an initial autolevel, so I would suggest making a template that only has one skill and one talent/spell. Use that, then remove the skill and spell using RemoveAbility(), then grant the exact stuff you want.



I was planning something like that, but I decided it's a huge pain and not really worth it. I think better practice is to construct a strong level up template using your knowledge of the game (so do your mages with the force/frost/mana clash/glyph lines and tons of magic), and then provide a respec script accessible from a conversation for each follower to strip them down and refund points if the player desires. I haven't implemented that yet, but I expect existing respec scripts can be easily repurposed for followers.




#17
wait what

wait what
  • Members
  • 15 messages
OK, but if I use a template how do I get the character to be a level higher than 1?



Perhaps it is achieved by a script that adds the necessary amount of xp to the character when the event of the character being recruited occurs? No idea what that ought to look like in script code.

#18
Lotion Soronarr

Lotion Soronarr
  • Members
  • 14 481 messages
Where exactly does he ALsomething.xls file for your follower package actually go?

#19
FalloutBoy

FalloutBoy
  • Members
  • 580 messages
The xls can go anywhere. The game only cares about the gda file that you produce from the xls. That file should be in the override folder for your addin.


#20
Mengtzu

Mengtzu
  • Members
  • 258 messages

wait what wrote...

OK, but if I use a template how do I get the character to be a level higher than 1?

Perhaps it is achieved by a script that adds the necessary amount of xp to the character when the event of the character being recruited occurs? No idea what that ought to look like in script code.


You can either use my hireCustomFollower script and pass target level as an argument (which if you are using an ALtable you'll probably want to do anyway), or you can just #include "sys_rewards_h" and:

int nXp = RW_GetXPNeededForLevel(Max(nTargetLevel, 1));
RewardXP(oFollower, nXp, FALSE, FALSE);

#21
wait what

wait what
  • Members
  • 15 messages
i'll try to get that code working...

#22
Lotion Soronarr

Lotion Soronarr
  • Members
  • 14 481 messages
I added some info on party selection animations to your tutorial.

#23
Mengtzu

Mengtzu
  • Members
  • 258 messages
Excellent, thanks Lotion!

#24
Lotion Soronarr

Lotion Soronarr
  • Members
  • 14 481 messages
Hm...why doens't autolevel work?



I get the NPC in the party, it's .xls file with autolevel data is done, it's specifified in the m2da (and the number and char tag are in the hireCustomCreatuer script)



Every time I test it by turning autolevel on or her, she gets totally random spells :(



I put the .xls in Addins/Modulename/modules/override

#25
Mengtzu

Mengtzu
  • Members
  • 258 messages
The xls or the gda? The XLS is just the source file for the gda, the game will only read the gda.