How to trigger one plot flag only after completing two conditions?
#1
Posté 21 avril 2010 - 11:16
For right now i'm gonna do a little work around with setting up having one follower as a condition to get the other. Which means when I recruit the last one it then triggers the flag that takes the quest to the next stage. But I'd much rather the player not to have to recruit them in a certin order nnot to mention I'm sure i'm gonna find many instances where I'm gonna find myself needing to know how to set this up.
If anyone can answer my question or point me in the direction of a wiki page that explains this that i've missed it would be very helpful.
#2
Posté 22 avril 2010 - 12:28
#3
Posté 22 avril 2010 - 01:08
event eParms = GetCurrentEvent();
int nFlag = GetEventInteger(eParms, 1); // Plot flag
int nValue = GetEventInteger(eParms, 2); // 0=Clear 1=Set
switch(nFlag)
{
case BRAN_JOIN:
{
if (nValue)
{
if (WR_GetPlotFlag(PLT_GET_DANNAL, DANNAL_JOIN))
WR_SetPlotFlag(PLT_ATTACK_NALDIS_STRONGHOL, ASSEMBLE_MEN, 1, TRUE);
}
break;
}
}
But I keep getting E: 20:06:22 - gh.nss - gh.nss(5): Invalid declaration type
#4
Posté 22 avril 2010 - 01:26
#5
Posté 22 avril 2010 - 01:34
#include "plt_attack_naldis_stronghol"
#include "plt_get_dannal"
#include "plt_get_bran"
event eParms = GetCurrentEvent(); int nFlag = GetEventInteger(eParms, 1); // Plot flag int nValue = GetEventInteger(eParms, 2); // 0=Clear 1=Set
switch(nFlag) { case BRAN_JOIN: { if (nValue) { if (WR_GetPlotFlag(PLT_GET_DANNAL, DANNAL_JOIN)) WR_SetPlotFlag(PLT_ATTACK_NALDIS_STRONGHOL, ASSEMBLE_MEN, 1, TRUE); } break; } }
Modifié par carmadaum, 22 avril 2010 - 01:44 .
#6
Posté 22 avril 2010 - 01:42
Modifié par carmadaum, 22 avril 2010 - 01:46 .
#7
Posté 22 avril 2010 - 02:14
Still since you are going down this road we might as well continue ...
The snippet you copied is incomplete. You need something more like this (I can't promise it is correct as I can't compile it without your plots):
#include "plot_h"
#include "utility_h"
#include "wrappers_h"
#include "plt_attack_naldis_stronghol"
#include "plt_get_dannal"
#include "plt_get_bran"
int StartingConditional()
{
event eParms = GetCurrentEvent();
int nType = GetEffectType(eParams);
int nFlag = GetEventInteger(eParms, 1);
if(nType == EVENT_TYPE_SET_PLOT)
{
switch(nFlag)
{
case BRAN_JOIN:
{
if(WR_GetPlotFlag(PLT_GET_DANNAL, DANNAL_JOIN))
{
WR_SetPlotFlag(PLT_ATTACK_NALDIS_STRONGHOL, ASSEMBLE_MEN, TRUE, TRUE);
}
break;
}
}
}
}
Modifié par Sunjammer, 22 avril 2010 - 02:15 .
#8
Posté 22 avril 2010 - 02:21
The whole part after #include section (the one which starts with "event..." should be part of a function with int as return value. in other words, should be more like:
#include "whatever"
int StartingConditional()
{
event eParms = GetCurrentEvent();
int nFlag = GetEventInteger(eParms, 1); // Plot flag
int nValue = GetEventInteger(eParms, 2); // 0=Clear 1=Set
int nResult = FALSE;
switch(nFlag)
// etc...
}
without it the compiler thinks you're just declaring variables, and treats the switch() call as such.
edit: blah, took too long to type
Modifié par tmp7704, 22 avril 2010 - 02:23 .
#9
Posté 22 avril 2010 - 07:30
#10
Posté 22 avril 2010 - 11:10
#11
Posté 22 avril 2010 - 12:14
If you were using a single quest that would be how you would do it. You would have somthing like:bowlie1 wrote...
why not make 2 flags?
- COMPANIONS_HIRED_A: journal entry saying "You convinced A to join but you still need to talk to B"
- COMPANIONS_HIRED_B: journal entry saying "You convinced B to join but you still need to
talk to A" - COMPANIONS_HIRED_BOTH: journal entry saying "You have successfully convinced A and B to join"
However if you are using a parent-child relationship then you create two plots: one for A and one for B. Each of those would have an "accepted" flag (TO_HIRE) and a "completed" flag (HIRED) and in the parent plot you would also have a "completed" flag (HIRED_BOTH). Whenever you set one of the child "completed" flags you check the other. If both are "completed" you set the parent "completed" flag.
This approach doesn't really offer any advantage where there are only two tasks however imagine trying to handle the permutations for 4 or 5 tasks in a single plot!
Modifié par Sunjammer, 22 avril 2010 - 12:16 .
#12
Posté 22 avril 2010 - 05:50
[NPC] (Check for Bran)
- [PC]
-- [NPC] (Check for Dannal) The stronghold awaits you!
-- [NPC] Go look for Dannal!
[NPC] (Check for Dannal) Go look for Bran!
[NPC] You cannot do this alone ...
Hopefully, this makes sense.
#13
Posté 23 avril 2010 - 04:21
#include "plot_h"
#include "utility_h"
#include "wrappers_h"
#include "plt_attack_naldis_stronghol"
#include "plt_get_dannal"
#include "plt_get_bran"
int StartingConditional()
{
event eParms = GetCurrentEvent();
int nType = GetEffectType(eParams);
int nFlag = GetEventInteger(eParms, 1);
if(nType == EVENT_TYPE_SET_PLOT)
{
switch(nFlag)
{
case BRAN_JOIN:
{
if(WR_GetPlotFlag(PLT_GET_DANNAL, DANNAL_JOIN))
{
WR_SetPlotFlag(PLT_ATTACK_NALDIS_STRONGHOL, ASSEMBLE_MEN, TRUE, TRUE);
}
break;
}
}
}
}
[/quote]I would have played with it a little more before posting but.. I still have a hangover from last night. I tap out for the day, haha
Modifié par carmadaum, 23 avril 2010 - 04:26 .
#14
Posté 23 avril 2010 - 07:47
carmadaum wrote...
Some times it takes a village i guess but I plugged in the script sunjammer provided and i get an error line (13): Variable defined without type (while compiling var_constants_h.nss).#include "plot_h" #include "utility_h" #include "wrappers_h" #include "plt_attack_naldis_stronghol" #include "plt_get_dannal" #include "plt_get_bran" int StartingConditional() { event eParms = GetCurrentEvent(); int nType = GetEffectType(ePar[b]a[/b]ms); int nFlag = GetEventInteger(eParms, 1); ...
Variable eParms is declared, but in GetEffectType(eParams) there is an extra "a" causing the compiling error.
Moreover, you can't get an effect type from an event, so you should use GetEventType(eParms) instead of GetEffectType(eParms)
And finally since the function declaration says that it returns an int, you should do it.
Modifié par _L_o_B_o_, 23 avril 2010 - 08:06 .
#15
Posté 23 avril 2010 - 08:16
#16
Posté 23 avril 2010 - 08:27
If you ever add defined conditions into the plot, you'll want to set up a return variable, something like:
#include "plot_h"
#include "utility_h"
#include "wrappers_h"
#include "plt_attack_naldis_stronghol"
#include "plt_get_dannal"
#include "plt_get_bran"
int StartingConditional()
{
event eParms = GetCurrentEvent();
int nType = GetEffectType(eParams);
int nFlag = GetEventInteger(eParms, 1);
int bResult = FALSE;
if(nType == EVENT_TYPE_SET_PLOT)
{
switch(nFlag)
{
case BRAN_JOIN:
{
if(WR_GetPlotFlag(PLT_GET_DANNAL, DANNAL_JOIN))
{
WR_SetPlotFlag(PLT_ATTACK_NALDIS_STRONGHOL, ASSEMBLE_MEN, TRUE, TRUE);
}
break;
}
}
}
if(nType == EVENT_TYPE_GET_PLOT)
{
switch (nFlag)
{
}
}
return bResult;
}
Modifié par DavidSims, 23 avril 2010 - 08:29 .
#17
Posté 23 avril 2010 - 09:55
Here is the end result :
#include "plot_h"#include "utility_h"#include "wrappers_h"
#include "plt_attack_naldis_stronghol"#include "plt_find_bran"#include "plt_find_dannal"
int StartingConditional(){event eParms = GetCurrentEvent();int nType = GetEventType(eParms);int nFlag = GetEventInteger(eParms, 1);
int bResult = FALSE;
if(nType == EVENT_TYPE_SET_PLOT){switch(nFlag){case FOUND_BRAN:{if(WR_GetPlotFlag(PLT_FIND_DANNAL, FOUND_DANNAL)){WR_SetPlotFlag(PLT_ATTACK_NALDIS_STRONGHOL, ASSEMBLE_MEN, TRUE, TRUE);}break;}}}
if(nType == EVENT_TYPE_GET_PLOT){switch (nFlag){
}}
return bResult;}
Modifié par carmadaum, 23 avril 2010 - 10:32 .





Retour en haut






