Thread: lua maths
-
July 23rd, 2016, 17:08 #1
- Join Date
- May 2012
- Location
- France
- Posts
- 103
lua maths
hi,
Is it allowed to do .maths with the current .lua version in FG? If so, i'd like to know how to do this :
I got a Strength value that i can get. I'd like to get (2x Strength) to use the result elsewhere.
Many thanks
-
July 23rd, 2016, 18:42 #2
- Join Date
- Jun 2013
- Location
- Isanti, MN
- Posts
- 2,922
The name of the strength attribute in the database depends on which ruleset you're using. In Castles and Crusades, for example, you can use the following to calculate that value:
local nTotal = DB.getValue(nodeChar, "abilities.strength.score", 0);
nTotal = nTotal * 2;
-
July 24th, 2016, 12:57 #3
- Join Date
- May 2012
- Location
- France
- Posts
- 103
Thanks, i'll try it.
-
July 25th, 2016, 04:24 #4
For further info on what you can do with LUA in FG see here: https://www.fantasygrounds.com/modguide/scripting.xcp
Private Messages: My inbox is forever filling up with PMs. Please don't send me PMs unless they are actually private/personal messages. General FG questions should be asked in the forums - don't be afraid, the FG community don't bite and you're giving everyone the chance to respond and learn!
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks