5E Character Create Playlist
Page 3 of 4 First 1234 Last
  1. #21
    Thank you, I am trying to understand the documentation, read it all, but Ifeel this is more usable for someone who knows what they are doing. I am a visual learner and hence the documentation without any examples (This is the code, this is what it looks like on the sheet) is sadly not very helpful. Your tips and examples help a lot though!
    Teamwork is essential, it gives them someone else to shoot at.
    Read me: https://chaosmeister.games/

  2. #22
    damned's Avatar
    Join Date
    Mar 2011
    Location
    Australia
    Posts
    26,685
    Blog Entries
    1
    Sadly - I think that that programming for FG - unless you are a programmer - is beyond the abilities of the vast majority of us...

  3. #23
    I actually would not agree with that. It does not seem so complicated, the problem is more the fact that there are no good tutorials and well documented practical exaples for the layman. Reading the documentation is really hard if you have no basics at all. I think this is the weakest point that FG has. it is powerfull and wants to give all this power to the user. However some users may not want that power. I think CoreRPG is a step in the right direction. I wager what most people want is a working and a bit automated character sheet, nothing too fancy. And I think this should be doable without years of programming experience. Because this will make or break the future of FG in my opinion. It is not so much about power, flexibility and features as much as it is about ease of access and usabillity. It can learn a lot from Roll20 and how they are doing things in my opinion. Anway, back on topic:

    I saw that several Character sheets do not actually contain the Skills themselves but have them generated with a script. While I feel comfortable to fiddle around with XML having to use LUA to simply populate a skill list seems overkill to me. Why is it done that way? Seems needlessly complicated for a laymen like me.
    Teamwork is essential, it gives them someone else to shoot at.
    Read me: https://chaosmeister.games/

  4. #24

    Join Date
    Mar 2006
    Location
    Arkansas
    Posts
    7,401
    It's done that way for flexibility - and because it makes it very easy to modify skill lists. Skill lists are often housed ruled. Its easy to write an extension that just changes that one scrip instead of a lot a changes - one for every skill you add or subtract on the character sheet. The fewer things you do in an extension the more likely other extensions will co-exist with it. It also may have originally been done to show off LUA functionality. FG2's major feature add was LUA support.

  5. #25
    OK, so I do not need to do that right? Because editing a LUA script seems a lot harder to me then changing an XML. not that I am successful in any of it yet. FG must have been written for developers, not users. :-/

    I am starting to think that using CoreRPG is a mistake for what I am trying to do. Pretty much most of the functionality I want is within the BRP Ruleset. Sadly that is set up totally different then CoreRPG. *pullshairout* How is anyone understanding this stuff? I was thinking about layering functionality from BRP to CoreRPG but that seems an act of futility again as that seems even more complicated. *sigh* And If I do it for current BRP my stuff wont work if BRP is updated to use CoreRPG setup right? I am close to tears, I tell you. The completed sheets are so full of information I have a hard time seeing anything. for example I want to change the core layout from the one big window to several smaller ones, similar to BRP. I have been staring at the XMLs for 3 hours and I just donīt see how to do it. I can see where the overview frame is defined and I understand that the lower big frame is defined in record_char_main.xml. But... where in record_char.xml is that other XML referenced?! I donīt get how the pages of this thing are set up. I think I understand that it is not as easy as "One file per view" though. Looking at record_char_notes.xml at the moment because that layout is close to what I have in mind for the main page. Is there any searchable FG XML tag reference? For example what is a <label_frametop> ? How does <frame_char > work? I have been looking in the documentation but am unable to find stuff this anywhere. I have trouble understanding how the size of a frame is defined if only the bounds tag is there. I know there are height and width tags but it seems they are not used anywhere.
    Teamwork is essential, it gives them someone else to shoot at.
    Read me: https://chaosmeister.games/

  6. #26
    You should get your hands on a good text editor with XML folding/collapsing as well as multi-file search. It does wonders with helping you find where things are defined. I have used NotePad++ for a while, and it's free.

    Both "label_frametop" and "frame_char" are templates. Templates are used to abstract and re-use controls that are used over and over again. By doing a multi-file search, I found "frame_char" defined in campaign\template_char.xml and "label_frametop" defined in common\template_common.xml.
    https://www.fantasygrounds.com/modguide/templates.xcp

    If there is an unknown tag within a windowclass.sheetdata tag, then it must be a template. Try multi-file search for <template name="tagname">.
    If there is an unknown tag within a control object, then it is a custom XML tag used by the scripts attached to that control.
    https://www.fantasygrounds.com/refdoc/

    The bounds tag is an absolute layout of a control within the window coordinate system in which it is defined. The comma-separated numbers in the bounds tag correspond to X,Y,W,H (when positive) where X,Y is the position of the top-left corner of the control relative to the top-left corner of the window and W,H are the desired width and height of the control. When negative, the X,Y positions are offsets from the bottom and right edges of the window for the top-left corner of the control, and the W,H become offsets from the bottom and right edges of the window for the bottom-right corner of the control. The negative values are useful to specify relative positioning within a window.
    https://www.fantasygrounds.com/refdoc/windowcontrol.xcp

    Example 1: <bounds>10,5,20,50</bounds>
    This means that the control will be located at X,Y coordinates 10,5 within the window where the top left of the window is 0,0.
    The remaining two numbers indicate width 20 and the height 50.
    Example 2: <bounds>-20,-20,10,10</bounds>
    This means that the top-left corner of the control will be located at X,Y coordinates which are 20 pixels each from the bottom right corner of the window
    The remaining two numbers indicate width 10 and the height 10.
    Example 3: <bounds>0,0,-1,-1</bounds>
    The 0,0 means that the top-left corner of the control is located at the top-left corner of the window (i.e. 0,0 in window coordinates).
    The following -1,-1 means that the bottom-right corner of the control is located 1 pixel each from the bottom right corner of the window.

    Regards,
    JPG

  7. #27
    Thanks Moon Wizard. I am using Note++ since my manual HTML days, so I am covered there. It does help see relations and wich brackets belong together, it already helped me a great deal!

    All right, if I look into the template file I see

    Code:
    <template name="label_frametop">
    		<label>
    			<anchored position="insidetop" offset="0,10" />
    			<center />
    		</label>
    So the tag <label_frametop> just means it is always anchored inside top and offset 0,10? But what does "label" do?

    Label again is also defined

    Code:
    <template name="label">
    		<stringcontrol>
    			<anchored height="20" />
    			<font>sheetlabel</font>
    			<nodrag />
    			<readonly />
    		</stringcontrol>
    	</template>
    I think that tells FG that If I tag something with Label it will be anchored to a height of 20, use the sheetlabel font, is not draggable and read only. If I understand this correctly label_frametop will also inherit the tags from the underlying label definition?

    I finally grasped that there is no such thing as a html tag in XML, I can write whatever I want, however how it is used and displayed depends on what the programmer has told FG to with the tag. Hence by using templates I can define my own tags. That is really impressive and powerful. By drilling down I should end up with something that is in the reference document. Fine so far, still would love a full tag library of at least the standard defined ones ;-)

    And a minor success: It took me three days, but I finally got the abilities where they should be. Well. Almost Need to amend the custom strings and fiddle with the offset so they are centered and evenly spaced. And I could use some code pointers. This is really rough and basic and probably much more convoluted as it needs to be. i tried collapsing the basicnumber tag in the way the label is collapsed, but I do not know how to properly annotate the width and height of the numberfield. I may also have done the visible box thing in a cumbersome way, it is copy pasted from the template file as I was unable to find the correct template to use for an editable number field with frame :-/ Also I want to use these scores later in auto-calculations for skill values, do I need to do set it up differently? I think I need to write them into a database node, but not sure. Thank you all for your patience! I learned a lot already, can only get better from here ;-)

    Code:
    <!--Ability scores -->
    			<label name="strength_label">
    				<anchored to="abilityframe" position="insidetopleft" offset="15,12" />
    				<static textres="char_label_str" />
    			</label>
    
    			<basicnumber name="str_score">
    				<anchored>
    					<to>strength_label</to>
    					<position>right</position>
    					<offset>10,0</offset>
    						<size>
    							<width>20</width>
    							<height>20</height>
    						</size>
    				</anchored>
    				<font>sheettext</font>
    				<stateframe>
    					<keyedit name="fieldfocus" offset="5,5,5,5" />
    					<hover name="fieldfocus" offset="5,5,5,5" />
    					<drophilight name="fieldfocus" offset="5,5,5,5" />
    				</stateframe>
    			</basicnumber>
    			
    			<label name="dexterity_label">
    				<anchored to="str_score" position="right" offset="10,0" />
    				<static textres="char_label_dex" />
    			</label>
    							
    			<basicnumber name="dex_score">
    				<anchored>
    					<to>dexterity_label</to>
    					<position>right</position>
    					<offset>10,0</offset>
    						<size>
    							<width>20</width>
    							<height>20</height>
    						</size>
    				</anchored>
    				<font>sheettext</font>
    				<stateframe>
    					<keyedit name="fieldfocus" offset="5,5,5,5" />
    					<hover name="fieldfocus" offset="5,5,5,5" />
    					<drophilight name="fieldfocus" offset="5,5,5,5" />
    				</stateframe>
    			</basicnumber>
    			
    			<label name="logic_label">
    				<anchored to="dex_score" position="right" offset="10,0" />
    				<static textres="char_label_log" />
    			</label>
    							
    			<basicnumber name="log_score">
    				<anchored>
    					<to>logic_label</to>
    					<position>right</position>
    					<offset>10,0</offset>
    						<size>
    							<width>20</width>
    							<height>20</height>
    						</size>
    				</anchored>
    				<font>sheettext</font>
    				<stateframe>
    					<keyedit name="fieldfocus" offset="5,5,5,5" />
    					<hover name="fieldfocus" offset="5,5,5,5" />
    					<drophilight name="fieldfocus" offset="5,5,5,5" />
    				</stateframe>
    			</basicnumber>
    			
    			<label name="wil_label">
    				<anchored to="log_score" position="right" offset="10,0" />
    				<static textres="char_label_wil" />
    			</label>
    							
    			<basicnumber name="wil_score">
    				<anchored>
    					<to>wil_label</to>
    					<position>right</position>
    					<offset>10,0</offset>
    						<size>
    							<width>20</width>
    							<height>20</height>
    						</size>
    				</anchored>
    				<font>sheettext</font>
    				<stateframe>
    					<keyedit name="fieldfocus" offset="5,5,5,5" />
    					<hover name="fieldfocus" offset="5,5,5,5" />
    					<drophilight name="fieldfocus" offset="5,5,5,5" />
    				</stateframe>
    			</basicnumber>
    Teamwork is essential, it gives them someone else to shoot at.
    Read me: https://chaosmeister.games/

  8. #28
    And already another question.. I cant seem to change the width of all the labels. The width tag does nothing since I put them above each other. I get why it wont work for the lower ones, they should take info from the parent. But if I amend the width for STR or BP it should change the width of those. But it doesnīt. I read through the documentation several times, I canīt see why this should not work.
    Teamwork is essential, it gives them someone else to shoot at.
    Read me: https://chaosmeister.games/

  9. #29
    Exactly right on the XML and very close on the templates.

    The tags from templates are merged until there are no templates remaining. So, using the template code you posted and applying it to my previous post, you should be able to see how tags are merged together to form the final XML used to build the control. (for the "label_frametop" example above)

    The basicnumber template ends up distilling (after template merges) into a numberfield object (which is a base FG object), which automatically creates a database value to hold the number within the data space of the window containing it (in this case, the PC). The "basicnumber" template is essentially a number field that saves a copy to the database, displays the number in the default black number font, draws a frame around the number, and supports hover and drop frames too. It is exactly the template you want to use for an editable number field that will be stored in the character record.

    You asked about what tags FG supports. Remember, every valid FG XML tag is tracked in the ruleset reference document.
    https://www.fantasygrounds.com/refdoc/

    For the last question about the widths; when you use the "below" position tag, the remaining labels inherit the left and right anchors of the parent tag (thus defining the width). If the left and right anchors are both defined, then the width tag is ignored. Basically, width is defined twice, and the anchors win the tie. Try using the "belowleft" position tag and removing the width from your labels. This means that the tags will become as wide as necessary to fit the label text.

    Regards,
    JPG

  10. #30
    Thank you again, I will experiment with the belowleft tag.
    Teamwork is essential, it gives them someone else to shoot at.
    Read me: https://chaosmeister.games/

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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