So I have this very large plot and it starts off fine but I'm stuck. getting it to finish. I have 22 followers that must be recruited before you can proceed with the quest. I have it set that the followers will not talk to you if you are not on the quest. When the quest is active I can hire them and stash them away in the partypicker as i gather more followers. Everytime a follower is added a set IS_RECRUITED happens in the conversation.
How do I get all 22 of those followers IS_RECRUITED flags to = EVERYONE_HIRED to trigger the end of my quest?
Thanks
Plot, grr
Débuté par
jsd313
, janv. 12 2010 01:16
#1
Posté 12 janvier 2010 - 01:16
#2
Posté 12 janvier 2010 - 01:41
Still having an issue.. My plot starts with a quest given from a conversation, that works. But from there none of the flags are getting set. I have tried doing it in a conversation to set it true, also with a script, and then with both at the same time.
Not very familiar with the plots but I understand the concept, just missing something to make it work as intended.
Any help on this would be awesome and appreciated.
Not very familiar with the plots but I understand the concept, just missing something to make it work as intended.
Any help on this would be awesome and appreciated.
Modifié par jsd313, 12 janvier 2010 - 11:00 .
#3
Posté 12 janvier 2010 - 11:34
Anyone good with plots and the scripts involved?
#4
Posté 12 janvier 2010 - 11:49
I'd like to help, but I'm afraid I really don't understand what the problem is. The plot flags aren't being set? That shouldn't be possible unless you're doing something very strange.
Do you have separate flags for each follower? Like BOB_IS_RECRUITED, LARY_IS_RECRUITED etc? Or do you have one IS_RECRUITED flag which is being set 22 different times, and grabs the conversations owner?
If the followers are recruited in a fixed order, you could make the flag for the last follower the one that determines if you've gotten all of them. If they are recruited in any order, then every time you hire one, you're going to have to somehow check all the followers and see if they are all recruited. With 22 followers that's a big task, but frankly it's a big, complicated quest so there's going to be a bit of complexity no matter what.
You could check all 22 plot flags each time you set any of the plot flags. Be aware that flags are set after the plot script runs, so the follower currently being recruited will come up as false, and that's slightly tricky to script around if you've got a generic handler. If there were a small number of followers it wouldn't be tough, but 22 different versions of the check is a lot. If you're confident the flags can't be set twice, just check if 21 have been set and it should be good.
You could also have a variable somewhere that tracks how many you've recruited and check when it reaches 22. That's also dependant on the flags not being set twice, unless you build in a do once for each flag.
Does that help? It’s not clear exactly where you’re stumbling so it’s hard to give advice.
Do you have separate flags for each follower? Like BOB_IS_RECRUITED, LARY_IS_RECRUITED etc? Or do you have one IS_RECRUITED flag which is being set 22 different times, and grabs the conversations owner?
If the followers are recruited in a fixed order, you could make the flag for the last follower the one that determines if you've gotten all of them. If they are recruited in any order, then every time you hire one, you're going to have to somehow check all the followers and see if they are all recruited. With 22 followers that's a big task, but frankly it's a big, complicated quest so there's going to be a bit of complexity no matter what.
You could check all 22 plot flags each time you set any of the plot flags. Be aware that flags are set after the plot script runs, so the follower currently being recruited will come up as false, and that's slightly tricky to script around if you've got a generic handler. If there were a small number of followers it wouldn't be tough, but 22 different versions of the check is a lot. If you're confident the flags can't be set twice, just check if 21 have been set and it should be good.
You could also have a variable somewhere that tracks how many you've recruited and check when it reaches 22. That's also dependant on the flags not being set twice, unless you build in a do once for each flag.
Does that help? It’s not clear exactly where you’re stumbling so it’s hard to give advice.
#5
Posté 13 janvier 2010 - 12:10
Yeah it's hard for me to explain as well lol.
I'll go ahead and paste my module script. Everything in here works excpet the plot stuff, it compiles just fine no spelling errors or anything.
[dascript]
#include "events_h"
#include "global_objects_h"
#include "utility_h"
#include "var_constants_h"
#include "wrappers_h"
#include "plt_wa_recruit"
void main()
{
event ev = GetCurrentEvent();
int nEventType = GetEventType(ev);
int nEventHandled = FALSE;
switch(nEventType)
{
case EVENT_TYPE_MODULE_START:
{
PreloadCharGen();
StartCharGen(GetHero(),0,1);
break;
}
}
switch(nEventType)
{
case EVENT_TYPE_SET_GAME_MODE:
{
int nGameMode = GetEventInteger(ev, 0);
if ( nGameMode == GM_DEAD )
{
DoAreaTransition("arena", "start");
nEventHandled = TRUE;
}
break;
}
}
switch(nEventType)
{
case EVENT_TYPE_PARTY_MEMBER_HIRED:
{
int nScaled = GetLocalInt(OBJECT_SELF, FOLLOWER_SCALED);
int nShowPartyPicker = GetEventInteger(ev, 0);
int nMinLevel = GetEventInteger(ev, 1);
int bPreventLevelup = GetEventInteger(ev, 2);
object oFollower = GetEventObject(ev, 0);
if (GetTag(oFollower) == "alistair") {
WR_SetPlotFlag(PLT_WA_RECRUIT, GEN_ALISTAIR_RECRUITED, TRUE);
}
if (GetTag(oFollower) == "anora") {
WR_SetPlotFlag(PLT_WA_RECRUIT, GEN_ANORA_RECRUITED, TRUE);
}
if (GetTag(oFollower) == "branka") {
WR_SetPlotFlag(PLT_WA_RECRUIT, GEN_BRANKA_RECRUITED, TRUE);
}
if (GetTag(oFollower) == "brianna") {
WR_SetPlotFlag(PLT_WA_RECRUIT, GEN_BRIANNA_RECRUITED, TRUE);
}
if (GetTag(oFollower) == "duncan") {
WR_SetPlotFlag(PLT_WA_RECRUIT, GEN_DUNCAN_RECRUITED, TRUE);
}
if (GetTag(oFollower) == "hyde") {
WR_SetPlotFlag(PLT_WA_RECRUIT, GEN_HYDE_RECRUITED, TRUE);
}
if (GetTag(oFollower) == "janice") {
WR_SetPlotFlag(PLT_WA_RECRUIT, GEN_JANICE_RECRUITED, TRUE);
}
if (GetTag(oFollower) == "jowan") {
WR_SetPlotFlag(PLT_WA_RECRUIT, GEN_JOWAN_RECRUITED, TRUE);
}
if (GetTag(oFollower) == "lanaya") {
WR_SetPlotFlag(PLT_WA_RECRUIT, GEN_LANAYA_RECRUITED, TRUE);
}
if (GetTag(oFollower) == "leliana") {
WR_SetPlotFlag(PLT_WA_RECRUIT, GEN_LELIANA_RECRUITED, TRUE);
}
if (GetTag(oFollower) == "lenka") {
WR_SetPlotFlag(PLT_WA_RECRUIT, GEN_LENKA_RECRUITED, TRUE);
}
if (GetTag(oFollower) == "loghain") {
WR_SetPlotFlag(PLT_WA_RECRUIT, GEN_LOGHAIN_RECRUITED, TRUE);
}
if (GetTag(oFollower) == "morrigan") {
WR_SetPlotFlag(PLT_WA_RECRUIT, GEN_MORRIGAN_RECRUITED, TRUE);
}
if (GetTag(oFollower) == "nina") {
WR_SetPlotFlag(PLT_WA_RECRUIT, GEN_NINA_RECRUITED, TRUE);
}
if (GetTag(oFollower) == "oghren") {
WR_SetPlotFlag(PLT_WA_RECRUIT, GEN_OGHREN_RECRUITED, TRUE);
}
if (GetTag(oFollower) == "paige") {
WR_SetPlotFlag(PLT_WA_RECRUIT, GEN_PAIGE_RECRUITED, TRUE);
}
if (GetTag(oFollower) == "smith") {
WR_SetPlotFlag(PLT_WA_RECRUIT, GEN_SMITH_RECRUITED, TRUE);
}
if (GetTag(oFollower) == "sten") {
WR_SetPlotFlag(PLT_WA_RECRUIT, GEN_STEN_RECRUITED, TRUE);
}
if (GetTag(oFollower) == "thorn") {
WR_SetPlotFlag(PLT_WA_RECRUIT, GEN_THORN_RECRUITED, TRUE);
}
if (GetTag(oFollower) == "victor") {
WR_SetPlotFlag(PLT_WA_RECRUIT, GEN_VICTOR_RECRUITED, TRUE);
}
if (GetTag(oFollower) == "wynne") {
WR_SetPlotFlag(PLT_WA_RECRUIT, GEN_WYNNE_RECRUITED, TRUE);
}
if (GetTag(oFollower) == "zevran") {
WR_SetPlotFlag(PLT_WA_RECRUIT, GEN_ZEVRAN_RECRUITED, TRUE);
}
}
break;
}
switch(nEventType)
{
case EVENT_TYPE_PARTYMEMBER_ADDED:
{
object oFollower = GetEventObject(ev, 0);
SetLocalInt(oFollower, CREATURE_REWARD_FLAGS, 0);
SetFollowerState(oFollower, FOLLOWER_STATE_ACTIVE);
AddCommand(oFollower, CommandJumpToLocation(GetLocation(GetHero())));
}
break;
}
if (!nEventHandled)
{
HandleEvent(ev, RESOURCE_SCRIPT_MODULE_CORE);
}
}
[/dascript]
I'll go ahead and paste my module script. Everything in here works excpet the plot stuff, it compiles just fine no spelling errors or anything.
[dascript]
#include "events_h"
#include "global_objects_h"
#include "utility_h"
#include "var_constants_h"
#include "wrappers_h"
#include "plt_wa_recruit"
void main()
{
event ev = GetCurrentEvent();
int nEventType = GetEventType(ev);
int nEventHandled = FALSE;
switch(nEventType)
{
case EVENT_TYPE_MODULE_START:
{
PreloadCharGen();
StartCharGen(GetHero(),0,1);
break;
}
}
switch(nEventType)
{
case EVENT_TYPE_SET_GAME_MODE:
{
int nGameMode = GetEventInteger(ev, 0);
if ( nGameMode == GM_DEAD )
{
DoAreaTransition("arena", "start");
nEventHandled = TRUE;
}
break;
}
}
switch(nEventType)
{
case EVENT_TYPE_PARTY_MEMBER_HIRED:
{
int nScaled = GetLocalInt(OBJECT_SELF, FOLLOWER_SCALED);
int nShowPartyPicker = GetEventInteger(ev, 0);
int nMinLevel = GetEventInteger(ev, 1);
int bPreventLevelup = GetEventInteger(ev, 2);
object oFollower = GetEventObject(ev, 0);
if (GetTag(oFollower) == "alistair") {
WR_SetPlotFlag(PLT_WA_RECRUIT, GEN_ALISTAIR_RECRUITED, TRUE);
}
if (GetTag(oFollower) == "anora") {
WR_SetPlotFlag(PLT_WA_RECRUIT, GEN_ANORA_RECRUITED, TRUE);
}
if (GetTag(oFollower) == "branka") {
WR_SetPlotFlag(PLT_WA_RECRUIT, GEN_BRANKA_RECRUITED, TRUE);
}
if (GetTag(oFollower) == "brianna") {
WR_SetPlotFlag(PLT_WA_RECRUIT, GEN_BRIANNA_RECRUITED, TRUE);
}
if (GetTag(oFollower) == "duncan") {
WR_SetPlotFlag(PLT_WA_RECRUIT, GEN_DUNCAN_RECRUITED, TRUE);
}
if (GetTag(oFollower) == "hyde") {
WR_SetPlotFlag(PLT_WA_RECRUIT, GEN_HYDE_RECRUITED, TRUE);
}
if (GetTag(oFollower) == "janice") {
WR_SetPlotFlag(PLT_WA_RECRUIT, GEN_JANICE_RECRUITED, TRUE);
}
if (GetTag(oFollower) == "jowan") {
WR_SetPlotFlag(PLT_WA_RECRUIT, GEN_JOWAN_RECRUITED, TRUE);
}
if (GetTag(oFollower) == "lanaya") {
WR_SetPlotFlag(PLT_WA_RECRUIT, GEN_LANAYA_RECRUITED, TRUE);
}
if (GetTag(oFollower) == "leliana") {
WR_SetPlotFlag(PLT_WA_RECRUIT, GEN_LELIANA_RECRUITED, TRUE);
}
if (GetTag(oFollower) == "lenka") {
WR_SetPlotFlag(PLT_WA_RECRUIT, GEN_LENKA_RECRUITED, TRUE);
}
if (GetTag(oFollower) == "loghain") {
WR_SetPlotFlag(PLT_WA_RECRUIT, GEN_LOGHAIN_RECRUITED, TRUE);
}
if (GetTag(oFollower) == "morrigan") {
WR_SetPlotFlag(PLT_WA_RECRUIT, GEN_MORRIGAN_RECRUITED, TRUE);
}
if (GetTag(oFollower) == "nina") {
WR_SetPlotFlag(PLT_WA_RECRUIT, GEN_NINA_RECRUITED, TRUE);
}
if (GetTag(oFollower) == "oghren") {
WR_SetPlotFlag(PLT_WA_RECRUIT, GEN_OGHREN_RECRUITED, TRUE);
}
if (GetTag(oFollower) == "paige") {
WR_SetPlotFlag(PLT_WA_RECRUIT, GEN_PAIGE_RECRUITED, TRUE);
}
if (GetTag(oFollower) == "smith") {
WR_SetPlotFlag(PLT_WA_RECRUIT, GEN_SMITH_RECRUITED, TRUE);
}
if (GetTag(oFollower) == "sten") {
WR_SetPlotFlag(PLT_WA_RECRUIT, GEN_STEN_RECRUITED, TRUE);
}
if (GetTag(oFollower) == "thorn") {
WR_SetPlotFlag(PLT_WA_RECRUIT, GEN_THORN_RECRUITED, TRUE);
}
if (GetTag(oFollower) == "victor") {
WR_SetPlotFlag(PLT_WA_RECRUIT, GEN_VICTOR_RECRUITED, TRUE);
}
if (GetTag(oFollower) == "wynne") {
WR_SetPlotFlag(PLT_WA_RECRUIT, GEN_WYNNE_RECRUITED, TRUE);
}
if (GetTag(oFollower) == "zevran") {
WR_SetPlotFlag(PLT_WA_RECRUIT, GEN_ZEVRAN_RECRUITED, TRUE);
}
}
break;
}
switch(nEventType)
{
case EVENT_TYPE_PARTYMEMBER_ADDED:
{
object oFollower = GetEventObject(ev, 0);
SetLocalInt(oFollower, CREATURE_REWARD_FLAGS, 0);
SetFollowerState(oFollower, FOLLOWER_STATE_ACTIVE);
AddCommand(oFollower, CommandJumpToLocation(GetLocation(GetHero())));
}
break;
}
if (!nEventHandled)
{
HandleEvent(ev, RESOURCE_SCRIPT_MODULE_CORE);
}
}
[/dascript]
#6
Posté 13 janvier 2010 - 12:11
bah dascript not working?
#7
Posté 13 janvier 2010 - 12:20
Oh and I have tried to put the plot stuff under PARYMEMBER_ADDED but didn't work there either. My plot is all main flags, all the ones listed in the script then one for START and one for DONE. I added journal entries for the follow flags for testing and i have yet to get any of them to update that.
Something tells me I have spend a lot of time doing this really wrong lol.
Something tells me I have spend a lot of time doing this really wrong lol.
#8
Posté 13 janvier 2010 - 12:22
Are the flags not being set, or is the script just not running? You didn't set the optional runscript paramater to TRUE for any of those WR_SetPlotFlag calls, so any custom scripting attached to the flags won't run. Is that the issue?
#9
Posté 13 janvier 2010 - 12:27
I don't believe my flags are being set. I started this with just the plot and conversations. When things didn't work I added the script and things still don't work.
Like I said I also set a journal entry for each follower and also included an ambient owner line in the conversation only to be visibale if GEN_FOLLOWERNAME_RECRUITED is true. I have yet to see an ambient line after hiring them, also no journal updates.
Hope that gives you more of an idea.
Like I said I also set a journal entry for each follower and also included an ambient owner line in the conversation only to be visibale if GEN_FOLLOWERNAME_RECRUITED is true. I have yet to see an ambient line after hiring them, also no journal updates.
Hope that gives you more of an idea.
Modifié par jsd313, 13 janvier 2010 - 12:32 .
#10
Posté 13 janvier 2010 - 12:37
Yeah, sounds like the flags aren't being set.
Have you verified that your version of the script is being run at all? You could put a series of plot flag sets, or even better log messages at the top of the script and then into the various cases to see where it's breaking down. If you can't get a plot flag at the top of the script to fire, then you know your script isn't being run. That could mean it's not compiling, or it's not exporting to the right place, or there's another version of it somewhere that the game is using instead for some reason.
One thing that looks a little odd is you have the line switch(nEventType) several different times. Normaly you'd only have one switch to branch off the different events. Is there a reason you have three?
Have you verified that your version of the script is being run at all? You could put a series of plot flag sets, or even better log messages at the top of the script and then into the various cases to see where it's breaking down. If you can't get a plot flag at the top of the script to fire, then you know your script isn't being run. That could mean it's not compiling, or it's not exporting to the right place, or there's another version of it somewhere that the game is using instead for some reason.
One thing that looks a little odd is you have the line switch(nEventType) several different times. Normaly you'd only have one switch to branch off the different events. Is there a reason you have three?
#11
Posté 13 janvier 2010 - 12:46
Im not familiar with setting up the log or UI boxes to show if things are happening. If you could help me with that Id appreciate it.
As far the extra switches.. I'm still a noob at scripting, I'm a systems engineer lol. I removed them, thanks for that info
As far the extra switches.. I'm still a noob at scripting, I'm a systems engineer lol. I removed them, thanks for that info
Modifié par jsd313, 13 janvier 2010 - 01:11 .
#12
Posté 13 janvier 2010 - 04:08
I have a better idea. instead of this plot. My whole problem is that if I have a full party, I can still add followers. Everytime I add a follower the partypicker is loaded but if you don't clear the party then you have the 3 ppl that where with you plus the one you just recruited. And with 22 followers you can form an army, but thats another mod
#13
Posté 13 janvier 2010 - 05:32
#14
Posté 13 janvier 2010 - 08:02
If I were you I'd do this:
int recruited = 0; <-----before the case switch
f (GetTag(oFollower) == "loghain") {
WR_SetPlotFlag(PLT_WA_RECRUIT, GEN_LOGHAIN_RECRUITED, TRUE);
recruited = recruited +1; <---add this to every case
}
Then, every time you recruit someone, you also adda check to see if recruited = 22.
int recruited = 0; <-----before the case switch
f (GetTag(oFollower) == "loghain") {
WR_SetPlotFlag(PLT_WA_RECRUIT, GEN_LOGHAIN_RECRUITED, TRUE);
recruited = recruited +1; <---add this to every case
}
Then, every time you recruit someone, you also adda check to see if recruited = 22.
#15
Posté 13 janvier 2010 - 08:13
The above requires a local variable, or some alternative that I hear someone is likely to release quite soon.
#16
Posté 13 janvier 2010 - 08:32
jsd313 wrote...
Im not familiar with setting up the log or UI boxes to show if things are happening. If you could help me with that Id appreciate it.
If you just want quick interactive feedback in the game, use floaty messages:
DisplayFloatyMessage(GetHero(), "Some message");
Ciao, muh!
#17
Posté 13 janvier 2010 - 01:46
Thanks for the ideas and info guys. I would rather not force people to hire all the followers. I was only trying to do that to avoid the more than 3 in the party problem.
So if I have no plot, no quest I just want to recruit people and have the game know when my party is full and not allow me to recruit more without clearing a spot.
If i have people recruited and no one in my party I can go to the party picker and and I can only add 3 people. So I need to know how to limit active followers to 3 like the main campaign does when hiring.
Like I was saying I could go to each person and recruit them and have all of them following behind me, but obviously only the first 3 I recruited show in my party window. I just want the game to keep track of my party size and not allow me to run around with more than 3 followers at a time.
Once all the people are recruited and in the party picker everything is fine. I just need a solution for my mod to handle the party size like the main game does.
Thanks again guys, I appreciate your time.
So if I have no plot, no quest I just want to recruit people and have the game know when my party is full and not allow me to recruit more without clearing a spot.
If i have people recruited and no one in my party I can go to the party picker and and I can only add 3 people. So I need to know how to limit active followers to 3 like the main campaign does when hiring.
Like I was saying I could go to each person and recruit them and have all of them following behind me, but obviously only the first 3 I recruited show in my party window. I just want the game to keep track of my party size and not allow me to run around with more than 3 followers at a time.
Once all the people are recruited and in the party picker everything is fine. I just need a solution for my mod to handle the party size like the main game does.
Thanks again guys, I appreciate your time.
#18
Posté 13 janvier 2010 - 06:51
Any idea how the game keeps track of your party size? And is it something I can control?
#19
Posté 13 janvier 2010 - 07:50
GetArraySize(GetPartyList()) will work, but this I believe this includes summoned creatures.
#20
Posté 13 janvier 2010 - 11:08
hmm, I'll see what I can do with that. Thanks Craig.
#21
Posté 13 janvier 2010 - 11:30
Striking out on finding any good info on that command. Where would I put that in my script, under PARTYMEMBER ADDED or hired? And then what kinda of variables would I have to use to get the partymembers. All are set to team 1 if that would help me..
#22
Posté 14 janvier 2010 - 07:09
Craig Graff wrote...
The above requires a local variable, or some alternative that I hear someone is likely to release quite soon.
Didn't I add a local variable at the top?
AFAIK, if this is a module script, it should increment correctly. B f'course, I could be wrong...
#23
Posté 14 janvier 2010 - 07:33
He meant a permanent local variable. Something that you would add to var_module. Your local variable would be reset every time you enter that script so you wouldn't be able to use it to count how many times you have recruited somebody.
#24
Posté 14 janvier 2010 - 01:49
Yeah this is a tough one for me. The worst part is once I do get that working I then need to find a way to only allow you to have 1-3 party members depending on what type of battle you do. 2v2, 3v3, and 4v4. And of course I would love to be able to do all this with just scripts but.. w/e lol





Retour en haut






