DICE PACKS BUNDLE
Page 4 of 4 First ... 234
  1. #31
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,411
    You need to give us a more information - like some code you're actually using - maybe a skeleton extension or something we can play with to get it working. At the moment you're drip feeding us information and it's impossible for us to give true guidance.
    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!

  2. #32
    The code I'm using looks nearly identical to the reference manual code Moon pointed to earlier in this thread. It would be very difficult to make a skeleton extension, but possible. But here is the code that it used here; not much to really look at.
    Code:
    function embedImage(dropNode)
    	local win = createWindowWithClass("imageryTest", "id-00002");
    	local ctrl = win.createControl("imagery", "image");
    	local w, h = ctrl.getImageSize();
    	Debug.console("getDatabaseNode()");
    	Debug.console(getDatabaseNode());
    	Debug.console("win.getDatabaseNode()");
    	Debug.console(win.getDatabaseNode());
    	Debug.console("win.children");
    	Debug.console(DB.getChildren(win.getDatabaseNode(), ""));
    	Debug.console("ctrl");
    	Debug.console(ctrl);
    	Debug.console("starting w");
    	Debug.console(w);
    	Debug.console("starting h");
    	Debug.console(h);
    end
    The 'imagery' template is a clone of the reference manual image template:
    Code:
    	<template name="imagery">
    		<imagecontrol>
    			<anchored position="insidetopleft" />
    			<indicators availability="blank" locked="blank" loading="blank" zoom="blank" shortcuts="blank" />
    			<invisible />
    			<disabled />
    		</imagecontrol>
    	</template>
    Last edited by Nickademus; April 28th, 2017 at 09:35.
    I never claimed to be sane. Besides, it's more fun this way.

  3. #33
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,411
    Assuming your image is stored in the campaign database at image.id-00002 ? i.e. It is a normal campaign image?

    Then your createWindowWithClass("imageryTest", "id-00002"); needs to refer to image.id-00002, that is: createWindowWithClass("imageryTest", "image.id-00002");

    This is what I was trying to point out before.

    Just using "id-00002" for the image database reference will create a DB node at id-00002 in the XML root, because this is an absolute database node identifier. Check your campaign XML, I bet you'll see a DB node of "id-00002" right off the root.

    I'm guessing you're getting confused between relative and absolute database references? See "Node Identifiers" here: https://www.fantasygrounds.com/modguide/database.xcp
    Last edited by Trenloe; April 28th, 2017 at 14:55.
    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!

  4. #34
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,411
    Or, if you want to use a relative identifier put a period in front: createWindowWithClass("imageryTest", ".id-00002")

    This will reference a db node relative to the <datasource> of the windowlist. For example, if the windowlist has <datasource>image</datasource> then using ".id-00002" (a relative identifier) would reference image.id-00002 as the absolute database identifier (which I believe is what you need).
    Last edited by Trenloe; April 28th, 2017 at 15:04.
    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!

  5. #35
    Quote Originally Posted by Trenloe View Post
    Assuming your image is stored in the campaign database at image.id-00002 ? i.e. It is a normal campaign image?
    Yes it is.
    Quote Originally Posted by Trenloe View Post
    Then your createWindowWithClass("imageryTest", "id-00002"); needs to refer to image.id-00002, that is: createWindowWithClass("imageryTest", "image.id-00002");

    This is what I was trying to point out before.

    Just using "id-00002" for the image database reference will create a DB node at id-00002 in the XML root, because this is an absolute database node identifier. Check your campaign XML, I bet you'll see a DB node of "id-00002" right off the root.
    This is interesting. It's not how the wiki describes the behavior of the <datasource> of a window. According to it the datasource of a windowlist or subwindow is automatically relative.
    A database identifier forming the base from which the actual data source is derived. For top level windows the identifier is relative to the root node of the database, for subwindows and windowlists it is relative to the containing control.
    Quote Originally Posted by Trenloe View Post
    Or, if you want to use a relative identifier put a period in front: createWindowWithClass("imageryTest", ".id-00002")

    This will reference a db node relative to the <datasource> of the windowlist. For example, if the windowlist has <datasource>image</datasource> then using ".id-00002" (a relative identifier) would reference image.id-00002 as the absolute database identifier (which I believe is what you need).
    I'll try this.

    EDIT: Yeah, it seems to be getting to the image now. It would seem I was misled by the description of the <datasource>...
    Last edited by Nickademus; April 28th, 2017 at 22:20.
    I never claimed to be sane. Besides, it's more fun this way.

  6. #36
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,411
    Quote Originally Posted by Nickademus View Post
    Yes it is.This is interesting. It's not how the wiki describes the behavior of the <datasource> of a window. According to it the datasource of a windowlist or subwindow is automatically relative.
    Controls are relative to the window they are in, that's what this is referring to.

    LUA coding is usually different.

    Your debug commands you listed a few posts back were eluding to this.
    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!

  7. #37
    Yeah, sometimes it feels like I'm grasping at straws using the wiki.
    I never claimed to be sane. Besides, it's more fun this way.

  8. #38
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,411
    The command you used is here: https://www.fantasygrounds.com/refdo...indowWithClass It specifies "The data node identifier path..." - these are documented under "node identifiers" here: https://www.fantasygrounds.com/modguide/database.xcp Your debug statements were pretty much telling you that you weren't accessing the right nodes and going to a root of "id-0002" rather than "image.id-00002", as I eluded to also. Believe what they were telling you, rather than second guessing!
    Last edited by Trenloe; April 29th, 2017 at 00:45.
    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!

  9. #39
    Quote Originally Posted by Trenloe View Post
    Then your createWindowWithClass("imageryTest", "id-00002"); needs to refer to image.id-00002, that is: createWindowWithClass("imageryTest", "image.id-00002");
    Changed to this and it works fine. The image is showing up where and I it's supposed to. Switch over to the local client and the same lua file code throws a console error:
    createWindowWithClass: Unable to create target named node
    Is there some aspect of a windowlist that doesn't allow players to do things? I didn't see any such note in the windowlist description. Too tired to fool with it more tonight...
    I never claimed to be sane. Besides, it's more fun this way.

  10. #40
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,411
    Quote Originally Posted by Nickademus View Post
    Is there some aspect of a windowlist that doesn't allow players to do things?
    More than likely the image hasn't been shared with the player, so it can't be accessed. Either share the image or make it public using code on the GM side: https://www.fantasygrounds.com/refdo....xcp#setPublic
    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!

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
  •  
5E Character Create Playlist

Log in

Log in