Using Variables

(Using Variables by Johnnyirish:)

Why would one want to use variables in openrpg, you ask? To avoid a massive headcase…
I'll explain: A problem I saw with making/using a character in openrpg is that if you change just one number in your calculations be it strength, attack bonus, spell casting stat.. etc.. it often times has a domino effect on ones other abilities. Changing ALL of these back and forth mid game by hand can be very cumbersome to say the least and maddening at most. In either case it slows down game play.

For example if you are a fighter type and your strength gets lowered or raised, well now you'd have to change all of your attacks, damage,grapple check and skills based on strength (and possibly other numbers). Where as if instead you only used a variable for strength in those calculations and then just simply changed the value of the strength variable.. well now you just updated all of your numbers in one fell swoop.

That got me into exploring using variables in open rpg. After some trial and error I have a basic hang of using them, as such I thought I'd pass on my learning to others here in hopes that it could help make others game play more enjoyable as well.

Ok now on to the main event:

1) First you have to enable variables in open rpg:
Within openrpg click "plugins" > "control panel" > highlight "Game Variable Manager"+ click on "enable" and "autostart".

Now variables should work in openrpg, you can click the x to remove the "plugin control panel" now.

Notice you should also see:
"/gvm [set name=value | calc name=value | get name | status | list | save set_name | open set_name] - This plugin is used to manage variables that you can use in your status bar or in dice rolls"

We will need to use this to interact with variables.

2) Now I will walk you through an example of how one would set a vairable:
Here is an example of setting ones strength mod as a variable (strength mod not strength score)*

/gvm set str=+5

That would set the variable $str to have a value of 5 (which would be the mod for a 20 strength score). Now that the variable has been set we can use it in the calculations on our sheet such as:

Setting attacks:
Attack with a sword with bab of 5! [$str+5+1d8]
Grapple an opponent [$str+5+1d20]

Skills:
Climb (with skill rank of 2) [$str+2+1d20]

Now lets say that your character got a bulls strength cast on him. Since we're using variables instead of editing everything by hand all you have to do is the following to update your str mod (strength mod was 5, adding bulls strength makes it now 7):

/gvm set str=7

Yep, that's it.. now when doing those attacks above they will use 7 instead of 5 for their modifier.
Nice work!

3) Making it even easier:
Typing in the following "/gvm set (variable)=(value)" every time I want to change something is still too much work.. so I found how to make it easier for both you and I.

How we do this is by configuring a node in our sheet for setting a specific variable.
Right click on a text box node select "clone"
Now that we have a cloned text node we can edit the clone for our purposes. Rclick the cloned node and select "design". From here click both "send as macro" and "send button".

You also may want to change its name (title field). Here's a screen shot for a point of reference:
variables1.PNG

Now when you open your sheet you'll see:
variables2.PNG

When you want to change the value of your strength mod, just add/change the number after the equals sign in the formula and hit "send". You hit like 2 buttons and updated your whole sheet. Nice work!

In closing:
This is just an example of one variable. You can use many of them if you wanted for whatever you want/need to keep track of. You can keep them simple or make it complex as you like. I'll attach a file below, its my character sheet of "BOB" where I use variables heavily. While it may look pretty complicated and you don't need to make it as such, it'll give you an idea of what you CAN do with them.

Bob's Sheet

PS: If you have any other questions post them here and I'll try to help ya on your way to variable nirvana. ;)

*=while it is possible to set a variable within a variable such as X=Y+1 (or X=(Y-10)/2 in the case of calculating str mod from strength score) however I have seen that the variables don't actually link to other variables, rather they just take on the present value set at time of execution. This means that if one sets X=Y(with value of 10)+1 and then later changes the value of Y, the value of X will not change/update with the changing of Y.

Now maybe their is a way to get around this but I don't want to make it too complicated for myself and surely not for you so I will not be putting variables within other variables and I suggest you do the same.. at least until you're more advanced at this/more advanced then I. :)

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License