PDA

View Full Version : Calling variable within a Parent Node


belthasar
10-05-2008, 04:39 PM
Greetings to all,

I have been testing OpenRPG for some time and I was trying to configure a versatile variable calling system.
In this page (http://openrpg.wrathof.com/faq/Complex_Dice_Rolling) of the FAQ I've seen how you can call variable stored inside text node nested inside a container using the expression !@NodeParent::NodeChild@!. I've tried it with all the container-types, but I can't manage to let it work, it still calls the one closest to the top of the Game Tree all the same.
I'm running on Mac Os, but my friends have been tried it on WIN XP as well, and they get the same error.
Is there something I'm doing wrong?
Thank you so much for the attention.

Belthasar

tdb30_
10-06-2008, 03:01 PM
It will always choose the first item at the same level on the tree with the name you are using. Either change the name of the node, or put it at another level so there isn't a duplicate name at the same level.

belthasar
10-07-2008, 01:28 AM
Thank you for the reply.

I'm not sure I completely understand. I hope I am not exploiting your patience asking for clarifications.
Are you basically saying that the selector expression !@Nodeparent::Nodechild@! doesn't work at all, right? And what exactly do you mean by putting the nodes on different levels?
I also have a last question: is there a way to call a particular variable within an expression with the "?" selector, or can I call just a regular number?
I will make it clearer: let's say that, for example, I have two character sheets: one named X and another Y, each of them has stored within a text node the variable "AC", but, since as I understand the above selector doesn't work, let's say I have called the variable "AC" for X: "X-AC" and the same variable for Y: "Y-AC".
Now, if I would call the expression; [1d20.vs(!@X-AC@!)] it would render out as intended, but what if I would like to render the same expression versatile (e.g. storing it as a macro) by letting me input only the variable I'm rolling against? For example, writing [1d20.vs(!@?-AC@!)] would me let input wheter it is X or Y without rewriting all the expression; when I do this, however, it doesn't parse the expression and it understands the whole "!@X-AC@!" bit as just text.
I hope I have made it clear. Is there a work-around to this to get to my aim?

Sorry for being so prolix, but being English not my native language it is sometimes difficult to make things clear.
I hope I didn't bother you too much,

Looking forward to your answer,

Belthasar

tdb30_
10-07-2008, 04:32 PM
Are you basically saying that the selector expression !@Nodeparent::Nodechild@! doesn't work at all,

No, I'm not saying that. What I'm saying is that !@Nodeparent::Nodechild@! can also be !@Nodeparent::@Nodeparent::Nodechild@!

If you have two character sheets named something different you should be able to do for instance !@Sheet1::stats::AC@! and !@sheet2::stats::AC@! This assumes the sheets names are Sheet1 and sheet2, and that there is a stats node under that, and finaly an AC noded under the stats node.

I'm not sure if you can use the info in the die roller.

And don't worry about asking questions. I'm happy to answer any you have as best as I can.

belthasar
10-07-2008, 05:30 PM
Thank you very much, you are very kind (and your hydroponics project is very interesting).

This trick doesn't seem to work for me.
If I make a node tree like: Sheet1 > stats > AC > "foo" calling it with !@Sheet1::AC@! gives back foo (as does simply !@AC@!), while calling it with !@Sheet1::stats::AC@! gives exactly !@Sheet1::stats::AC@ — it doesn't seem to parse the variable call.
On the other hand it is clear that it somehow interprets the first node parent since it takes it out of the expression.
However, if I have another node tree going like: sheet2 > stats > AC > "bar", asking for !@sheet2::AC@! gives back foo again and not bar. Same as above, !@sheet2::stats::AC@! doesn't parse.

Any ideas of what I may be doing wrong? Should I attach the example XMLs I use?
Thanks,

B.

tdb30_
10-08-2008, 04:24 PM
what if you do !@sheet2::AC@!

what does that show?

belthasar
10-08-2008, 06:53 PM
That would be exactly the problem: inputing !@sheet2::AC@! would give whatever variable is stored inside the AC field closest to the top of the GameTree, whether that is sheet2 or not.

tdb30_
10-09-2008, 04:45 PM
Humm. I think that should work. Are you typing the name of the sheet exactly as it is named?

Also, maybe there are spaces or some weird characters like apostrophies. Try removing them from the name of the sheet so it is just straight alphabetical.

belthasar
10-09-2008, 04:59 PM
Yes, no typing errors and no special characters. I have tried with also simple names as "a" or "b" but to no avail.
Well, I suppose that's just a fairly strange occurrance? It surprises me that also my friends on Windows XP experience the same thing...

tdb30_
10-13-2008, 06:32 PM
Somewhere along the lines something must have broken in the code.