Hi guys.
I am completely useless at scripting, and don't even pretend to understand it.
(Code may as well be written in Klingon where I'm concerned)
Lilac Soul has been my saviour for many years...
One thing I need that i can't seem to find in the ga_ script set, is a script that will, (via a series of conversations) increment a journal quest.
Basically, a simple town quest for one of the churches requires the player to offer alms to 5 beggars round town.
Each is driven by a convo with the beggar, ( who is armed with a local integer to prevent being helped multiple times by cheeky players, trying to fast track).
Since there are 120 possible combinations for the order in which they might be met, what i need is a script that i can put on the individual convo thread that drives the quest (it only appears while the quest is active), that increases the number on the journal entry by 10, rather than setting it at 10, 20, 30, etc...
The quest tag is sq_calan_01, if anyone is going to be kind enough to bash a script together.
It doesnt need to check for variables or current quest status as the convo does that already...
I *could* try cobbling one together till i find one that works, but honestly, if someone shows me a working version, and I comapre that to the existing journal (ga_) progression script I will stand a better chance of understanding it, so that i can learn how to use it again in future.
Hope all that makes sense... and would greatly appreciate any help.
Simple script advice (or actual script) needed for a Journal increment.
Débuté par
Jackson Flynn
, févr. 20 2014 12:49
#1
Posté 20 février 2014 - 12:49
#2
Posté 20 février 2014 - 02:17
'ga_journal_plus'
// updates a journal
// param sQuest: the tag of the journal quest to update.
// param iUpdate: the amount to increment the quest's state.
void main(string sQuest, int iUpdate)
{
object oPC = GetPCSpeaker();
int iState = GetJournalEntry(sQuest, oPC);
AddJournalQuestEntry(sQuest, iState + iUpdate, oPC);
}/ad hoc!
#3
Posté 20 février 2014 - 04:05
I was exactly like you Jackson. When I first started I didn't even know the difference between a string and an integer. Yesterday I had a similar problem as yours, and Tchos provided me the script. Still, I would never be able to write it on my own, but I read it through and understood what he did. I guess I was interested in learning when I started, and not just build. What I want to say, is that if you sit down and have some will, and read some scripts that are well commented it will come to you, and make your building easier
.
#4
Posté 20 février 2014 - 04:37
Nothing wrong with LilacSoul's script generator. I used it early on, and I learned a lot from it.
To add on a little to kevL's script, this will default to adding 10 if you leave that field blank, though if you want to make it add a different number, you can.
To add on a little to kevL's script, this will default to adding 10 if you leave that field blank, though if you want to make it add a different number, you can.
'ga_journal_plus'
// updates a journal
// param sQuest: the tag of the journal quest to update.
// param iUpdate: the amount to increment the quest's state.
void main(string sQuest, int iUpdate=10)
{
object oPC = GetPCSpeaker();
int iState = GetJournalEntry(sQuest, oPC);
AddJournalQuestEntry(sQuest, iState + iUpdate, oPC);
}
#5
Posté 20 février 2014 - 08:47
That's great guys.
Thank you all so very much.
Andy, yeah I want to learn it, and I think my problem is that with all the powerful global scripts available I'm kind of reluctant to use valuable modding time going over the basics.
What the two scripts above will help me with is the facility to look at them compared to the standard "Set Journal Number" type script I have already used, and then I can hopefully start to twig where the differences lie, and take tiny steps from there. I really ought to pay more attention to the stuff I make with Lilac Souls app, (which to be honest, seems to me works through some sort of black magic...).
I come to the toolset as an AD&D/LARP Dungeon Master of 35 years standing with no coding background at all, so I have hundreds of ideas, and modules, campaigns and so on that I can visualise, but struggle with some of the nuts and bolts when the globals don't exist to tackle some of the nuances of what I want to do.
But thanks to the good people here, who seem very happy to share their knowledge, I hope to get there eventually!
Thank you all so very much.
Andy, yeah I want to learn it, and I think my problem is that with all the powerful global scripts available I'm kind of reluctant to use valuable modding time going over the basics.
What the two scripts above will help me with is the facility to look at them compared to the standard "Set Journal Number" type script I have already used, and then I can hopefully start to twig where the differences lie, and take tiny steps from there. I really ought to pay more attention to the stuff I make with Lilac Souls app, (which to be honest, seems to me works through some sort of black magic...).
I come to the toolset as an AD&D/LARP Dungeon Master of 35 years standing with no coding background at all, so I have hundreds of ideas, and modules, campaigns and so on that I can visualise, but struggle with some of the nuts and bolts when the globals don't exist to tackle some of the nuances of what I want to do.
But thanks to the good people here, who seem very happy to share their knowledge, I hope to get there eventually!
#6
Posté 20 février 2014 - 09:16
I'm not sure why a custom script is needed in this case. The conversations can check the quest status and update it accordingly. There are only 6 possibilities to check for in the conversation.
If quest status is 50 then beggar says "I don't need your stinking alms"
else if 40 beggar says "Bless you." and set journal to 50.
else if 30 beggar says "Is that all you got?" and set journal to 40.
else if 20 beggar says "Not alms, you idiot. I said Ale!" and set journal to 30.
else if 10 beggar says "Wow! I'll try not to spend it all in one place." and set journal to 20.
else beggar says "mumble…mumble…mumble..."
exit conversation
Regards
If quest status is 50 then beggar says "I don't need your stinking alms"
else if 40 beggar says "Bless you." and set journal to 50.
else if 30 beggar says "Is that all you got?" and set journal to 40.
else if 20 beggar says "Not alms, you idiot. I said Ale!" and set journal to 30.
else if 10 beggar says "Wow! I'll try not to spend it all in one place." and set journal to 20.
else beggar says "mumble…mumble…mumble..."
exit conversation
Regards
#7
Posté 21 février 2014 - 11:20
Sorry, I probably wasn't being clear...
There are 5 beggars located round town.
Each one helped increments the journal by a factor of 10.
So the journal basically updates to say; "you have helped X beggars" on each subsequent occasion.
There is no specific linear order governing which beggar is helped in which order.
The order you do it is based on the order you find them, so there are 5x4x3x2(x1) or 120 possible combinations for the order in which the beggars can be helped. (So putting in all the possible fall through conditionals on the actual scripts would be horrendous.
The quest begins at 10, each beggar helped adds 10, and when it hits 60, the quest giver is approachable for the reward.
There are 5 beggars located round town.
Each one helped increments the journal by a factor of 10.
So the journal basically updates to say; "you have helped X beggars" on each subsequent occasion.
There is no specific linear order governing which beggar is helped in which order.
The order you do it is based on the order you find them, so there are 5x4x3x2(x1) or 120 possible combinations for the order in which the beggars can be helped. (So putting in all the possible fall through conditionals on the actual scripts would be horrendous.
The quest begins at 10, each beggar helped adds 10, and when it hits 60, the quest giver is approachable for the reward.
#8
Posté 21 février 2014 - 12:55
You just need to set a variable on each beggar once they've been helped, and then check the variable to prevent them from being helped twice. You can do that all in the conversation with ga_local_int and gc_local_int.
#9
Posté 21 février 2014 - 04:38
Actually, Kaldor's solution looks like the simplest solution. You can use the same conversation for all of the beggars, have only 6 journal updates, 6 conditional conversation nodes (not 120), and just use the local ints like Lugaid says to prevent double-dipping beggars. It won't matter what order you help them in. What the beggar says and does depends on a quest stage check in each of the conversation nodes. Each one can be helped just once, and they'll advance the quest to the next stage.
Modifié par Tchos, 21 février 2014 - 04:40 .
#10
Posté 21 février 2014 - 08:21
I left off one beggar. The beggar conversation including the local int check would be.:
if beggar already accepted alms (local int = 1) then says "No more for me, thanks."
else if quest status is 60 then beggar says "mumble…mumble…mumble"
else if 50 then beggar says "Bless you." and set journal to 60 and local int to 1.
else if 40 beggar says "That and a gold piece will buy a cup of coffee." and set journal to 50 and local int to 1.
else if 30 beggar says "Is that all you got?" and set journal to 40 and local int to 1.
else if 20 beggar says "Not alms, you idiot. I said Ale!" and set journal to 30 and local int to 1.
else if 10 beggar says "Wow! I'll try not to spend it all in one place." and set journal to 20 and local int to 1.
else beggar says "mumble…mumble…mumble..."
exit conversation
Regards
if beggar already accepted alms (local int = 1) then says "No more for me, thanks."
else if quest status is 60 then beggar says "mumble…mumble…mumble"
else if 50 then beggar says "Bless you." and set journal to 60 and local int to 1.
else if 40 beggar says "That and a gold piece will buy a cup of coffee." and set journal to 50 and local int to 1.
else if 30 beggar says "Is that all you got?" and set journal to 40 and local int to 1.
else if 20 beggar says "Not alms, you idiot. I said Ale!" and set journal to 30 and local int to 1.
else if 10 beggar says "Wow! I'll try not to spend it all in one place." and set journal to 20 and local int to 1.
else beggar says "mumble…mumble…mumble..."
exit conversation
Regards
#11
Posté 22 février 2014 - 09:29
That actually seems to be more work than simply using the script Tchos wrote...
I have one additional branch per beggar convo to accommodate the quest, with 3 simple conditionals. This was C&P'd and tailored with a modicum of dialogue editing and tag changing.
The convo's have the same framework, but differ slightly in dialogue.
Each beggar has a constant convo asking for cash, and on one hidden thread of the discussion...
IF quest > 0
AND quest < 60,
AND a local integer on the beggar is at 1,
then the option appears to offer extra alms. (The quest requires you to be a bit more generous than normal).
If you do so, the quest updates by +10, (tells you you have helped one more beggar than you previously had,) the integer on the beggar moves to 2 and the option disappears from the beggars convo, (though they will still try and hit you up if you talk to them).
It works like a charm.
Plus, I can see a lot more future use for a simple ga script that allows incremental journal use. It will allow broader less linear quests to be knocked together a bit quicker and easier.
I have one additional branch per beggar convo to accommodate the quest, with 3 simple conditionals. This was C&P'd and tailored with a modicum of dialogue editing and tag changing.
The convo's have the same framework, but differ slightly in dialogue.
Each beggar has a constant convo asking for cash, and on one hidden thread of the discussion...
IF quest > 0
AND quest < 60,
AND a local integer on the beggar is at 1,
then the option appears to offer extra alms. (The quest requires you to be a bit more generous than normal).
If you do so, the quest updates by +10, (tells you you have helped one more beggar than you previously had,) the integer on the beggar moves to 2 and the option disappears from the beggars convo, (though they will still try and hit you up if you talk to them).
It works like a charm.
Plus, I can see a lot more future use for a simple ga script that allows incremental journal use. It will allow broader less linear quests to be knocked together a bit quicker and easier.
Modifié par Jackson Flynn, 22 février 2014 - 09:34 .
#12
Posté 22 février 2014 - 08:51
It was kevL's script...I just added a default of 10 to it.





Retour en haut






