Starfinder Playlist

Thread: LUA questions?

  1. #1

    LUA questions?

    I can't seem to find or figure out where to post questions, specifically about LUA, for instance, what's the syntax for simple rounding, using the math function?

  2. #2
    Zacchaeus's Avatar
    Join Date
    Dec 2014
    Location
    Scotland
    Posts
    20,735
    See the developers guide https://fantasygroundsunity.atlassia...eveloper+Guide as a starting point. You’ll probably get more help by posting in the armoury section or on Discord.
    If there is something that you would like to see in Fantasy Grounds that isn't currently part of the software or if there is something you think would improve a ruleset then add your idea here https://www.fantasygrounds.com/featu...rerequests.php

  3. #3
    math.ceil (round up) or math.floor (round down) on a number. Most questions would be placed in the Workshop when related to coding questions.
    Dominic Morta
    Ruleset Developer
    Smiteworks

    How to zip up your campaign if the Developers ask for it-How to zip up your campaign if the Developers ask for it

    How to provide an Unity Connection issue?-Connection Issues and What to Provide

    Unity Updater issue?-Updater Issues

    Classic and Unity Port Forwarding?-Fantasy Grounds Connections Explained

    Comcast or Cox ISP User?-Comcast XFinity and Cox Users

    Have a suggestion?-Feature Request

  4. #4
    https://www.lua.org/docs.html for general questions about the LUA language. As mentioned above see the developer guide section of the FG wiki for information specific to programming for FG.

  5. #5
    Quote Originally Posted by bloodylemming View Post
    I can't seem to find or figure out where to post questions, specifically about LUA, for instance, what's the syntax for simple rounding, using the math function?
    IMO the best option for this is google search. More than likely you'll find it on stackexchange.
    ---
    Fantasy Grounds AD&D Reference Bundle, AD&D Adventure Bundle 1, AD&D Adventure Bundle 2
    Documentation for AD&D 2E ruleset.
    Custom Maps (I2, S4, T1-4, Barrowmaze,Lost City of Barakus)
    Note: Please do not message me directly on this site, post in the forums or ping me in FG's discord.

  6. #6
    I find plenty of info on .ceil and .floor, but that's just round up, round down. I need a simple rounding, where .5 is rounded up and anything less is rounded down. Gone through the LUA 5.1 reference and so far, it's looking like I'll just have to make a function.

    Can an admin move this to the Armory or Workshop, or do I just repost it?

  7. #7
    damned's Avatar
    Join Date
    Mar 2011
    Location
    Australia
    Posts
    26,649
    Blog Entries
    1
    Lua deliberately doesnt have existing functions for everything.
    If you need to do something like simple rounding use
    math.floor(num + 0.5);

  8. #8
    Quote Originally Posted by damned View Post
    Lua deliberately doesnt have existing functions for everything.
    If you need to do something like simple rounding use
    math.floor(num + 0.5);
    That's simpler than what I was going to do, which is to subtract .floor from .abs, make the comparison whether to add 1 to .floor... Thanks for saving me from myself. !)

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
  •  
DICE PACKS BUNDLE

Log in

Log in