PDA

View Full Version : diescore question



Visvalor
July 21st, 2010, 22:00
<diescore name="Spell 1">
<anchored>
<to>death_one_1</to>
<position>insidetopright</position>
<offset>40,40</offset>
<size>
<width>25</width>
<height>25</height>
</size>
</anchored>
<script>
function onClickDown(button, x, y)
setDice({"d20"});
end
</script>
</diescore>


How do I get the name pulled from a user input string so that the user can change the name of the diescore to saaay "Flame Ball" or something?

Moon Wizard
July 21st, 2010, 22:31
You're going to be better off making the "Spell x" controls into a windowlist plus windows with a spell name and other information.

See the d20 character sheet spells for an example.

Cheers,
JPG

Visvalor
July 21st, 2010, 22:48
That... doesn't really help.

So you're saying it can't be done or no?

Moon Wizard
July 22nd, 2010, 00:26
You can't change the name of a control once it has been created. You can create controls on the fly using the createControl function.

So, theoretically, you could create a generic control (Spell 1) using the createControl function, then delete it and create a new control (Flame Ball) for your specific situation.

My previous post was advice for ruleset creation in general. The approach that you appear to be taking does not scale well as your ruleset grows.

Regards,
JPG

cpbs
July 22nd, 2010, 00:29
Are you wanting to create a new spell all together, so that the person casting it, can having the information inputed when rolled, ie "Magic Missile damage" then the die rolled?

What exactly are you trying to do?

Visvalor
July 22nd, 2010, 03:55
Nope in my ruleset I have 5 listings for spell slots with a scroll bar for selecting what the spell does. The damage, and sp cost are autocalculated with the spell effect + stats + level. I just wanted it to change the name of the spell when the spell was created and named by the player.

No worries I just made it "Spell Slot 1" etc etc and the player can say what they're doing. The math is all there.