IntroductionOk, in this tutorial i'm going to show you how to make an RPG with variables. It won't be that hard. That was a short intro :3
Getting StartedTo make a variable RPG your going to need to have the variable add-on. The current version is 4. You can download it here:
http://forum.blockland.us/index.php?topic=43084.0Now if once you downloaded it, we can move on.
Making your RPG-MiningMining is probaly the easiest to do, so that's why i'm starting with it. Usually I start making copper ore first, so i'm going to explain how to do that. look at the code here:
onActivate---self---fakekillbrick---[ ][ ][ ] [15]
onActivate---client---bottomprint---[You mine some copper! +1 mining XP]
onActivate---player---addVariable---[copper] [1]
onActivate---player---addVariable---[Mining XP] [1]
onActivate---client---displayvariable---[player] [chatbox] [copper]
onActivate---client---displayvariable---[player] [chatbox] [Mining XP]
There is you simple copper ore. Now when you click the brick the brick will dissapear for 15 seconds and give you 1 copper and 1 Mining XP. You can edit that to give more XP or copper if you want.
To make somthing that you need more Mining XP to mine then for the first line of wrench events you use:
onActivate---self---ifVariable---[player] [Mining XP] [GreaterEquals] [how much XP they need to have to mine the ore]
also for the rest of the wrench events the input event should be ifvariabletrue instead of onActivate. also you may want it to say somthing if they don't have enough XP, for that just say:
ifvariablefalse---client---bottomprint---[what you want it to say]
That's it for mining.
-LoggingFirst examine this code:
onActivate---self---fakekillbrick---[ ][ ][ ] [15]
onActivate---client---bottomprint---[You cut some logs! +1 logging XP]
onActivate---player---addVariable---[logs] [1]
onActivate---player---addVariable---[Logging XP] [1]
onActivate---client---displayvariable---[player] [chatbox] [logs]
onActivate---client---displayvariable---[player] [chatbox] [Logging XP]
Ok, that is kind of like the copper ore code but with wood. If you want to make higher levels of wood to cut then just do what we did with the copper ore.
OthersIf you have a requests please tell me.