DICE PACKS BUNDLE
  1. #3021
    damned's Avatar
    Join Date
    Mar 2011
    Location
    Australia
    Posts
    26,685
    Blog Entries
    1
    Quote Originally Posted by bloodylemming View Post
    So there's no .getColor, or .setColor type function? Could of sworn the Castles and Crusades sheet did that... Maybe I can try to tear that one apart to see what's actually going on.
    You should totally pull apart other rulesets!
    use the Find In Files feature of Notepad++ to search unpacked rulesets.
    Start with what you know - eg if you find somewhere that does this search on the text.
    That will likely give you a string_resource
    Then search on the string_resource name
    etc

  2. #3022
    damned's Avatar
    Join Date
    Mar 2011
    Location
    Australia
    Posts
    26,685
    Blog Entries
    1
    Quote Originally Posted by bloodylemming View Post
    I have a field that requires several values from other fields, to calculate. I'd like to have the calculation on that one field, instead of having to repeat it on every other field, which would make changes so much easier.
    Is there a way to, say put that formula in an onInit function in the calculated field, then in the other fields, in the onValueChange, force the calculating field to re-initialize?
    Or maybe another solution would be to have the calculation in a function, and just call that function in each of the source fields? If so, do you have a tutorial on creating functions?
    https://www.youtube.com/watch?v=mxAfyK4idBc

  3. #3023
    Okay, for the first part, I'm just trying to get one of the fields to recalculate the target when it's updated.

    Here's what I have in the function:

    Code:
    function calculateAbilityMod(nodeChar, strMod, numCurrent)
    
    	local nResult =0;
    	
    	if numCurrent < 10 then
    		nResult = math.ceil((nScore - 10) / 2);
    	elseif numCurrent > 10 then
    		nResult = math.floor((nScore - 10) / 2);
    	else
    		nResult = 0;
    	end
    
    	nodeChar.getChild(strMod).setValue(nResult);
    	
    	return true;
    	
    end
    Here's what I have in one of the triggers:

    Code:
    function onValueChanged()
    	--values passed> nodeChar, strMod, numCurrent
    	local nodeChar = window.getDatabaseNode();
    	local strMod = "numStrengthMod";
    	local numCurrent = nodeChar.getChild("numStrengthCurrent").getValue();
    	
    	charManager.calculateAbilityMod(nodeChar, strMod, numCurrent);
    end

    I don't think I'm handling the strMod value properly... I need this value so the function knows which stat modifier to update...

  4. #3024
    According to the developer of Ruleset Wizard, there is a .setColor and .getColor (as well as .getFontColor and .setFontColor) method for labels, but I can't seem to get them to work...

  5. #3025
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,413
    Quote Originally Posted by bloodylemming View Post
    According to the developer of Ruleset Wizard, there is a .setColor and .getColor (as well as .getFontColor and .setFontColor) method for labels, but I can't seem to get them to work...
    Probably better to ask coding questions in the Workshop sub-forum - you'll also get more people who can answer looking at your questions in that forum, and you won't take up this MoreCore thread with generic coding questions.
    Last edited by Trenloe; December 23rd, 2021 at 21:05.
    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!

  6. #3026
    Quote Originally Posted by Trenloe View Post
    Probably better to ask coding questions in the Workshop sub-forum - you'll also get more people who can answer looking at your questions in that forum, and you won't take up this MoreCore thread with generic coding questions.
    Good advice. Thanks!

  7. #3027
    What language was that code written in? Not that knowing it would make me understand it, but it does make me curious about what people are doing. My non-skill at coding is dissuading me from doing the alterations or additions needed to bring my ideas of systems to use to life.
    FGU Ultimate -- All Players Welcome
    "Without Love, I'd have no anger. I wouldn't believe in righteousness." -- Bernie Taupin

  8. #3028

  9. #3029
    The Side bar has disappeared when I use Morecore after the last update. Any help would be appreciated. Thank you.

  10. #3030

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
  •  
FG Spreadshirt Swag

Log in

Log in