PDA

View Full Version : CoreRPG Conversion Issues.



Blackfoot
November 7th, 2013, 18:03
I am converting my Champions Extension to work with CoreRPG but I'm running into a few problems.
One of them I keep butting up against is that my text is no longer displaying in a number of situations. I'm pretty sure it's a font issue but I can't seem to find where the font code is being defined now.
For example:

<static textres="char_label_skilltotal" />
This line yields blank text for me. I'm not quite sure how 'textres' works. Can someone explain it?
I can replace this line with
<static>Total</static> and it works just fine.. but I can see that there might be advantages to having the strings all defined in the one place. Where do I tweak my fonts for the associated strings?

Trenloe
November 7th, 2013, 18:10
textres work very similar to the graphics resource entries - the name "char_label_skilltotal" will be referenced in a strings_XXXXXX.xml file somewhere - usually in the \strings directory of the ruleset. It is done this way to allow for language translation.

"Find in files" is the way to go to see where this resource is defined. Although, the fact that it is blank suggests that it is not defined anywhere.

So, create your ruleset specific string_XXXXX.xml file, reference it in your ruleset base.xml (so it loads) and add your new string resource for char_label_skilltotal as:

<string name="char_label_skilltotal">Total</string>

Trenloe
November 7th, 2013, 18:13
Additional: What are you basing your rulset off? In the CoC ruleset (\strings\strings_coc.xml) char_label_skilltotal is defined as:

<string name="char_label_skilltotal">T</string>

Blackfoot
November 7th, 2013, 18:14
Actually.. I think it's a font issue. The font is not defined for the text. The text is defined in the strings.xml file... that part is working in the standard 3.5... the issue is that I'm using 'Comic Book' fonts for my text and so the text here is displaying but doesn't know what font to use.. so it displays as 'blank'.
I'm trying to make as few changes to the structure of the 3.5 and CoreRPG code as possible... so hopefully my extension will be compatible with future updates without a huge amount of tweakage.

Zeus
November 7th, 2013, 18:47
Yup, textres has been introduced to assist with localization support. It works just like font, graphics and icons in so much you define (register) these resources and then reference them in other controls. If your missing text and the ruleset isn't complaining it can't find the textres (check the console), you maybe right in that the control using the textres either has no font defined or the defined font cannot be found. Check graphics/graphics_font.xml for any missing font definitions. If your extension makes use of new fonts, make sure your registering them and have included them in the appropriate path.

Blackfoot
November 7th, 2013, 19:00
That sounds about right... I don't see any definition for 'textres' in any of the fonts files though... not in mine (Champions/graphics/graphics_fonts_hero.xml)... or in CoreRPG/graphics/graphics_fonts.xml.. or in 3.5e/graphics/graphics_fonts.xml... so I'm not sure what the definition is supposed to look like. Obviously I could be missing it in there somewhere... but it isn't jumping out at me.

My fonts are registered and they work when called. My example below displays one of my fonts... wait... is the textres font defined in the 'static' function somewhere?

Moon Wizard
November 7th, 2013, 19:02
One other piece of information on the new string resource capability, a textres attribute or tag will override a value attribute or plain text within the tag.

If you are trying to override a tag (such as static), make sure to use the merge="replace" attribute on that tag, so it completely overrides the underlying tag. By default, tags and attributes are merged.

Regards,
JPG

Blackfoot
November 7th, 2013, 20:23
Could I have neglected to bring a necessary supporting file over?
My fonts seem to work fine when I call them in other ways... but textres doesn't seem to work anywhere in my extension.

Trenloe
November 7th, 2013, 20:54
Could I have neglected to bring a necessary supporting file over?
My fonts seem to work fine when I call them in other ways... but textres doesn't seem to work anywhere in my extension.
You shouldn't really be "bringing stuff over" especially from the CoreRPG, you should be using it *in* the CoreRPG files. Otherwise you are not using the power and future upgradability of the CoreRPG ruleset.

Build on top of, not over the CoreRPG.

Moon Wizard
November 7th, 2013, 21:27
If you can share the ruleset, I can help you figure it out.
JPG

Blackfoot
November 7th, 2013, 22:44
I'm trying to switch from the code being built on top of 3.5 to CoreRPG.. but essentially I needed to port out a lot of 3.5 to replace the features that are not available in the CoreRPG... also a lot of stuff has changed so it was a big mess for a long time... I'm slowly digging my way out of it.

Blackfoot
November 9th, 2013, 20:49
Thanks for you help guys, it was invaluable.
I'm moving forward again.

Blackfoot
November 14th, 2013, 21:34
OK. New Problem.
I can't seem to get my Skill Links working.
When I drag the 'skill' item from the library to a 'Story' entry.. no problem, the link is established.
When I drag the 'skill' item from the library to a 'Skill' box (which seems to display properly) it doesn't establish the link.
What am I missing?
This code is copied directly from the 3.5e record_char_skills.xml and the templates seem to be coming directly from CoreRPG so I'm not sure why it doesn't just 'work'...:

<linkfield name="shortcut">
<anchored width="20" height="20">
<top offset="2" />
<right parent="rightanchor" anchor="left" relation="relative" offset="-2" />
</anchored>
</linkfield>Is there somewhere that you tell the link to accept one type of data and not another?

Moon Wizard
November 14th, 2013, 22:30
As long as the field is not set to read-only and the onDrop function is not overriden, it should work the same. Windowreferencecontrols (i.e. the basic control upon which the linkfield template is built) accept any "shortcut" drops.

The other thing that happens to me a fair amount when another field is not behaving to UI events is that I have defined another control which is actually covering the other field invisibly. (Frames, long fields, etc.) If that's the case, you can adjust the obscuring control or mark it with the disabled tag.

Cheers,
JPG

Blackfoot
November 14th, 2013, 22:49
One thing that does happen with the new 3.5 Skills interface is that all those buttons shift to the left when you turn on 'edit mode', the mode doesn't seem to make any difference to the dropability of the link though, you cannot drop it either way.

I don't think I changed a whole lot from the basic functionality of the 3.5 Skill Tab.. so I'm not sure how I broke it. :(

Moon Wizard
November 15th, 2013, 01:19
Package it up and send me a link ([email protected]). Make sure to include steps on how to see the window on the desktop, and which file in the ruleset to look at.

Thanks,
JPG

Bidmaron
March 15th, 2014, 15:24
textres work very similar to the graphics resource entries - the name "char_label_skilltotal" will be referenced in a strings_XXXXXX.xml file somewhere - usually in the \strings directory of the ruleset. It is done this way to allow for language translation.

"Find in files" is the way to go to see where this resource is defined. Although, the fact that it is blank suggests that it is not defined anywhere.

So, create your ruleset specific string_XXXXX.xml file, reference it in your ruleset base.xml (so it loads) and add your new string resource for char_label_skilltotal as:

<string name="char_label_skilltotal">Total</string>
This needs to get added to JPG's 'how to update rulesets with resources' Wiki info.

Bidmaron
March 15th, 2014, 15:26
One other piece of information on the new string resource capability, a textres attribute or tag will override a value attribute or plain text within the tag.

If you are trying to override a tag (such as static), make sure to use the merge="replace" attribute on that tag, so it completely overrides the underlying tag. By default, tags and attributes are merged.

Regards,
JPG

This needs to get added to JPG's 'how to update rulesets with resources' Wiki info.