STAR TREK 2d20
  1. #1

    ct_host.xml/sub window issue

    This might be a silly question, it's about xml and positioning... one of my banes but I'm hoping someone might see the error in what I'm trying to do... and if it's even possible (I suspect it is, I just got the thing in the wrong space more than likely).

    I am attempting to use the charsheet_actions window within the combat tracker. I have weaponlist and powers datasource on NPCs.

    The code I used in ct_host.xml is this. (I've attached the ct_host.xml).
    Code:
                <!-- display actions with weapons/powers in one window  --celestian -->
                <subwindow name="actions">
                    <anchored>
                        <top parent="name" anchor="bottom" relation="relative" offset="3" />
                        <left parent="activeicon" anchor="right" offset="75" />
                        <right offset="-17" />
                        <sizelimits><minimum height="24" /></sizelimits>
                    </anchored>
                    <class>charsheet_actions</class>
                </subwindow>
    What I "think" that should do is put a subwindow within the window so that you can see the "Actions" tab like pcs do on their character sheets (except I've added the same thing to npcs so they should see it also).

    I've verified that the lua code that hides/makes things visible is setting "actions" to visible.

    Here is the image of what the CT looks like for a NPC, the box/arrow points where it "should" show up. The only thing that is getting there is the minimum height of 24.



    Here is the debug I used to verify that the datasources lined up.
    Code:
    Runtime Notice: s'power_list.lua' | s'onInit' | s'node' | databasenode = { combattracker.list.id-00002.powers }
    Runtime Notice: s'power_list.lua' | s'onInit' | s'nodeWindow' | databasenode = { combattracker.list.id-00002 }
    Runtime Notice: s'char_weaponlist.lua' | s'onInit' | s'node' | databasenode = { combattracker.list.id-00002.weaponlist }
    Runtime Notice: s'char_weaponlist.lua' | s'onInit' | s'nodeWindow' | databasenode = { combattracker.list.id-00002 }
    This is the normal one for PCs.

    Code:
    Runtime Notice: s'char_weaponlist.lua' | s'onInit' | s'node' | databasenode = { charsheet.id-00001.weaponlist }
    Runtime Notice: s'char_weaponlist.lua' | s'onInit' | s'nodeWindow' | databasenode = { charsheet.id-00001 }
    Runtime Notice: s'power_list.lua' | s'onInit' | s'node' | databasenode = { charsheet.id-00001.powers }
    Runtime Notice: s'power_list.lua' | s'onInit' | s'nodeWindow' | databasenode = { charsheet.id-00001 }
    I've also added debug code to verify that FG is seeing the weaponlist/powers on the npcs (the count of each weapon and power lines up properly).

    I think the problem is I am just not doing something simple. Am I doing something to cause it to be a tiny square or behind a window or something? I really just have this inability to deal with xml/positioning well.

    I'll keep poking at it but if you have any suggestions/theories please let me know.

  2. #2
    Subwindow controls are unique in that they are invisible by default, and you need to specify the "activate" tag to make them visible.

    Also, the actual subwindow inside the control will not be instantiated until it is actually drawn, but you can override that by forcing the subwindow to be created on parent window initialization using the "fastinit" tag.

    The reason why I didn't use any subwindow controls within the current CT implementations is that they are harder to position and use due to their more dynamic nature.

    Regards,
    JPG

  3. #3
    Quote Originally Posted by Moon Wizard View Post
    Subwindow controls are unique in that they are invisible by default, and you need to specify the "activate" tag to make them visible.

    Also, the actual subwindow inside the control will not be instantiated until it is actually drawn, but you can override that by forcing the subwindow to be created on parent window initialization using the "fastinit" tag.
    Ah, ok so I've added <activate /> in the subwindow section and it did not change the result. I did also try the fastinit as well and it does force it to run the subwindow bits when CT is launched (I see the debug code I added to tell me what should be displayed) but it still is not showing the subwindow ;(

    Quote Originally Posted by Moon Wizard View Post
    The reason why I didn't use any subwindow controls within the current CT implementations is that they are harder to position and use due to their more dynamic nature.
    That makes sense. I'm hoping I can make it work so that the same code for the drag/drop and actions tab that works on pcs also works on npcs (do this already now) and those actions/powers show up in the combat tracker. I might have to trim up things to make it better or fall back to the text mode but have to see how it turns out.

    Thanks for the tips, I'll keep trying various things to see if I can't get it to display.

  4. #4
    So to add an addendum to the above post. I had made some tweaks as suggested and the window does actually extend like the subwindow is there but you can't see it. Even more strange is I can drag/drop a spell or weapon to it and the scroll window gets longer. I confirmed that the db.xml file shows that the spells are added to the entry in the combat tracker when I do it also...

    It's just not visible. /boggle


  5. #5
    Doing some work on this last night and I managed to start getting it working. Not to complete but a good start.

    There was/is something hanging it up when I use "charsheet_actions". I've not figured it out yet but will do some serious debugging later tonight to figure out why. When I use "charsheet_actions_contents" it works (as seen below).


  6. #6
    Now comes the question as to whether it is more useful to have a simple CT entry with a link to the full sheet, or trying to cram all the abilities into the available space. This is one of the reasons why PCs don't have their attacks on the main CT in the rulesets I built. It takes too much room, and can be reached using two clicks.

    Glad you got the subwindow display working.

    Cheers,
    JPG

  7. #7
    Quote Originally Posted by Moon Wizard View Post
    Now comes the question as to whether it is more useful to have a simple CT entry with a link to the full sheet, or trying to cram all the abilities into the available space. This is one of the reasons why PCs don't have their attacks on the main CT in the rulesets I built. It takes too much room, and can be reached using two clicks.
    Indeed. My plan now is to trim up the view to be more compact and see how it looks. The main reason I wanted to do this is because the drag/drop feature and the management for spells/weapons are much easier to use (for me) than the text parsing for NPCs. Mostly because the items I use are not all formatted the same and we'll have to create the entries anyway so might as well use the tool that allows you to do it. 5e has the option of similarly formatted creature/spell text.

    I suspect it will never be as compact as the clickable text in the CT that the 5e ruleset uses but I am hopeful the ease of use will make up for it. I'll just get into the habit of click the sword on/off for each npc type.

    Quote Originally Posted by Moon Wizard View Post
    Glad you got the subwindow display working.

    Cheers,
    JPG
    Thanks, it did turn out to be a xml/location/layout issue

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
  •  
Starfinder Playlist

Log in

Log in