-
November 18th, 2017, 05:28 #91
Ok got it mostly working. but it not reading the data the way I need it too. The data gets set a "string" but it just gets the number not the -/+ so a -1 gets read as a 1
How can I get this to read the -/+?
Code:function parseStatistics(creature,data) local str,dex,con,int,wis,cha; local bab,cmb,cmd,babcmd,lang; local err, errmsg; local tmp; local termChars = {',',';'}; -- parse Staistics tmp = getLineByName('Str',data,creature.mark_statistics,(nil == creature.mark_ecology and #data or creature.mark_ecology)); str = getBonusNumber(getValueByName('Str',tmp,termChars),0); dex = getBonusNumber(getValueByName('Dex',tmp,termChars),0); con = getBonusNumber(getValueByName('Con',tmp,termChars),0); int = getBonusNumber(getValueByName('Int',tmp,termChars),0); wis = getBonusNumber(getValueByName('Wis',tmp,termChars),0); cha = getBonusNumber(getValueByName('Cha',tmp,termChars),0); Debug.console("creaturegen.lua","parseStatistics","str",str); creature.str = 10 + (str * 2); creature.dex = 10 + (dex * 2); creature.con = 10 + (con * 2); creature.int = 10 + (int * 2); creature.wis = 10 + (wis * 2); creature.cha = 10 + (cha * 2);
Code:function getBonusNumber(str, type) if (not str) then return '0'; end if (not type) then type = 1; end local retval = '0'; local locStart = 0; local locEnd = #str; local num; str = str:gsub('%s',''); if type == 0 then num = str:match('%d+'); if num then retval = num; else retval = '0' end elseif type == 1 then num = str:match('%+%d+'); if num == nil then num = str:match('%-%d+'); if num == nil then num = str:match('%d+'); if num == nil then num = '0'; end end end retval = num; end return retval; end
Last edited by Samarex; November 18th, 2017 at 05:30.
Discord User : Samarex#0318
Ultimate License
Starfinder Society ID#:274538
Lets Play a RPG
-
November 18th, 2017, 09:42 #92
Supreme Deity
- Join Date
- Mar 2007
- Posts
- 20,710
When I've had to translate from a string to a number, you can usually just use the tonumber() function.
If you need to translate a dice expression, it's more complex, but there is a StringManager.convertStringToDice function that handles that situation.
And it you need a function that evaluates operators, including multiplication and division, you can look at StringManager.evalDiceMathExpression
Cheers,
JPG
-
November 18th, 2017, 12:42 #93
Thanks moon will look at that.
Discord User : Samarex#0318
Ultimate License
Starfinder Society ID#:274538
Lets Play a RPG
-
November 18th, 2017, 13:54 #94
Ok got it fixed Starfinder CGen Version 1.3 on front page.
Ability Score input. Now inputs Ability Score to match the Bonus level from Stat Block so a Str +4 in the stat block will input a Str 18 in the NPC sheet. a Str -1 will input a Str 8 on NPC Sheet.
Samarex
Attachment 21515Last edited by Samarex; November 18th, 2017 at 14:00.
Discord User : Samarex#0318
Ultimate License
Starfinder Society ID#:274538
Lets Play a RPG
-
November 18th, 2017, 17:33 #95
-
December 7th, 2017, 03:47 #96
- Join Date
- Nov 2017
- Posts
- 3
Hi,
I am getting an error when attempting to resolve damage from a spell across multiple targets. The error is:
Script Error: [string "scripts/manager_action_damage.lua"]:1255: attempt to call field 'getEffectsBonusByType' (a nil value)
starfinder error.jpg
Thanks for any help you can provide.
-
December 7th, 2017, 05:16 #97
Please: First thing to do is verify that you have all other extensions disabled. Second thing is to make sure you have updated FG and have the latest version of this in your FG Data folder. Third thing is to start a new campaign and see if the issue duplicates. Or let us know that you've done those things and you are still having a problem (those account for about 80-90% of script errors).
Edit: Oh, and welcome!
Problems? See; How to Report Issues, Bugs & Problems
On Licensing & Distributing Community Content
Community Contributions: Gemstones, 5E Quick Ref Decal, Adventure Module Creation, Dungeon Trinkets, Balance Disturbed, Dungeon Room Descriptions
Note, I am not a SmiteWorks employee or representative, I'm just a user like you.
-
December 7th, 2017, 18:01 #98
- Join Date
- Nov 2017
- Posts
- 3
Please: First thing to do is verify that you have all other extensions disabled. Second thing is to make sure you have updated FG and have the latest version of this in your FG Data folder. Third thing is to start a new campaign and see if the issue duplicates. Or let us know that you've done those things and you are still having a problem (those account for about 80-90% of script errors).
Edit: Oh, and welcome!
EDIT: Just want to point out its only the spells I can't do mulit damage ranged and melee work fine.Last edited by circette; December 8th, 2017 at 00:09.
-
December 7th, 2017, 20:05 #99
Problems? See; How to Report Issues, Bugs & Problems
On Licensing & Distributing Community Content
Community Contributions: Gemstones, 5E Quick Ref Decal, Adventure Module Creation, Dungeon Trinkets, Balance Disturbed, Dungeon Room Descriptions
Note, I am not a SmiteWorks employee or representative, I'm just a user like you.
-
January 4th, 2018, 02:45 #100
- Join Date
- Apr 2015
- Posts
- 124
How do I install the update for Pathfinder? I'd like to give this a try.
Thread Information
Users Browsing this Thread
There are currently 2 users browsing this thread. (0 members and 2 guests)
Bookmarks