DICE PACKS BUNDLE
Page 1 of 3 123 Last
  1. #1

    Join Date
    Dec 2004
    Location
    Chicago-ish
    Posts
    2,234

    Who is going to create the first usefull script?

    So, who's it going to be and what will it do?



    rv

  2. #2
    I have one built into the source code hehe. Look at the chat_chat.lua file for this section:

    Code:
    --		local dicetable = {};
    --		dicetable = draginfo.getDieList();
    		
    --		local size = table.maxn(dicetable)
    --		for i= 1,size do
    --			if (dicetable[i].type == "d10" and dicetable[i].result == 10) then
    --				local explodetable = {};
    --				table.insert(explodetable, "d10");
    --				throwDice("dice", explodetable, 0, "Exploded");
    --			end
    --		end
    • Copy the d20 ruleset folder to a new directory and copy the following files: base.xml, desktop.xml, desktop_classes.xml, scripts/chat_chat.lua.
    • In the chat_chat.lua file comment the above section out.
    • In the base.xml file change the desktop.xml to your custom ruleset location.
    • In the desktop.xml file change the desktop_classes.xml to your custom ruleset location.
    • In the desktop_classes.xml section change the chat_chat.lua reference to your custom ruleset location.

    Now roll a d10 or several d10 until you get a 10 and it should roll another one automatically. During the beta this would crash the program but the devs said they fixed it so someone test it out before I can.
    Last edited by joshuha; April 23rd, 2007 at 22:09.

  3. #3

    Join Date
    Dec 2004
    Location
    Chicago-ish
    Posts
    2,234
    Ok... the first one not built into the base code.

    Cheater.

    rv

  4. #4
    I'm not a programmer, but here's a script I'd really like to see.

    Start with text files full of items.
    I'd like to be able to select a text file and randomly generate an item from the chosen file.

    That would be extremely handy for names, place, things, attributes to items, encounters, equipment, - I could go on and on.

    If anyone knows if this is possible, I'd really like to see something on it.

  5. #5
    Oberoten's Avatar
    Join Date
    May 2006
    Location
    Älvsbyn, Sweden
    Posts
    2,620
    Well, it seems to be working now. No bugs and exploding D10s.

    Hmmm... I keep poking at it a bit as well to add a stress-die with less than stellar results.

    Basically what I need is this :
    On a 1 : Reroll and Double the next roll, if that too is a 1 reroll again and double twice. IE x2 x4 x8 x16 x32 x64 x128 etc etc.

    On a 0 : Reroll and substract, on a second zero, reroll and double and substract the final roll. IE x-1 x-2 x-4 x-8 x-16 x-32
    For your Ars Magica needs :
    https://fgrepository.com




    Atque in perpetuum frater, Ave atque vale.

  6. #6
    Quote Originally Posted by Oberoten
    Well, it seems to be working now. No bugs and exploding D10s.

    Hmmm... I keep poking at it a bit as well to add a stress-die with less than stellar results.

    Basically what I need is this :
    On a 1 : Reroll and Double the next roll, if that too is a 1 reroll again and double twice. IE x2 x4 x8 x16 x32 x64 x128 etc etc.

    On a 0 : Reroll and substract, on a second zero, reroll and double and substract the final roll. IE x-1 x-2 x-4 x-8 x-16 x-32
    Since you need to track multiple series (a 1, then do something if you get ANOTHER 1) you will need to use the CampaignRegistry table to hold some flags/values in between the rolls. It wouldn't be terribly difficult and if you are willing to help me test some this weekend I can help you work it out

  7. #7
    Quote Originally Posted by nezzir
    I'm not a programmer, but here's a script I'd really like to see.

    Start with text files full of items.
    I'd like to be able to select a text file and randomly generate an item from the chosen file.

    That would be extremely handy for names, place, things, attributes to items, encounters, equipment, - I could go on and on.

    If anyone knows if this is possible, I'd really like to see something on it.
    I don't think we have access to files through the LUA script in FG due to security concerns. However, this could be done easily enough through large table values in LUA. Wouldn't be as customizable as you are looking for but it would still be doable.

  8. #8
    Quote Originally Posted by joshuha
    Since you need to track multiple series (a 1, then do something if you get ANOTHER 1) you will need to use the CampaignRegistry table to hold some flags/values in between the rolls. It wouldn't be terribly difficult and if you are willing to help me test some this weekend I can help you work it out
    I just added a fifth optional parameter to chatwindow.throwDice that will get added as the custom data to the roll. You can use this to pass data from one step of the roll to the next. The passed data would be available as draginfo.getCustomData() in the d20 example.

    Edit: Available after the next update, of course...
    Tero Parvinen
    Fantasy Grounds Guru

  9. #9
    So is there any way to check the Crit field to see if the die >= the crit and roll an extra d20 if it is?

  10. #10
    Yes thats easily doable once you parse out whats in the field.

    Just in the chat_chat.lua file look for the onDiceLanded event and you would process the results then and do a throwDice() command with the appropiate parameters.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
FG Spreadshirt Swag

Log in

Log in