*Note- This tutorial *might* be useful to someone out there until ORK creates a method for linking variables and stats directly. Always check the updated features list.

There are various ways to do this in ORK, but this simple trick has proven for me to be the best, and most stable work around. At the beginning of your formula, create a 'Status Value' node and set it to what have you. Next, Create a 'Check Formula Value' node and have it see whether the current formula value equals zero. Connect the 'Failed' outcome to a 'Change Game Variables' node (I suggest making it a local variable, but it shouldn't matter).

Value Type- Value
Value- Your Variable Name (name it whatever you like. Do try at least to keep it PG.)

Remove- Nope, don't check this

Type- Float
Operator- Add

Value Type- Value
Value- 1

So, what you've done then is you've created a new variable inside your formula and assigned it a value of 1. Next, create a plain old 'Value' node and set its 'Operator' to 'Sub', its 'Value Type' to 'Value' and give it a value of 1. This node subtracts 1 from the formula value itself. The 'Change Game Variables' node does not effect the formula value because it's isolated to effect only the specific variable that you've assigned. Anyway, moving on, your final step here is simply to connect your 'Value' node to your 'Check Formula Value' node, creating a loop. Unless you've somehow ####ed something up in following this procedure, it shouldn't be an infinite loop.

*DISCLAIMER: Neither the author of this post, nor anyone connected to the ORK Framework, are accountable for your infinite loops or any other ####-ups, and may not be held liable in a court of law. You may, however, at your discretion, post a query to the forums looking for support, which in general I've notice seems pretty good.

Where was I? Ah, yes-If your still reading, you should probably stop because there isn't really anything more to say. All you've done really is to create a looping procedure that transfers the assigned status value from your formula to a variable, and now you can simply move on and do what needs doing. If you had a good time and are sad that the party's over, by all means then go ahead and repeat the process to create another variable. The world is your oyster. I just wanted to share a little trick that's helped to keep me on many an occasion from beating my head through the wall, because I don't really have the time these days for re-plastering work and I'm assuming that neither do you. And If you're still reading by this point then I really do suggest that you stop, because that's all there is to say (and more) about this little procedure. Have fun, but remember to keep it safe. Always look to be in compliance with standard OSHA programing safety protocols, and double-check to make certain that your helmet and safety goggles are firmly secured before typing on any keyboard surface, and wear your neon vest at all times.

*Final Note- character's wearing neon receive a -8 to their stealth checks initially, plus another -2 per every additional article of neon clothing. Character's decked out in a full neon jumpsuit, or body armor, receive a +10 to all of their rolls, including saves and damage, against Lycanthrope type combatants. None of the above mentioned penalties or bonuses apply if said articles of neon clothing are worn beneath any form of non-neon cover, although various mojo related benefits may be ascribed depending on house rules. Character's wearing a combination of helmet and safety goggles are immune to critical hits.
  • I'm not sure I understand what you're doing, can you give an example of an application of your solution?
  • Sure, I use this procedure many, many times as part of my game code. For instance, I have a sub formula called "Statcalc_Weight_Bone" that I use as part of my formula stack to calculate the weight of a combatant based off of various stats. It basically uses a stat that I've named 'Constitution' and plugs it into a series of procedures to generate a number that is then added to a combatant's total weight. It's a little convoluted, but it works. Let me explain the entire formula.

    First, I need to check what sort of combatant will be used: does it stand upright, is it hunched, or serpentine, etc. For this, I've set up a defense attribute called locomotion and assigned it several sub-attributes. To keep it simple, let's say the combatant is bipedal. That means it'll only use one other stat in addition to Constitution to determine what its bone structure will weigh, and that stat is 'Height'. Here is where I use my little trick: after determining my combatant's type, I want to set a variable equal to its Height stat, and set that aside for later. So I make a local variable called 'TimesRolled' using the described procedure. Times rolled is now equal to the combatant's height, whatever that may be.

    *Note- In order to keep a clean and tidy list of variables (because they're not readily traceable in ORK... yet) I reference as few of them in my formulas as I can get away with. TimesRolled is just my go-to variable for running any sort of decrementing variable loop.

    Once my variable has been set, the formula value is equal to zero. I could add or set it to any value that I like and possibly create another stat-based variable, but I don't need to for this formula, so I simply link into a 'Status Value' node and set it to equal the combatant's Constitution. Then, I make a status fork that checks another defense attribute called 'Size' for one of a series of possible sub-attributes (Tiny, Diminutive, Small, Standard, Large, Massive, Gigantic, Colossal) which multiplies accordingly by a set value. Then, before going into the loop where 'TimesRolled' will finally come into play, I need to check 'Locomotion' once again to ensure what sort of combatant is used, because even though they're all using the same variable (TimesRolled) the method for using it will vary slightly depending.

    Bipedal creatures are a straight shot, because Height is the only value that matters for them by this point in the formula. I go straight into a 'Check Game Variables' node that will succeed once 'TimesLooped' is equal to zero. On the fail end, I just subtract 1 from 'TimesLooped' using a 'Change Game Variables' node and I multiply the formula value by 1.05 (currently). If further testing shows that particular multiplicative value to be less than ideal as things span out, it's a simple figure to adjust, but I've found it seems to work in conjunction with the rest of my formula for testing both Human and Giant weights. Good enough, anyway. Regardless, I close the loop and finish with a 'Round' node set to ceiling, and I finish using my personal preference of always storing a formula's value when closing it out, using of course a 'Store Formula Value' node set to local.

    And that's one convoluted example of how I use variables that are set to status values. If the "*Final Note" part was confusing you, the -8, +10 etc. numbers signify a modifier that is added to, or subtracted from a randomly generated integer (usually generating within a range between 1 & 20) which is then compared against another number to determine the success or failure of any attempt within a game environment. It's basically the fundamental core system from which every roll playing game that has ever existed derives its own spin on how to accomplish whatnot within a virtual space, as first laid out by Gary Gygax and some buddies pissing around in his basement/game room/dungeon.

    The neon spiel was referencing a bizarre comedy that's been running on Adult Swim called, "Neon Joe, Werewolf Hunter." It's every bit as ridiculous as it sounds, but no more ridiculous than pairing up a box of french fries, a talking milkshake and a wad of ground beef and having them do random things, that don't really make any more sense than the characters themselves, for a roughly thirty minute span. And the helmet and safety goggles are just good advice. Either you agree with this wholeheartedly, or you're a terrible human being standing in the way of progress and something needs to be done to prevent backwards troglodytes like yourself from voicing any opinion, for the sake of supporting our inalienable human right of free speech and combating censorship.

    Because, sometimes, our collective view superimposed upon reality is stranger than even the most bizarre examples of fiction, hence we find escape in fantasy environments where meat and french fries team together to solve crimes, or... whatever the hell they do; where talking dogs and teenagers drive around getting high in the back of a van to eventually save the day by ripping people's faces off; where a comedian backed into a corner about a series pitch couldn't think of anything to feed the execs so he literally pulled the first most god-awful ridiculous idea that came to him out of the back of his bright neon sweatpants and tossed it at a wall, and it stuck, and now that's a thing running on cable which is currently heading into its third season. If that can be done, then I figure, surely, I can create a modular role playing video game system using ORK and define its rule-set so as to allow highly flexible play through a roughly infinite span of scenarios while ensuring that everything within those scenarios will have a set range of possible outcomes depending primarily upon 7 core numbers that will branch to define every character within a virtual space. But, in order to do this, it is necessary foremost that I be able to link those 7 core numbers to anything which might depend upon them for reference, and in certain cases it seems the only way to accomplish this in ORK is by using variables. That's my application for this particular little work around. Your own mileage may vary.
Sign In or Register to comment.