PDA

View Full Version : Coin Flip?



turelus
September 24th, 2008, 18:41
I just had a quick and simple question, I have been fooling around with FGII for a while trying to figure out a simple way to make a coin flip other than rolling dice and saying 1-3 head 4-6 tails. I was just wondering if any one had ideas on how I could make a macro or anything that would come up either heads or tails with a 50% chance.

Foen
September 24th, 2008, 20:15
A custom die might do the trick. d2 is relatively easy to create, using the same code as d3 but based on d4 instead of d6 (edit game_elements.xml):


<customdie name="d2">
<model>d4</model>
<menuicon>customdice</menuicon>
<script>
function onValue(result)
return math.ceil(result/2);
end
</script>
</customdie>


Getting 'heads' or 'tails' to appear on the screen requires additional messing about with onDiceLanded in the chat scripts.

Stuart

turelus
September 24th, 2008, 21:24
Would be adding the heads and tails option be far more work than its worth or would it be a pretty simple change?

Thanks for the reply btw :D

Foen
September 25th, 2008, 05:08
Would be adding the heads and tails option be far more work than its worth or would it be a pretty simple change?

It becomes much more ruleset-specific. If you are using the bundled d20 ruleset, adjusted only for this change, then it would be quite easy. If you are using a custom ruleset it might be quite difficult. Custom rulesets often have their own onDiceLanded code, which you must be careful not to disturb.

Foen