View unanswered posts | View active topics It is currently Thu Mar 28, 2024 10:48 am



Post new topic Reply to topic  [ 11 posts ]  Go to page 1, 2  Next
 OpenRPG & SR4 Dice Rolling with Variables 
Author Message

Joined: Thu Aug 19, 2010 8:32 pm
Posts: 4
Post OpenRPG & SR4 Dice Rolling with Variables
OpenRPG & SR4 Dice Rolling with Variables

My problem with OpenRPG and SR4 lies with OpenRPG unable to handle variables (refereced and prompt) before the "d6" (or "dX").

I am planning my first Shadowrun 4th ed. (SR4) campaign on OpenRPG. To make life easier on players, I created an extensive Character Sheet Node/XML. In this character sheet, there are a series of send commands that will calculate number of dice to roll (based on attributes, skills, modifiers, etc.) and then roll (Xd6).

Problem is getting the send command to work with a "prompt for input" before "d6". Is there a way to make "[?d6]" work in OpenRPG? See below for two examples:

Send 1:
[?d6]
Variable 1:
? = 3
Output 1:
36
(why did it remove "d"?)

Send 2:
[[?]d6]
Variable 2:
? = 3
Output 2:
[3d6]
(executes only inner square brackets)


Another related is problem mixing referenced and prompt variables in the send command. See following example.

Send 3:
[!@Intuition@!+!@Reaction@!d6.init(!@Intuition@!+!@Reaction@!)]
Variable 3:
Intuition = 4
Reaction = 3
Output 3:
4+3d6.init(4+3) => [4, 3, 2, 5] 1 hit, init = 7 + 1 => 8
[executes a 3d6.init(7) and ignores "4+")


Problem lies with OpenRPG using variables before "d6". Has anyone been able to solve this?

Your input and advice is greatly appreciated.

Game on fellow RPG'rs. Game on.


Thu Aug 19, 2010 10:33 pm
Profile
User avatar

Joined: Wed Dec 09, 2009 9:39 pm
Posts: 712
Post Re: OpenRPG & SR4 Dice Rolling with Variables
You have to put a stop bracket after the ?, [?}d6] The stop bracket is there so you can label and create reminders.

As for the addition part, that is a failure in Standard. Traipse is making changes in how the die roller works. In current Beta the roll [1d6+1d8] will fail, but that is only because I have not released the most up to date utils.py. The one I have on my desk allows [(2+4)+4d(6+8)+(4*4)] to roll and it equals 6 + 4d30. Traipse will also allow [(2+4)+4d5+(6+8)+(4*4)] to roll which equals 6+4d5+14+16.

_________________
I ate your Death Knell.
The Traipse Movement
Please show your support for Traipse OpenRPG http://www.facebook.com/MadMathLabs
Send me Traipse OpenRPG Ideas, Bugs, Complaints, Praises here: https://getsatisfaction.com/mml


Fri Aug 20, 2010 1:30 am
Profile YIM WWW

Joined: Thu Aug 19, 2010 8:32 pm
Posts: 4
Post Re: OpenRPG & SR4 Dice Rolling with Variables
That is great news, prof.ebral. Is there a way I can get that utils.py file?


Fri Aug 20, 2010 2:16 am
Profile
User avatar

Joined: Wed Dec 09, 2009 9:39 pm
Posts: 712
Post Re: OpenRPG & SR4 Dice Rolling with Variables
Yeah, but if you are not using the latest Traipse beta it will break your dieroller.

_________________
I ate your Death Knell.
The Traipse Movement
Please show your support for Traipse OpenRPG http://www.facebook.com/MadMathLabs
Send me Traipse OpenRPG Ideas, Bugs, Complaints, Praises here: https://getsatisfaction.com/mml


Fri Aug 20, 2010 2:29 am
Profile YIM WWW

Joined: Thu Dec 10, 2009 6:37 am
Posts: 335
Post Re: OpenRPG & SR4 Dice Rolling with Variables
There's an improved (or different) user input prompt in OpenRPG 1.8.1 ... might be in 1.8.0...
It's a slash command as in this example:

Code:
/input X Enter amount of damage Kaf is healed
/d "Kaf is cured of X damage."
/addtonode X HP


The variable name (which doesn't have to be "X") following /input is simply substituted throughout the rest of the multi-line text before anything else shoots off. The rest of the line is the caption.

Yeah. I just checked and it's in 1.8.0.4 (the latest release). There's a bunch of stuff new in the latest dev version.

viewtopic.php?f=4&t=404

features list:
viewtopic.php?f=4&t=311


Fri Aug 20, 2010 4:45 am
Profile

Joined: Thu Dec 10, 2009 6:37 am
Posts: 335
Post Re: OpenRPG & SR4 Dice Rolling with Variables
FastWalker wrote:

[?d6]
Variable 1:
? = 3
Output 1:
36
(why did it remove "d"?)


The ? prompt has a "feature" that allows you to supply a caption for the pop-up. Sadly when it was first put in the format for said caption was simply any alpha string following the ?. Yuch. But... for backwards compatibility I don't feel great about removing it because it might break someone's carefully worked out sheet. There is an alternative format for the prompt which is ?{blah blah blah} and that is why what prof.ebral suggests works. [?{}d6] works and so does [?}d6]

FastWalker wrote:
[color=#40BF00]
Send 2:
[[?]d6]
Variable 2:
? = 3
Output 2:
[3d6]
(executes only inner square brackets)


I believe it actually looks at [[?] as the entire die roller string as it doesn't expect nested [...]s. That translates to just a [3 and then the d6] is considered text essentially.


FastWalker wrote:

[!@Intuition@!+!@Reaction@!d6.init(!@Intuition@!+!@Reaction@!)]
Variable 3:
Intuition = 4
Reaction = 3
Output 3:
4+3d6.init(4+3) => [4, 3, 2, 5] 1 hit, init = 7 + 1 => 8
[executes a 3d6.init(7) and ignores "4+")



I'm not actually sure what that formula does.... the substitution seems to work but the actual calculation is wrong? The output doesn't appear to be a single number which might cause problems with the addition operator. Is the intended output a 12? What die roller is the init() function defined for?


Fri Aug 20, 2010 5:01 am
Profile

Joined: Thu Dec 10, 2009 6:37 am
Posts: 335
Post Re: OpenRPG & SR4 Dice Rolling with Variables
prof.ebral wrote:
You have to put a stop bracket after the ?, [?}d6] The stop bracket is there so you can label and create reminders.

As for the addition part, that is a failure in Standard. Traipse is making changes in how the die roller works. In current Beta the roll [1d6+1d8] will fail, but that is only because I have not released the most up to date utils.py. The one I have on my desk allows [(2+4)+4d(6+8)+(4*4)] to roll and it equals 6 + 4d30. Traipse will also allow [(2+4)+4d5+(6+8)+(4*4)] to roll which equals 6+4d5+14+16.


Well [1d6+1d8] works fine for me on 1.8.1 but anything of the form [..... + (4*4)] seems to come out as 32 for some bizarre reason.
How odd. is that what you were trying to fix?


Fri Aug 20, 2010 5:17 am
Profile
User avatar

Joined: Wed Dec 09, 2009 9:39 pm
Posts: 712
Post Re: OpenRPG & SR4 Dice Rolling with Variables
The [1d6+1d8] is just a temporary fail. I have not added the file yet because the branch is on my 64 machine and I am a bit nervous about attempting to update from my 32 bit machine. Last time I did I think I cause a lot of problems. So it can wait for now. The file on my desktop works with [1d6+1d8]

_________________
I ate your Death Knell.
The Traipse Movement
Please show your support for Traipse OpenRPG http://www.facebook.com/MadMathLabs
Send me Traipse OpenRPG Ideas, Bugs, Complaints, Praises here: https://getsatisfaction.com/mml


Fri Aug 20, 2010 5:29 am
Profile YIM WWW

Joined: Thu Aug 19, 2010 8:32 pm
Posts: 4
Post Re: OpenRPG & SR4 Dice Rolling with Variables
prof.ebral wrote:
Yeah, but if you are not using the latest Traipse beta it will break your dieroller.


Hmmm, I guess I can wait until your code passes beta. In the meantime, using the stop bracket should help out until then.

Do you know what version of Traipse your code will be attached to?


Fri Aug 20, 2010 8:25 pm
Profile

Joined: Thu Aug 19, 2010 8:32 pm
Posts: 4
Post Re: OpenRPG & SR4 Dice Rolling with Variables
davidbyron wrote:
There's an improved (or different) user input prompt in OpenRPG 1.8.1 ... might be in 1.8.0...
It's a slash command...

Awesome! I'll try out the slash command to name variables. We'll see if it'll work with Send commands on my character sheet design.

Documentation for OpenRPG is thin and mostly general. I tried searching for solutions and none ever yielded hints about either the "slash command" nor "stop bracket". Where did you and prof.ebral learn about the "slash command" and "stop bracket"? Are they part of python programming language? Or exclusively part of OpenRPG?

davidbyron wrote:
FastWalker wrote:

[!@Intuition@!+!@Reaction@!d6.init(!@Intuition@!+!@Reaction@!)]
Variable 3:
Intuition = 4
Reaction = 3
Output 3:
4+3d6.init(4+3) => [4, 3, 2, 5] 1 hit, init = 7 + 1 => 8
[executes a 3d6.init(7) and ignores "4+")



I'm not actually sure what that formula does.... the substitution seems to work but the actual calculation is wrong? The output doesn't appear to be a single number which might cause problems with the addition operator. Is the intended output a 12? What die roller is the init() function defined for?

init() function is part of the sr4 dieroller ("/dieroller sr4"):

Xd6.init(X)
X = 5 (Initiative value +/- modifiers)
Result:
5d6.init(5) => [5,3,1,2,6], 2 hits => (5+2) = 7
(character's initiative roll for this round is 7)


sr4.py file contains a better explanation. You also have edge() and initedge() for sr4 mode.


Fri Aug 20, 2010 8:38 pm
Profile
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 11 posts ]  Go to page 1, 2  Next


Who is online

Users browsing this forum: No registered users and 26 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by Vjacheslav Trushkin for Free Forums/DivisionCore.