Hello everyone, i need a little help with a custom companion i'm creating....everything is going great...but i can't find the sollution to the XP problem...my custom companion won't level up and get stuck at the same level all the time...
PD: I'm not using custom module, i make my mods (at least the characters & weapons) direct in the Single Player or Core Module...
companion XP won't change
Débuté par
raikwolf
, mai 02 2010 07:39
#1
Posté 02 mai 2010 - 07:39
#2
Posté 02 mai 2010 - 11:28
You must use:
SetLocalInt(oFollower, CREATURE_REWARD_FLAGS, 0);
somewhere after your script that hires the follower (and obviously before they can earn XP). I like to attach it to the EVENT_TYPE_PARTYMEMBER_ADDED handler for the module, and then invoke the party picker on hiring the character - this will guarantee that flag is cleared. You might be able to find a more elegant solution though.
SetLocalInt(oFollower, CREATURE_REWARD_FLAGS, 0);
somewhere after your script that hires the follower (and obviously before they can earn XP). I like to attach it to the EVENT_TYPE_PARTYMEMBER_ADDED handler for the module, and then invoke the party picker on hiring the character - this will guarantee that flag is cleared. You might be able to find a more elegant solution though.
#3
Posté 03 mai 2010 - 12:30
well i'm giving up with this anyway :s everything works fine except for the xp thing and that is the most important XD...thanks anyway
EDIT:
this is how i'm using scripts and plot actions...
conversation... 2nd line call gen00pt_party: GEN_CASTOR_RECRUITED....
3rd line call gen00pt_party: GEN_HIRE_FOLLOWER...
4th line call script: hire_test_____this is the script:
-------------------
void main(){ ShowPartyPickerGUI(); //Shows the Party Picker; necessary for the follower to gain XP}
-------------------
everything works great, the follower is recruited and added to the party (and the partypicker) but i still have the xp thing
...and this is where i do not know where to put:'SetLocalInt(oFollower, CREATURE_REWARD_FLAGS, 0);'
i understand that it should be in the module script...but the thing is that i work direct on the single player module....i always add comments to my editions so that way i always remember what i have done with the script....
thx for the help!!
EDIT:
this is how i'm using scripts and plot actions...
conversation... 2nd line call gen00pt_party: GEN_CASTOR_RECRUITED....
3rd line call gen00pt_party: GEN_HIRE_FOLLOWER...
4th line call script: hire_test_____this is the script:
-------------------
void main(){ ShowPartyPickerGUI(); //Shows the Party Picker; necessary for the follower to gain XP}
-------------------
everything works great, the follower is recruited and added to the party (and the partypicker) but i still have the xp thing
i understand that it should be in the module script...but the thing is that i work direct on the single player module....i always add comments to my editions so that way i always remember what i have done with the script....
thx for the help!!
Modifié par raikwolf, 03 mai 2010 - 09:18 .
#4
Posté 04 mai 2010 - 02:37
Your problem is probably in your initial hire henchman script. HireFollower puts them in your party but doesn't "initialize" them (which includes setting their xp flag), which you need to do when they first become available. Check out the following page on the wiki.
http://social.biowar...llower_tutorial
http://social.biowar...llower_tutorial
#5
Posté 04 mai 2010 - 05:01
well i will keep trying but i still don't understand what i'm missing...when i follow the tutorial step by step i always get stuck in the module script :S
#6
Posté 08 mai 2010 - 09:00
bump! :s
#7
Posté 08 mai 2010 - 09:46
It doesn't have to be a module script, it can be any script that you can guarantee will fire after the follower has been hired. So assuming they don't need to earn XP in the hiring area, you could put a trigger near the exit, attach it to entering/leaving area events etc.
#8
Posté 09 mai 2010 - 12:33
If you're following the tutorial, since you're using the Party Picker, your module event script should look something like this:
[dascript]
#include "utility_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_PARTYMEMBER_ADDED:
{
object oFollower = GetEventObject(ev, 0);
SetLocalInt(oFollower, CREATURE_REWARD_FLAGS, 0);
AddCommand(oFollower, CommandJumpToLocation(GetLocation(GetHero())));
SetFollowerState(oFollower, FOLLOWER_STATE_ACTIVE);
// Set a plot flag here if required
break;
}
}
if (!nEventHandled) //If this event wasn't handled by this script, let the core script try
{
HandleEvent(ev, RESOURCE_SCRIPT_MODULE_CORE);
}
}
[/dascript]
[dascript]
#include "utility_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_PARTYMEMBER_ADDED:
{
object oFollower = GetEventObject(ev, 0);
SetLocalInt(oFollower, CREATURE_REWARD_FLAGS, 0);
AddCommand(oFollower, CommandJumpToLocation(GetLocation(GetHero())));
SetFollowerState(oFollower, FOLLOWER_STATE_ACTIVE);
// Set a plot flag here if required
break;
}
}
if (!nEventHandled) //If this event wasn't handled by this script, let the core script try
{
HandleEvent(ev, RESOURCE_SCRIPT_MODULE_CORE);
}
}
[/dascript]
Modifié par Proleric1, 09 mai 2010 - 12:34 .
#9
Posté 17 mai 2010 - 01:41
well i'm starting again with this (module and all that) thanks for the help and i will be posting any progress here....i will be doing everything in a diferent module and not in the single core mod like i was doing before...
#10
Posté 15 juillet 2010 - 07:23
Again i'm trying to make a companion, and AGAIN! i'm stuck with the XP thing, i did start over and did everything by tutorial....to my surprise IT'S NOT WORKING!!! all i need is to fix the XP issue.....everything else is working properly....
This is what i'm trying to do:
Create new companion and export it to the game (DONE)
Create a whole new set & weapons for companion (DONE)
i'm stuck at here trying to solved the XP thing....has i said before i followed the tutorial but it's not working...im trying to make an ADDON module not a STAND ALONE but i don't know if has something to do with this...
This is what i'm trying to do:
Create new companion and export it to the game (DONE)
Create a whole new set & weapons for companion (DONE)
i'm stuck at here trying to solved the XP thing....has i said before i followed the tutorial but it's not working...im trying to make an ADDON module not a STAND ALONE but i don't know if has something to do with this...
#11
Posté 26 juillet 2010 - 01:31
I've been making a companion mod as well and had trouble with that follower tutorial on the wiki too. If you're still having trouble, I may be able to assist you. I've got a couple scripts that work. Just PM me, and I'll send them to you. You'll just have to let me know if you want to use plots or a separate script.
#12
Posté 26 juillet 2010 - 01:40
The tutorial on the wiki (at least the bits I wrote, which I think is still most of it) doesn't address add-in follower concerns because all my work has been for stand-alone modules, and I wrote the article after spending quite a lot of time trying to solve the issue for stand-alone mods 
That being said the cause and solution to the XP problem are well known - the core scripts set the CREATURE_REWARD_FLAGS local int on the follower so that they do not gain XP. If you clear the flag in a script that fires AFTER the recruitment script, it will work:
SetLocalInt(oFollower, CREATURE_REWARD_FLAGS, 0);
The only material difference between an add-in and a standalone in this regard is that a standalone module can more easily get around the problem (eg by re-implementing recruitment, as the tutorial reccomends, and as classic Week proves to work). Clearing the flag in an add-in should still work as long as you find an appropriate place to do it.
That being said the cause and solution to the XP problem are well known - the core scripts set the CREATURE_REWARD_FLAGS local int on the follower so that they do not gain XP. If you clear the flag in a script that fires AFTER the recruitment script, it will work:
SetLocalInt(oFollower, CREATURE_REWARD_FLAGS, 0);
The only material difference between an add-in and a standalone in this regard is that a standalone module can more easily get around the problem (eg by re-implementing recruitment, as the tutorial reccomends, and as classic Week proves to work). Clearing the flag in an add-in should still work as long as you find an appropriate place to do it.
#13
Posté 26 juillet 2010 - 03:01
I didn't mean to insult. Your tutorial had all the essential parts (save for getting the follower in camp properly), but having bits of the necessary scripts scattered throughout the page and having several versions of them can easily confuse a noob such as myself (and presumably raikwolf). It just needs some reorganizing. That's all. No biggie.
#14
Posté 26 juillet 2010 - 03:37
I didn't mean to insult. Your tutorial had all the essential parts (save for getting the follower in camp properly), but having bits of the necessary scripts scattered throughout the page and having several versions of them can easily confuse a noob such as myself (and presumably raikwolf). It just needs some reorganizing. That's all. No biggie.
I wasn't insulted
#15
Posté 26 juillet 2010 - 03:43
As soon as I get the camp placement script working properly (Leliana sometimes disappears for no reason), I'll tackle updating the tutorial for add-ins. I'll try to combine all the bits and pieces of scripts into a noob-friendly, copy-and-paste version.
#16
Posté 27 juillet 2010 - 07:23
Well here's the thing!1) As i understand the Stand-Alone module needs a "module-script" while the add-in doesn't need any because it will work with the OC module script...
2) The tutorial actually works when using a Stand-Alone, but for add-ins won't work, so i guess that the "SetLocalInt(oFollower, CREATURE_REWARD_FLAGS, 0);" but it's just a guess i'm very bad at scripting
...
3) I've looking through the OC scripts for followers like Jory or Daveth and this is what i found:
case PRE_GA_JORY_AND_DAVETH_JOIN:
{if (!nNewValue)
break;
//--------------------------------------------------------------
// PRE_GA_JORY_AND_DAVETH_JOIN
// ACTION: Jory and Daveth join party
//--------------------------------------------------------------
object oDaveth;
object oJory;
//--------------------------------------------------------------
oDaveth = UT_GetNearestCreatureByTag(oPC, PRE_CR_DAVETH);
oJory = UT_GetNearestCreatureByTag(oPC, PRE_CR_JORY);
//--------------------------------------------------------------
UT_HireFollower(oDaveth, TRUE);
UT_HireFollower(oJory, TRUE);
break;
}
I don't know if this would work with a custom companion because i haven't test it yet...and well...i really don't remember if Jory and Daveth can gain XP
PD: I'm trying to create PLOT FOLLOWERS
2) The tutorial actually works when using a Stand-Alone, but for add-ins won't work, so i guess that the "SetLocalInt(oFollower, CREATURE_REWARD_FLAGS, 0);" but it's just a guess i'm very bad at scripting
3) I've looking through the OC scripts for followers like Jory or Daveth and this is what i found:
case PRE_GA_JORY_AND_DAVETH_JOIN:
{if (!nNewValue)
break;
//--------------------------------------------------------------
// PRE_GA_JORY_AND_DAVETH_JOIN
// ACTION: Jory and Daveth join party
//--------------------------------------------------------------
object oDaveth;
object oJory;
//--------------------------------------------------------------
oDaveth = UT_GetNearestCreatureByTag(oPC, PRE_CR_DAVETH);
oJory = UT_GetNearestCreatureByTag(oPC, PRE_CR_JORY);
//--------------------------------------------------------------
UT_HireFollower(oDaveth, TRUE);
UT_HireFollower(oJory, TRUE);
break;
}
I don't know if this would work with a custom companion because i haven't test it yet...and well...i really don't remember if Jory and Daveth can gain XP
PD: I'm trying to create PLOT FOLLOWERS
Modifié par raikwolf, 27 juillet 2010 - 07:28 .
#17
Posté 27 juillet 2010 - 07:39
First, you DO need a custom module script even for add-ins. It tells the game to look at your custom char_stage and deals with the partymember added and partymember dropped events.
Second, you need a hiring script. This is where the line "SetLocalInt(oFollower, CREATURE_REWARD_FLAGS, 0);" would go.
I made another follower tutorial on the wiki last night. http://social.biowar...lower_tutorial2
It has the scripts you'll need. The spawn camp scripts might be messed up, so use with caution or avoid for now.
Second, you need a hiring script. This is where the line "SetLocalInt(oFollower, CREATURE_REWARD_FLAGS, 0);" would go.
I made another follower tutorial on the wiki last night. http://social.biowar...lower_tutorial2
It has the scripts you'll need. The spawn camp scripts might be messed up, so use with caution or avoid for now.
#18
Posté 27 juillet 2010 - 07:50
nice i knew i had something really BAD!! xD thanks i'm gonna check it now!!





Retour en haut







