PDA

View Full Version : Dire need of herding the Wild-Die.



Oberoten
September 20th, 2007, 10:31
... still drudging on with the wild-die thing for FG2.
Even tried ripping and jury-rigging joshua's feng-shui code to see if I could make it work.

No luck I am afraid.

I got a code-suggestion earlier once, but that one did not work at all (in fact it crashed FG2 whenever I tried to start it up with the code present which kinda made it hard to debug)

... at the moment I am on the verge of headbutting the poor keyboard into oblivion. PLEASE help me someone who is more into the code-side.

I offer renders and graphics in exchange. :)

- Obe

Tokuriku
September 20th, 2007, 11:49
Wich die do you want to be able to be wild and what exactly do you want to happen when it goes wild?

Valarian
September 20th, 2007, 12:12
If it's the wild die from Star Wars d6, just drop it. I don't tend to use the wild die rule in my games, and it works okay.

Oberoten
September 20th, 2007, 12:35
Wich die do you want to be able to be wild and what exactly do you want to happen when it goes wild?

Basically, I need something which keeps dropping a dice whenever it lands a 1 or a 10, if it lands on a ten, one multiplier will keep increasing, if it lands on a 1 another.

IE :
If you roll a 1, roll again and double the roll. (First roll decides direction)
Add modifier and you have a sucesslevel.

If you roll a 10, roll again and double the roll, but substract the results.
Botches occur. ;)

Preferably, I'd like to do this with a graphical dice, I think I can hack it with a math.rand command but it isn't as elegant. (and if I have a nice graphical dice, maybe I can put a toggle into it in style of the /die reveal command.

- Obe

heruca
September 20th, 2007, 20:45
What system uses the wild die in that manner? Just curious.

Oberoten
September 20th, 2007, 20:49
What system uses the wild die in that manner? Just curious.

It is a speed-up of ArsMagica.

In normal Arm, it can only go positive. We use the negative instead of rolling more dice on a 10 (zero actually) since it is faster.

(IE normal procedure is : Roll 0, roll more d10 to see if any more zeroes turn up... if so it is a botch, how bad depends on how many zeroes. We use first 0 makes roll go negative, second gives a *2 multiple, third *4 etc.)

** Edited for clarifying **

joshuha
September 20th, 2007, 21:26
Alright let me see if I understand this:

-All D10s

Case 1:
If the first roll is a 1, roll another d10 and add x2 the result. However, if this reroll is another 1, roll another d10 and x4 the result. Repeat.

Case 2:
If the first roll is a 10, roll another d10 and subtract x2 the result. However, if this reroll is another 10, roll another d10 and subctract x4 the result. Repeat.

Question: Do all the 1s (or 10s) get counted in the totals. So I roll 1,1,1,5 should that be (1+1+1+5)x8 or just 5x8?

Oberoten
September 20th, 2007, 21:30
Each one doubles the multiplier :
1 * 2
2 * 4
3 * 8
4 * 16


First 0 or 1 decides which way to go.
First 0 just turns the roll negative,

1 * -1
2 * -2
3 * -4
Etc

joshuha
September 20th, 2007, 21:35
So all the 1s or 10s do is change the multiplier. Its only the final die roll that doesnt hit the 1/10 that gets multiplied?

Oberoten
September 20th, 2007, 21:40
So all the 1s or 10s do is change the multiplier. Its only the final die roll that doesnt hit the 1/10 that gets multiplied?

Yeah exactly.
I tried with a repeat structure... but it didn't seem to work. (Probably borkeded it along the way)

joshuha
September 20th, 2007, 21:42
In the case of a 1,1,10 is that 10 treated as an actual 10? So would that be 40 as the result?

Oberoten
September 20th, 2007, 21:51
Yes, that is exactly it. I am sorry if I was unclear on it at first.

Tassadar237
September 21st, 2007, 01:00
Couldn't this be done by creating three separate custom dice? The first one would have an onValue function that causes a throwDice function of the positive multiplier type when a 1 is rolled, and a throwDice function of the negative modifier type if a 10 is rolled. So, effectively, you would create three custom dice, but only ever manually select 1 of them, the "Wild Die", which, on a 1 or a 10, would automatically cause the roll of either the "Positive Modifier Die", or the "Negative Modifier Die". When the "Positive Modifier Die" lands on a 1, it rerolls itself, just as the "Negative Modifier Die" does when it lands on a 10.

Oberoten
September 21st, 2007, 07:40
Couldn't this be done by creating three separate custom dice? The first one would have an onValue function that causes a throwDice function of the positive multiplier type when a 1 is rolled, and a throwDice function of the negative modifier type if a 10 is rolled. So, effectively, you would create three custom dice, but only ever manually select 1 of them, the "Wild Die", which, on a 1 or a 10, would automatically cause the roll of either the "Positive Modifier Die", or the "Negative Modifier Die". When the "Positive Modifier Die" lands on a 1, it rerolls itself, just as the "Negative Modifier Die" does when it lands on a 10.

I am thinking (with my limited understanding right now... ) that with the result being set in an array anyway that might not be the most efficient way of handling it. It is a possible way, yes, but it might be unecesarily complex.

Foen
September 21st, 2007, 17:17
There has already been discussion of open-ended (exploding) d10s, in the thread here (https://www.fantasygrounds.com/forums/showthread.php?t=6837). Does that help at all?

It seems the objective is similar.

Stuart

Foen
September 21st, 2007, 18:44
Hi Obe

The following code seems to do the trick, but is a bit lacking on visual impact.



<customdie name="w10">
<model>d10</model>
<menuicon>customdice</menuicon>
<script>
function onValue(result)
local mult=1;
if result==1 then
mult=2;
result = math.random(10);
while result==1 do
mult = mult * 2;
result = math.random(10);
end
elseif result==10 then
mult=-1;
result = math.random(10);
while result==10 do
mult = mult * 2;
result = math.random(10);
end
end
return result*mult;
end
</script>
</customdie>


Typing '/die w10' at the chat prompt rolls the die. I'd like to change the way it reports in the chat window and will look into it.

Cheers

Stuart

Oberoten
September 21st, 2007, 19:02
Thank you. :) It is a very good place to start. :)

Foen
September 21st, 2007, 19:14
I've had a brief look at the way dice are handled, and I don't think the result can be exploded graphically.

It is possible to replace a w10 result (say -4) with a string of d10 values (10,10,2) but it wouldn't help: if you added up the values they'd be wrong (22).

Instead, you could show the impact of each roll (2,-4,-2) so they added up, but that wouldn't be very intuitive.

I don't think you can easily change the text (to say, for example "10,10,2=-4"). It would also ruin any text used for the underlying roll: /die w10+2 "Sword Attack" would become /die w10+2 "10,10,2=-4" (and the result would be -2).

Sorry

Stuart

Oberoten
September 21st, 2007, 20:04
Would it be possible to just show all the rolls? The summing up of it all is after all rather fun point to the wikd-die itself. :)


- Obe

Foen
September 21st, 2007, 23:22
Hi Obe

I'm working on showing the rolls "as is" but I need to know if/how you want them to interact with other rolls.

I can make a single wild-die roll (say 10,10,2 = -4) appear as 10,10,2 in the chat window, but if you roll d10 plus a wild die it would show as 4,10,10,2 or perhaps 10,10,10,2 or even 1,10,10,2.

This doesn't seem helpful for your players (you cannot tell which rolls are wild and which are normal).

Did you have an approach in mind, or is it best to revert to the first method (which would show 4,-4 or 10,-4 or 1,-4 for each of the above)?

Cheers

Stuart

Oberoten
September 22nd, 2007, 07:29
Hi Obe

I'm working on showing the rolls "as is" but I need to know if/how you want them to interact with other rolls.

I can make a single wild-die roll (say 10,10,2 = -4) appear as 10,10,2 in the chat window, but if you roll d10 plus a wild die it would show as 4,10,10,2 or perhaps 10,10,10,2 or even 1,10,10,2.

This doesn't seem helpful for your players (you cannot tell which rolls are wild and which are normal).

Did you have an approach in mind, or is it best to revert to the first method (which would show 4,-4 or 10,-4 or 1,-4 for each of the above)?

Cheers

Stuart

It'd be nice if it just showed the sequence and the modifier.
1 - 1 - 1 - 4 +7 Melee

Or for the more disastrous rolls....
10, 10, 10, 7 +3 Ride (Which with such a negative would be BAD new. VERY bad news, like falling of the horse into a container of used syringes? )

Foen
September 22nd, 2007, 07:41
I think that should be do-able. It won't work if you throw other dice with a wild die (as I mentioned earlier, there is no way to distinguish the rolls from each other).

I'll give it a pop and get back.

Cheers

Stuart

Oberoten
September 22nd, 2007, 07:46
That is absolutely fabolous. :)

Arm has it pretty simple in that regard you seldom do roll more than one dice against a difficulty, how much you beat the difficulty with becomes the effect. (in very short, hitting something with a nine when needing a six means +3 to damage calculations and yes, this does occasionally make it very deadly... )

Foen
September 22nd, 2007, 09:11
Hmm, this isn't working.

I can explode the wild die, and generate the string of subsequent rolls, but there seems to be no way of making them appear as distinct dice results (the draginfo dielist is effectively readonly, you cannot write die types and die results back to the list).

I'm afraid that just leaves my earlier post (which gives the correct value, but without showing the expanded rolls).

Sorry

Stuart

Oberoten
September 22nd, 2007, 09:28
Is there any way to make the wild-die work together with the modifier box?

*Edited*

Oh... it allready does. Then I am happy enough. Now just to add this as an option / custom dice on the D10...

Foen
September 22nd, 2007, 10:38
The die should automatically be listed on the d10: unfortunately the space on the radial menu is taken up by d%.

Foen
September 22nd, 2007, 10:54
Just for the record, the finished code looks like this:



<customdie name="w10">
<model>d10</model>
<menuicon>customdice</menuicon>
<script>
function onValue(result)
local mult=1;
if result==1 then
mult=2;
result = math.random(10);
while result==1 do
mult = mult * 2;
result = math.random(10);
end
elseif result==10 then
mult=-1;
result = math.random(10);
while result==10 do
mult = mult * 2;
result = math.random(10);
end
end
return mult * result;
end
</script>
</customdie>


It goes in gameelements.xml.

Stuart

Foen
September 22nd, 2007, 13:24
This really is the final version! Obe, I've added some text in the chat window that tracks the various rolls. To use this, you will have to move the <script name='ChatManager' ...> line in base.xml above the gameelements line.



<customdie name="w10">
<model>d10</model>
<menuicon>customdice</menuicon>
<script>
function onValue(result)
local mult=1;
local msg = {text="Wild Die roll=" .. result, font="narratorfont"};
ChatManager.addMessage(msg);
if result==1 then
mult=2;
result = math.random(10);
msg.text = " Positive multiplier, further roll=" .. result;
ChatManager.addMessage(msg);
while result==1 do
mult = mult * 2;
result = math.random(10);
msg.text = " further roll=" .. result;
ChatManager.addMessage(msg);
end
elseif result==10 then
mult=-1;
result = math.random(10);
msg.text = " Negative multiplier, further roll=" .. result;
ChatManager.addMessage(msg);
while result==10 do
mult = mult * 2;
result = math.random(10);
msg.text = " further roll=" .. result;
ChatManager.addMessage(msg);
end
end
if mult~=1 then
msg.text = " Total=" .. (mult * result);
ChatManager.addMessage(msg);
end
return mult * result;
end
</script>
</customdie>


Cheers

Stuart

EDIT: fixed bug, spotted by Obe.

Oberoten
September 22nd, 2007, 14:20
Many many many thanks. :)

This takes the playability to entirely new levels. :)

- Obe

Oberoten
September 22nd, 2007, 14:27
Hmmm ... for some reason the new version doesn't seem to handle the 10s at all.
Ah... there.

On the 10 result side it goes a tad haywire with the MSG parameters. msg.text fixed it.