PDA

View Full Version : The code for a d100 /die command



AzureaSkyes
April 21st, 2005, 12:32
I'd originally posted this in the Armory, but I think it should have been here.

I know this has been partially covered in another thread, for someone who wanted a 1d3 roll, but for completeness sake, and to save your fingers, here is my /die 1d100 command.

1. First create a new folder for your ruleset. (I am assuming that you are wanting to play the standard d20 rules, with the addition of the 1d100.) I would recommend calling your new folder d20_yourname, replacing the yourname with your messageboard name, so that if you ever feel like posting the ruleset here it should end up being unique.

2. Inside your new ruleset folder make a directory called data.

3. Copy gameelements.xml from the main game data directory into this new data directory in your ruleset.

4. Copy base.xml from the original d20 ruleset folder into your ruleset folder.

You should now have the following files in your new folder.

\FantasyGrounds\rulesets\d20_azutest\data\gameelem ents.xml
\FantasyGrounds\rulesets\d20_azutest\base.xml

5. Edit your copy of gameelements.xml and add the following after the defination of d20 and before dmdie



<die name="d100">
<values list="1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,
20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36 ,37,38,39,
40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56 ,57,58,59,
60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76 ,77,78,79,
80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96 ,97,98,99,100" />
<icon file="data\icons\d20_icon.png" />
<position point="110,680" />
</die>


6. open up base.xml and alter the gameelements line....



<includefile source="rulesets\d20_azutest\data\gameelements.xml" />


You are now ready to start a new campaign with the /die d100 command installed.

Notes
You may have noticed that the dice roller displays it's result in a white box with a picture of a dice. The dice pictures are not found in your icons folder, which makes me think that they are an override graphic only. In other words if you add the path to your own picture it will show up, but if you use the built-in ones it uses the internal bit map.

In any event, I chose the d20 for this because it looks like it has a lot of sides and means that you dont need to make people download a new die graphic. Although that might be a good idea to stop people getting confused with what kind of dice it is. If you do need to make a new picture for the dice, then I don't know where you can get the original bitmap from, maybe it gets extracted if you select the unpak.exe file? I'm sure someone will let us know.

Using this simple principle, it should be possible now to make other non-standard dice, such as the fudge dice, although you will have to wait for the devs to create composite dice rolling to make dice for games like Alternity and Sovereign Stone, as the simple die result sequence cannot easily represent rolling two or more dice with different faces at a time.

richvalle
April 21st, 2005, 14:12
Very nice! Thanks for shareing.

rv

gavalon
May 5th, 2005, 02:54
fyi, if u right click the d10, it has a % option, where it rolls %

PowerJ
May 15th, 2005, 23:48
OMG u can roll up to 20 dice by right clicking...SWEET

nezzir
March 9th, 2006, 16:10
I made an icon for the d100. You can find it here:
https://mywebpages.comcast.net/nezzir/onlineroleplaying/d100_icon.png

Put it in your rule sets icon directory and change the line in the gameelements file to:
<icon file="rulesets\mymodname\icons\d100_icon.png" />

joshuha
March 9th, 2006, 17:06
Notes
You may have noticed that the dice roller displays it's result in a white box with a picture of a dice. The dice pictures are not found in your icons folder, which makes me think that they are an override graphic only. In other words if you add the path to your own picture it will show up, but if you use the built-in ones it uses the internal bit map.

In any event, I chose the d20 for this because it looks like it has a lot of sides and means that you dont need to make people download a new die graphic. Although that might be a good idea to stop people getting confused with what kind of dice it is. If you do need to make a new picture for the dice, then I don't know where you can get the original bitmap from, maybe it gets extracted if you select the unpak.exe file? I'm sure someone will let us know.



You are pretty close here. Anytime you see a file referenced in the example ruleset but don't see a copy of the file in any physical directory it is located in the resource.pak file. The files are internal to the game and you could replace these and even affect the default fantasy grounds stuff but that isn't recommended. It would be better to create your own ruleset and then reference your new picture as opposed to accidentally screwing up something in the original .pak file and not being able to restore without a complete reinstall.

WolfStar76
March 12th, 2006, 13:10
OMG u can roll up to 20 dice by right clicking...SWEET

Actually, you can "pick up" up to 20 dice by right clicking. Once you have those 20, before you roll them, right-click again. Each right-click will add one MORE die, up to a total of 30 dice.

How do ya like THEM apples?

Vroomfogle
March 27th, 2006, 03:53
This is great - I implemented the d100 die detailed here for my RM ruleset - but I'm confused as to the point of the position tag. That seems it's supposed to place it on the desktop, which it doesn't.

The png icon is like all the other icons and is used for displaying the dice results in the chat window....but what I'd like is to add it as one of the real dice on the desktop.

Also how can I remove the dice from the desktop? RM doesn't use all those other dice and while I might like to keep a d6 and d10 around I'd rather remvoe all the others from the desktop...but deleting the position tag only moves the die to the top left desktop. I don't want to delete the code entirely because won't that make it inaccessible from the command line (/die d4). I don't want to remove those dice from being used, just from the desktop.

joshuha
March 27th, 2006, 13:58
This is great - I implemented the d100 die detailed here for my RM ruleset - but I'm confused as to the point of the position tag. That seems it's supposed to place it on the desktop, which it doesn't.

The png icon is like all the other icons and is used for displaying the dice results in the chat window....but what I'd like is to add it as one of the real dice on the desktop.

Also how can I remove the dice from the desktop? RM doesn't use all those other dice and while I might like to keep a d6 and d10 around I'd rather remvoe all the others from the desktop...but deleting the position tag only moves the die to the top left desktop. I don't want to delete the code entirely because won't that make it inaccessible from the command line (/die d4). I don't want to remove those dice from being used, just from the desktop.

I remember a dev post not too long ago stating that removing dice should be possible in 1.06. But for custom dice I don't think you will be able to have the ability to add a graphical representation unless its just a generic shape as if I did a d22 or d50 or whatever it would have to model that in 3D realtime. But maybe a generic type custom die so you can still roll and apply modifiers would be cool.

Vroomfogle
March 27th, 2006, 16:25
Well in this case the models already exist for the % dice....since you can access them from clicking on d10->%.
Now how can we get them to display on the desktop?

Face
March 27th, 2006, 19:13
Using your guidelines I've made quite a few custom dice (HackMaster requires some odd dice, and there are some I find an excuse to use). Now I have a d2, d3, d5, d7, d9, d14, d16, d24, d30, d50, d100, d1000, d10000...and a few other d1,000's.

I was wondering with the dice .png's, do they need to be a distinct size and format (greyscale, etc.)? I was planning on taking pictures of these odd dice and working them into a similiar format. I think many HackMaster players are used to the D10,000 being yellow, red and then their % dice, but thought it would help if I translated that over to the pictures. A d7,000 roll (part of the critical hit table) would have the d7 pic, the d100 die (I believe it is red) and then those "blank" percentiles....

Snikle
April 1st, 2006, 18:33
For ye intrepids people out there running a Serenity RPG game, here is the info for adding the d2 to the game. Sadly though, no desktop icon, so you have to plug it in manually or use shortcut keys.
Add this code to your gameelements.xml file.


<die name="d2">
<values list="1,2" />
<icon file="rulesets\YOUR-RULESET-HERE\icons\d2_icon.png" />
<position point="360,700" />
</die>


Then download and place this file into your \incons folder:
http:/www.sylnae.net/qwerty098765/d2_icon.png

And Face, the die pngs are 34x34, transparent png files.

Face
April 2nd, 2006, 18:42
Ok, I have my XML all done up and even did a whole new range of dice .png (s) so they would be somewhat consistent. The problem I have now is that I cannot get a roll above about 280. I tried my d1000, d5000, d6000, and my d10000. Nothing about that number. I looked at the XML file and can't see anything wrong. I'm checking it again, but thought I'd see if there was some kind of limit I didn't know about.

Face
April 4th, 2006, 14:26
Last night I did a bunch of more custom dice, including a stopwatch to show what segment of combat you are in and a special set of dice to show reduced weapon damages (d6-1 as a die instead of an expression). I learned something valuable by the process in that all dice need to start with the letter "d".

When I get my big dice problem solved I'll post my custom dice and all of the .png files I made with the dice.

Ged
April 9th, 2006, 05:15
Ok, I have my XML all done up and even did a whole new range of dice .png (s) so they would be somewhat consistent. The problem I have now is that I cannot get a roll above about 280. I tried my d1000, d5000, d6000, and my d10000. Nothing about that number. I looked at the XML file and can't see anything wrong. I'm checking it again, but thought I'd see if there was some kind of limit I didn't know about.

There is a limit on how many characters the list of die values accepts and it is at 1024, I think.

Toadwart
April 10th, 2006, 02:08
Will the scripting in 1.06 provide a random number generator by any chance?
i.e could we just create a function to generate a random number from 1-1000

Ged
April 10th, 2006, 05:59
Will the scripting in 1.06 provide a random number generator by any chance?
i.e could we just create a function to generate a random number from 1-1000

Yes, that will be possible. Easiest will be to use the Lua function math.random as described in Lua reference manual (https://www.lua.org/manual/), e.g. math.random(1000) would produce a pseudo-random integer between 1 and 1000.

mythweaver
November 2nd, 2006, 14:44
Put it in your rule sets icon directory and change the line in the gameelements file to:
<icon file="rulesets\mymodname\icons\d100_icon.png" />

I'm pretty new to FG, and the system I'm working with will require d100 so this thread was very helpful. One thing I noted after some frustration.

the d20_icon.png icon was actually in my "rulesets\mymodname\data\icons" directory so that's where I put the d100_icon.png. The above code caused FG to keep crashing... Of course the file reference should point to the actual file location...

Another thing I noticed was that the modifier stack doesn't seem to append and clear when you throw dice using the /die command like it does when you throw the dice manually. This seems to me to be problematic as it won't allow you to easily create a stack of modifiers plus a rull to assign it to a hotkey, or am I missing something here?

Thanks.

Griogre
November 2nd, 2006, 21:30
The /die command doesn't use the modifier box. It just uses whats in the die command.

Dementia Five
May 24th, 2007, 17:59
I imagine this could work for Fudge dice as well? You know, +,-,<blank>. Anyone tried this?

Foen
May 26th, 2007, 08:06
I learned something valuable by the process in that all dice need to start with the letter "d".

I have managed to create "m" dice for negative values. I use m4 and m6 in CoC for negative damage bonuses, because FGII doesn't let you have 2d6-1d4 in a dicelist, but you can have 2d6+1m4.

Stuart
(Foen)