Back our Kickstarter Campaign going on Now
  1. #1
    Grimmbart's Avatar
    Join Date
    Jan 2008
    Location
    Marseille (France 13)
    Posts
    54

    Need CustomData in 3.5E Ruleset

    Hi everybody

    I'm using the 3.5E (latest version) rule set for a custom ruleset and I need to send custom data when the player rolls a die.
    In the "buildThrow (...)" function, I think it's a good place to insert custom data. But after, in the function "onDiceLanded (draginfo)", no way to find them!


    In the function "buildThrow (...)", I add my data in the following way (in 2 different places!?):
    Code:
    	local rThrow = {};	
    	rThrow.type = rRoll.sType;
    	rThrow.description = rRoll.sDesc;
    	rThrow.secret = rRoll.bSecret;
    	rThrow.customData = rRoll.aCustomData;
    
    	...
    	
    	local rSlot = {};
    	rSlot.number = rRoll.nMod;
    	rSlot.dice = rRoll.aDice;	
    	rSlot.metadata = rRoll;
    	rSlot.customData = rRoll.aCustomData;
    	rThrow.slots = { rSlot };
    		
    	return rThrow;
    After that, in the "onDiceLanded (draginfo)" function, I can not find my information :
    Code:
    function onDiceLanded(draginfo)
    
    	local sDragType = draginfo.getType();
    	draginfo.setSlot(1);
    	local vRoll = draginfo.getMetaDataList();	
    	vRoll.sDesc = draginfo.getStringData();	
    	vRoll.aCustomData = draginfo.getCustomData();	
    	Debug.console ("onDiceLanded-decodeActionFromDrag vRoll.sDesc: " .. vRoll.sDesc);                           OK
    	Debug.console ("onDiceLanded-decodeActionFromDrag vRoll.aCustomData: " .. vRoll.aCustomData);     NIL Value !!
    ...
    Any idea ?

  2. #2
    damned's Avatar
    Join Date
    Mar 2011
    Location
    Australia
    Posts
    18,366
    Blog Entries
    1
    I think you will want to append the customdata to the description and then split it back out in onDiceLanded.

    MoreCore - Generic Ruleset
    --- Projects ---
    Extensions | Tutorials | MoreCore | MoreCore Themes | Call of Cthulhu | Maelstrom | FG Con

  3. #3

    Join Date
    Apr 2008
    Location
    Virginia Beach
    Posts
    2,804
    Yep. That is the only way I have found to do it. Maybe we can sweet talk MW into preserving custom data across a roll in FGU

  4. #4
    Grimmbart's Avatar
    Join Date
    Jan 2008
    Location
    Marseille (France 13)
    Posts
    54
    Quote Originally Posted by damned View Post
    I think you will want to append the customdata to the description and then split it back out in onDiceLanded.
    Yes, that's exactly what I would like to do !

    But of course, I can concatenate my info to the description and split the string after. Why not !
    Last edited by Grimmbart; April 10th, 2019 at 09:12.

  5. #5
    damned's Avatar
    Join Date
    Mar 2011
    Location
    Australia
    Posts
    18,366
    Blog Entries
    1
    Quote Originally Posted by Grimmbart View Post
    Yes, that's exactly what I would like to do !

    But of course, I can concatenate my info to the description and split the string after. Why not !
    You are on the right track!

    MoreCore - Generic Ruleset
    --- Projects ---
    Extensions | Tutorials | MoreCore | MoreCore Themes | Call of Cthulhu | Maelstrom | FG Con

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Log in

Log in