Aller au contenu

Photo

gc_journal_entry conditional - any shortcuts when using multiple entries?


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

#1
Friar

Friar
  • Members
  • 293 messages

As the title suggests, I am wondering if I need to add the gc_journal_entry script several times on a conversation condition or is there an easier way.

 

I have about ten total on one line and then I'm going to have ten more on another and possibly more on another... anyway are a lot of conditionals I need to cover.

 

I Luv me sum conditionals in my conversations!

 

I'm wondering if there is some way I can add multiple sCheck (String) values in that empty box.

I thought doing I'd write it like this:

gc_journal          |Refresh|             sQuestTag (String           job_laborer1       sCheck (String)       1; 11; 21; 31; 41; 51; 61; 71; 81; 91; ...

 

It would be easier than add a hundred boxes because I have to do things so stoopid.



#2
Tchos

Tchos
  • Members
  • 5 072 messages

Well, I like the idea of writing an alternate script that allows you to place multiple journal entry states in one field and select either "and" or "or".  That would be pretty straightforward to do. 

 

The existing script allows you to use < or > with the number, though, so if you arrange your journal entries well, you can check for an arbitrary range of states with 1 or 2 instances of the script.


  • ColorsFade aime ceci

#3
Lugaid of the Red Stripes

Lugaid of the Red Stripes
  • Members
  • 955 messages

If your quest structure is that complicated, something is bound to get messed up along the way.  Is there a simpler way to do it?  For example, instead of checking umpteen different quest states, just make a new quest that gets triggered along the way.  Then just check for that one quest.  Or throw in a plot item, or even just set a local variable somewhere.

 

It sounds like you may be trying to write a repeating quest.  You could just use the 'override higher' flag on ga_journal to reset the quest to a lower state on completion.  Alternatively, you could write a custom gc_journal script that uses the mod function to just get the last digit of the quest state.



#4
kevL

kevL
  • Members
  • 4 070 messages
sounds like this is the Warehouse Goods quest.
 

It sounds like you may be trying to write a repeating quest.  You could just use the 'override higher' flag on ga_journal to reset the quest to a lower state on completion.

this'd be the way to do it. ( and laborer1 + laborer2 could even be combined by using tokens I imagine ) But i don't suggest working backwards, friar, if it is close to working as is.

imo, either leave the scripts chained, or write 2 new ones: 1. StartingConditional() to check states, 2. main() to update the states


-o-

#5
Loki_999

Loki_999
  • Members
  • 430 messages

If its getting that complicated just use local vars like Lugaid suggests.  Then you handle everything script side.



#6
Friar

Friar
  • Members
  • 293 messages

Yes this is the warehouse goods quest. The only reason I started a new topic was because I wanted to track what could be done with the journal scripts in the toolkit.

 

I tried searching for a similar topic, but I'm probably the only weirdo who tries to write things the way I do.

 

This quest entertains me because it has indeed grown to be very complex, but the nice thing about it is I am learning a lot. Main reason being I have a lot to learn, but also you all have been guiding me the best anyone could; despite being as far away and using a forum to teach.

 

It is a real compliment to you guys level of knowledge.

 

----

Okay so the journal and quests.

 

It is a repeatable quest, but not until after the 5th time it is done.

As the character completes these quests there are conversations in which the foreman cusses you out, insults you and all the crap you might expect. Each time you go and talk to this jerk there are opportunities to use the intimidation skill. If you fail at intimidating him you might find a way either by leveling up or wearing intimidating attire or spells or whatever it takes to get better. Because If your intimidation skill isn't able to intimidate the foreman by the 4th round then you'll never unlock a new opportunity. The 5th round will be repeatable.

 

The reason I planned this idea is because once the character can successfully roleplay an intimidating character in the AD&D world of Al Qadim the thugs at the warehouse (which incidentally is a secret thieves guild) say "Hey this guy is pretty good, he'd be better put to use as a collector for our protection racket."



#7
Lugaid of the Red Stripes

Lugaid of the Red Stripes
  • Members
  • 955 messages

Simple cut&paste in the convo editor works well, too.  You have 6 basic rounds of interaction with the foreman, as far as I can tell.  The initial first round, then rounds 2-5 which basically repeat each other, and then the 6th round that repeats indefinitely.  So you write out the conversation for the first round, with all your variables and scripts added in, and then you just copy and paste.  Modify the second copy with the new variables and some fresh insults, and then repeat a few more times until you get to the final round, which you modify to use the override higher function.



#8
Friar

Friar
  • Members
  • 293 messages

Thanks Lugaid,

 

I did the copy paste already but wasn't sure how I was going to make it repeatable until you told me about the override. I saw the override but wasn't sure what it was for.



#9
Tchos

Tchos
  • Members
  • 5 072 messages

I went ahead and made this script where you can check for multiple quest states in one script.  I tested it to be sure it worked, with a 5-stage quest.

////////////////////////////////////////////////////////////////////
//	
//	gc_quest_stage_multiple
//	by Tchos
//	2014-07-03
//	
//	Checks for multiple quest stages in 1 script, to aid with AND/OR 
//	conversational conditions.
//	
//	Place multiple quest stages for a single tag separated by commas.
//	No spaces.  This returns TRUE if *any* of the listed stages match 
//	the current one.
//	
//	Unlike the standard journal scripts, this checks the FirstPC
//	for the quest stage, so you don't have to mark everyone in the
//	party.  This also means it may not be suitable for multiplayer.
//	
////////////////////////////////////////////////////////////////////

#include "ginc_var_ops"
#include "ginc_param_const"

// Will return FALSE if no quest.
int StartingConditional(string sQuestTag, string sCheckStages)
{
	object oPC = GetFirstPC();
    int iQuestEntry = GetJournalEntry(sQuestTag, oPC);
	
	// Loop through the input, looking for commas
	string sParam = GetStringParam(sCheckStages, 0);
	int i = 0;	
	while(sParam != "")
	{
		int iMatch = CompareInts(iQuestEntry, sParam);
		if (iMatch) { return TRUE; }
		i++;
		sParam = GetStringParam(sCheckStages, i);
	}
	
 	return FALSE;
}


#10
Friar

Friar
  • Members
  • 293 messages

Well done!