FG Spreadshirt Swag
Page 1 of 2 12 Last
  1. #1

    4e ruleset to SWSE ruleset (armor check penalty modifier/widget)

    Hello, my friends.

    I'm working on my own Star Wars RPG SE (house-ruled) ruleset by modifying the 4E ruleset (release 20) that comes with FG 2.8.1.

    I don't know much about XML and Lua editing, but I managed to do some things, like changing the skills list on the character sheet.

    But I'm stuck when it comes to customising armor check penalty modifiers and widgets.

    On charsheet_skills.xml we have a script function that goes like this:
    Code:
    function onSourceValue(source, sourcename)
    	if sourcename == "trained" then
    		if source.getValue() == 1 then
    			return 5;
    		end
    		return 0;
    	elseif sourcename == "...encumbrance.armorcheckpenalty" then
    		if StringManager.contains({"strength", "dexterity", "constitution"}, window.statname.getStringValue()) then
    			return math.min(source.getValue(), 0);
    		end
    		return 0;
    	end
    
    	return super.onSourceValue(source, sourcename);
    end
    On charsheet_skillisitem.lua we have a function that goes like this:
    Code:
    function onStatNameUpdate()
    	stat.update(statname.getStringValue());
    
    	if StringManager.contains({"strength", "dexterity", "constitution"}, statname.getStringValue()) then
    		armorwidget.setIcon("indicator_armorcheck");
    	else
    		armorwidget.setIcon(nil);
    	end
    end
    I believe that makes all "strength", "dexterity" and "constitution" associated skills to have the armorcheck widget and the armorcheck penalty applied.

    The thing is: on my house rules armorcheck penalty (as long as the widget) does not apply to Pilot (dex), and armorcheck penalty applies to Use the Force (cha). And I haven't been able to put on these exceptions.

    Adding "charisma" to the lists and adjusting data_common.lua as below did not solve the problem:
    Code:
    -- Skill properties
    skilldata = {
    	["Acrobatics"] = {
    			stat = "dexterity",
    			armorcheckmultiplier = 1
    		},
    	["Athletics"] = {
    			stat = "strength",
    			armorcheckmultiplier = 1
    		},
    	["Deception"] = {
    			stat = "charisma",
    			armorcheckmultiplier = 0
    		},
    	["Endurance"] = {
    			stat = "constitution",
    			armorcheckmultiplier = 1
    		},
    
            ...
    
    	["Persuasion"] = {
    			stat = "charisma",
    			armorcheckmultiplier = 0
    		},
    	["Pilot"] = {
    			stat = "dexterity",
    			armorcheckmultiplier = 0
    		},
    	["Ride"] = {
    			stat = "dexterity",
    			armorcheckmultiplier = 1
    		},
    	["Stealth"] = {
    			stat = "dexterity",
    			armorcheckmultiplier = 1
    		},
    
            ...
    
    	["Use the Force"] = {
    			stat = "charisma",
    			armorcheckmultiplier = 1
    		}
    Can anyone help me?
    Last edited by gandhi39; February 20th, 2012 at 19:15.

  2. #2
    It would be great if, when filling in the sheet at the game, I could choose which skill has armorcheck penalty by clicking a widget.

  3. #3
    You could make a widget to do that, but you would need to add a field to track the information and a control to manipulate the field.

    You can try looking at the 3.5E skills code, since the armor check penalties for 3.5E are tied to the individual skill instead of the attribute used.

    Cheers,
    JPG

  4. #4
    Thanks for the reply. I managed to work around my checkpenalty and checkpenalty widget problems by mixing bits from 4E and 3.5E.
    Last edited by gandhi39; February 24th, 2012 at 06:18.

  5. #5
    I have a new question...

    Consider the following script: ("classskill" and "trained" are checkboxes, and named as sources for the script)
    Code:
    <script>
    	function onSourceValue(source, sourcename)
    		if sourcename == "classskill" then
    			if source.getValue() == 1 then
    				return 3;
    			end
    			return 0;
    		elseif sourcename == "trained" then
    			if source.getValue() == 1 then
    				return 5;
    			end
    			return 0;
    		end
    
    		return super.onSourceValue(source, sourcename);
    	end
    </script>
    If, for "trained", I want a return = character level (instead of return 5) or = half character level (instead of return 0), how would I script that?
    Last edited by gandhi39; February 23rd, 2012 at 19:56.

  6. #6
    How can I make a checkbox (as by the original template and script from the 4E ruleset) return the value of another control (such as "levelbonus") instead of the usual "1"? Someone help me, please!
    Last edited by gandhi39; February 24th, 2012 at 06:20.

  7. #7
    You would have to get the database node of the character, and look up the information in the database for the character.

    Example: To get the level of the character from a field within a specific skill window, you could use:
    window.getDatabaseNode().getChild("...level").getV alue();
    or
    NodeManager.get(window.getDatabaseNode(), "...level", 0);

    * The window.getDatabaseNode() will return the database node of the specific skill within the character record.
    * The getChild("...level") will go up 2 levels in the database (skill list, then top of the character record), then it will access the level field of the character record.
    * Finally, the getValue() call returns the value of the level field entry in the database.

    * The NodeManager.get function just wraps some of that functionality up in a nice function, plus provides a way to specify a default value in case the field does not exist in the database.

    Hope that helps,
    JPG

  8. #8
    Thanks. Sounds hard, but I'll give it a try.

  9. #9

  10. #10
    After years I restarted my project of making a starwars saga ruleset based on the 4E ruleset. Back then it whas 2.8.1 (2012). Now it's 3.3.3 (2017). The 4E ruleset changed a bit, and my problem comes back requiring a new solution. The 3.5E changed too.

    The 4E ruleset ignores the "armorcheckmultiplier" skill property on data_common.lua.

    How can I make it not ignore "armorcheckmultiplier" for a charisma based skill like "Use the Force"?
    Last edited by gandhi39; December 29th, 2017 at 18:16.


    ULTIMATE LICENSE OWNER


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