Page 1 of 1

RPG Recipe -and- Quest Rewards

Posted: November 19th, 2011, 8:47 am
by Tony
In the RPG Tutorial on our Wiki, the player already knows the needed recipes.
Thus:

r_recipe_flags $RECIPE_KNOWN

How do we make them learn new ones, in-game... as say a quest reward?

There must be a way to make it into a variable as you do quests, yes?

And also, this is where the player turns in the McGuffin to ol' Bob:
[ r_response "[Give him the mcGuffin]" 5 [
r_remove player 7 1
r_givexp player 900
r_global_set $bobmcguffin 2
]

What would it take to get a little something out of Bob for our trouble?
Something like:
r_add player 8 1

8 is an item, 1 is the amount.
Or is it... r_item_additem ...or r_recipe_addrecipe ?

I cannot find a list of all the available flags for some of this stuff. Where can I find such a thing?
And also... Is there no description option for Recipes, as there is for Items? Or can I write that into the recipe definition?

And how about some gold? Can Bob give the player Gold too?

I'm having some good times learning this stuff, and getting handy with the map-making as well. Good stuff.

Thanks in advance for any tips or help, thanks,
- Tony

Re: RPG Recipe -and- Quest Rewards

Posted: November 19th, 2011, 10:57 am
by Hirato
Tony wrote:In the RPG Tutorial on our Wiki, the player already knows the needed recipes.
Thus:

r_recipe_flags $RECIPE_KNOWN

How do we make them learn new ones, in-game... as say a quest reward?
I was kind of lazy when I wrote the tutorial.
There's two ways to go about it, respectively they are (note, they are equivalent).
Have a look through src/rpggame/rpgscript, you'll find most of the commands and variables there

easy

Code: Select all

r_learn_recipe $ind
not quite so easy (note the bitwise operator)

Code: Select all

r_select_recipe $ind [
    r_recipe_flags (| (r_recipe_flags_get) $RECIPE_KNOWN)
]
What would it take to get a little something out of Bob for our trouble?
Something like:
r_add player 8 1

8 is an item, 1 is the amount.
Or is it... r_item_additem ...or r_recipe_addrecipe ?

And how about some gold? Can Bob give the player Gold too?
If the item is defined, you can spawn it in the player's inventory (this goes for currency as well).
You should've already done this for the reeds somewhere around part 3 using r_additem
The item modulation commands for things with an inventory should all be using "reference, type, amount" as their arguments

You're allowed a pretty large range of cubescript stuff when you hand in the mcGuffin, I can't think of any commands that might be problematic (short of deleting Bob right there)
I cannot find a list of all the available flags for some of this stuff. Where can I find such a thing?
There are two possible sources for the flags.
The first is src/rpggame/rpggame.h, and this contains the most up to date listings of all the constants as well as many more.
The second list can be found in data/rpg/game.cfg. This one defines global RPG cubescript constants you should be using in your definitions. These tend to correspond with those in rpggame.h and with that said, these may occasionally be out of date.
And also... Is there no description option for Recipes, as there is for Items? Or can I write that into the recipe definition?
[/quote]
There isn't, but it should be trivial to add. I do not intend to though.
When we get UI up and running, I fully intend to add fully scrollable lists to the GUI that list the products, the ingredients and the catalysts.
The commands to do that exist already (see rpgconfig.cpp), but doing scrolling lists in 3dgui (the current GUI) is just an absolute pain.


If you're feeling up to it, have a look through rpgconfig.cpp and rpgscript.cpp, those two files will list the vast majority of the commands you can call through the RPG as well as all the properties you can set on the various definitions. Most of them should be self explanatory, even if you can't read C++ :)

Re: RPG Recipe -and- Quest Rewards

Posted: November 19th, 2011, 11:02 am
by Tony
Fantastic man!

As usual, you've been kind, and spot-on informative.

Thank you much.

This will give me some things to study and work with for a while, rock on.

- Tony

P.S. -
Most of them should be self explanatory, even if you can't read C++
Reading C++ is not so hard a task. Like any language, English included, reading it is not so difficult to get the gist, while writing it effectively and eloquently is the true challenge. And that, Sir, I leave up to you, at least for now. I'll stick to writing tutorials from a user viewpoint and hacking up the cubescript :shock: