STAR TREK 2d20
Page 10 of 11 First ... 891011 Last
  1. #91
    Samarex's Avatar
    Join Date
    Sep 2015
    Location
    Philippines
    Posts
    1,029
    Quote Originally Posted by Erin Righ View Post
    Good effort mate, but the calculations are wrong, a +2 STR equals 14 a +4 equals 18 and a +1 equals 12
    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

  2. #92
    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

  3. #93
    Samarex's Avatar
    Join Date
    Sep 2015
    Location
    Philippines
    Posts
    1,029
    Thanks moon will look at that.
    Discord User : Samarex#0318
    Ultimate License
    Starfinder Society ID#:274538
    Lets Play a RPG

  4. #94
    Samarex's Avatar
    Join Date
    Sep 2015
    Location
    Philippines
    Posts
    1,029
    Quote Originally Posted by Erin Righ View Post
    Good effort mate, but the calculations are wrong, a +2 STR equals 14 a +4 equals 18 and a +1 equals 12
    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 21515
    Last edited by Samarex; November 18th, 2017 at 14:00.
    Discord User : Samarex#0318
    Ultimate License
    Starfinder Society ID#:274538
    Lets Play a RPG

  5. #95
    Erin Righ's Avatar
    Join Date
    May 2016
    Location
    Vernon, BC, Canada
    Posts
    396
    Thanks Russ

  6. #96
    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.

  7. #97
    LordEntrails's Avatar
    Join Date
    May 2015
    Location
    -7 UTC
    Posts
    17,147
    Blog Entries
    9
    Quote Originally Posted by circette View Post
    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.
    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.

  8. #98
    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!
    Thanks for the warm welcome. I had deleted and reinstalled latest version of Fantasy Grounds (v3.3.3) and the starfinder conversion ext. Ran my campaign with no other extensions and I was able to recreate it. Based on your advice I started a new campaign and was able to replicate there as well.

    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.

  9. #99
    LordEntrails's Avatar
    Join Date
    May 2015
    Location
    -7 UTC
    Posts
    17,147
    Blog Entries
    9
    Quote Originally Posted by circette View Post
    Thanks for the warm welcome. I had deleted and reinstalled latest version of Fantasy Grounds (v3.3.3) and the starfinder conversion ext. Ran my campaign with no other extensions and I was able to recreate it. Based on your advice I started a new campaign and was able to replicate there as well.
    Great, thanks for doing all that. It helps cut down on trouble shooting for Samarex. He's been attentive to this thread and I'm sure he will be along soon to see what he can do to get things fixed.

    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.

  10. #100
    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 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