Modern Algebra's Quest Journal | #3 | Rewards?

Hi! I have been having trouble changing the rewards of my quests. I get an error screen when I try to change them. I simply want to remove the item in the rewards, and just give 20 G. (or in my case R)

SCRIPT: http://rmrk.net/index.php?topic=25533.0

I've moved this thread to Script Support. Thank you.

Moved to: Script Support

Gotcha, thanks!
You do this in the editable region of the script, which starts at around line 779.

At the end of each quest, you have the reward section which looks something like this (taken from my own project)
Code:
q[:rewards]           = [
        [:gold, 300],
        [:item, 181, 1],
       ]

In your case it would read:
Code:
q[:rewards]           = [
        [:gold, 20],
       ]

It still reads "gold", but it will pick up whatever currency you are using.

If this doesn't work, post a screenshot of your quest in the script, and we can look to see if we can identify the error.
Alright, i'll test it, but while people are here...

How do I mark a quest (not objective) as complete? Do I give the rewards to do that?
This script is quite complex, but if you go about it methodically you should be okay. I will give an example from my project and work through it with the various script calls so that you can see how to go about it.

Code:
when 9
       q[:name]              = " Q #8 The Defrauded Armorer"
       q[:icon_index]        = 0
       q[:level]             = 0
       q[:description]       = "The armorer wants his life's savings back."
       q[:objectives][0]     = "Confront the cheater at Fallmont Manor."
       q[:objectives][1]     = "Find the money."
       q[:objectives][2]     = "Return the money to the armorer."       
       q[:prime_objectives]  = [0,1,2]
       q[:client]            = "The Armorer"
       q[:location]          = "Dorgate"
       q[:rewards]           = [
        [:gold, 300],
        [:item, 181, 1],
       ]

You will see that I have 3 objectives for this quest. To start it off, the script call is
reveal_objective(9, 0)
The "9" comes from the line "when 9", and the "0" from the first objective. You must start at zero, not one.

When that objective is achieved, you want to mark it as completed and show the next stage, so the script call is:
complete_objective(9, 0)
reveal_objective(9, 1)

Then you will have
complete_objective(9, 1)
reveal_objective(9, 2)

When that last one is achieved, the script call is
complete_objective(9, 2)

The script now knows that the quest is fully complete, because I told it that the prime objectives are 0, 1 and 2. It will automatically change the quest from pending to complete.

You then have a choice - either award the rewards automatically or with a script call. I prefer to use a script call. So that final script call becomes
complete_objective(9, 2)
distribute_quest_rewards(9)
This script is quite complex, but if you go about it methodically you should be okay. I will give an example from my project and work through it with the various script calls so that you can see how to go about it.

Code:
when 9
       q[:name]              = " Q #8 The Defrauded Armorer"
       q[:icon_index]        = 0
       q[:level]             = 0
       q[:description]       = "The armorer wants his life's savings back."
       q[:objectives][0]     = "Confront the cheater at Fallmont Manor."
       q[:objectives][1]     = "Find the money."
       q[:objectives][2]     = "Return the money to the armorer."      
       q[:prime_objectives]  = [0,1,2]
       q[:client]            = "The Armorer"
       q[:location]          = "Dorgate"
       q[:rewards]           = [
        [:gold, 300],
        [:item, 181, 1],
       ]

You will see that I have 3 objectives for this quest. To start it off, the script call is
reveal_objective(9, 0)
The "9" comes from the line "when 9", and the "0" from the first objective. You must start at zero, not one.

When that objective is achieved, you want to mark it as completed and show the next stage, so the script call is:
complete_objective(9, 0)
reveal_objective(9, 1)

Then you will have
complete_objective(9, 1)
reveal_objective(9, 2)

When that last one is achieved, the script call is
complete_objective(9, 2)

The script now knows that the quest is fully complete, because I told it that the prime objectives are 0, 1 and 2. It will automatically change the quest from pending to complete.

You then have a choice - either award the rewards automatically or with a script call. I prefer to use a script call. So that final script call becomes
complete_objective(9, 2)
distribute_quest_rewards(9)


Ok, do I get rid of the extra objectives?
You put in the number of objectives that you have. If there is only one, then just have one objective listed in the script, and delete the other lines. Remember to change the numbers in the "prime_objectives" line.

And btw, there's no need to quote a whole post to indicate who you are replying to. It makes loading the page a lot slower, and can be a nightmare for anyone accessing this on their phone. Instead use the @ symbol plus the person's username, like this @Draganora As you type it, a drop down list appears, select the one you want and it tags it and notifies the person that you have replied, if they have enabled that in their notification preferences.
@Kes

What number do I put in? Any number?

(Sorry for so many questions, i'm new :c)
Do a screenshot of what you have so far and I'll tell you. At the moment I'm not totally clear what you mean.
Kes explained it quite well, you are just not understanding the link with the numbers and the quest objectives.

Look at this quest as shown by Kes...

Code:
when 9
       q[:name]              = " Q #8 The Defrauded Armorer"
       q[:icon_index]        = 0
       q[:level]             = 0
       q[:description]       = "The armorer wants his life's savings back."
       q[:objectives][0]     = "Confront the cheater at Fallmont Manor."
       q[:objectives][1]     = "Find the money."
       q[:objectives][2]     = "Return the money to the armorer."    
       q[:prime_objectives]  = [0,1,2]
       q[:client]            = "The Armorer"
       q[:location]          = "Dorgate"
       q[:rewards]           = [
        [:gold, 300],
        [:item, 181, 1],
       ]
when 9
q[objectives][0]


The bolded text is the first objective, and you would use...
reveal_objective(9, 0)

That is quest 9, objective 0.

When that objective is achieved, you want to mark it as completed and show the next stage, so the script call is:
complete_objective(9, 0)

You can then show the next objective...
reveal_objective(9, 1)

- or you could have started with reveal_objective(9, 0, 1, 2); this will show all the objectives for quest 9.

When that last one is achieved, the script call is
complete_objective(9, 2)

SO, if you have only 1 objective then you only reveal 1 objective (0), if you have 8 objectives then you would have to (to complete it) reveal 8 objectives (0, 1, 2, 3, 4, 5, 6, 7). Hense you would only complete as many objectives and you made in your quest.

So you could have
Code:
q[:objectives][0] = "blah blah"

or
Code:
q[:objectives][0] = "blah blah"
q[:objectives][1] = "blah blah"
q[:objectives][2] = "blah blah"
q[:objectives][3] = "blah blah"
q[:objectives][4] = "blah blah"
q[:objectives][5] = "blah blah"
q[:objectives][6] = "blah blah"

Original thread: https://forums.rpgmakerweb.com/threads/modern-algebras-quest-journal-3-rewards.83446/