5E Product Walkthrough Playlist
Page 1 of 5 123 ... Last
  1. #1

    Need help using images and tokens from a module

    Hello,

    I'm making an extension for FG and I'm having issues using images and tokens in my module. Using image@module isn't working. I've tried using GetModule, getmoduleinfo, get path, get root... I think I'm getting close, but it has eluded me for the last couple weeks. I might just be messing up the syntax... I don't know anymore... It's extremely frustrating!

    I also do not know if I should use a onmodule load trigger, or just be able to use Oninit... Or if I need to identify the addressing in some way...

    I have been working hard to crack this cookie... Any help would be greatly appreciated!

    I'm trying to set an image (for bitmapWidget) or token (setting the prototype())but so far I have to include the file in the extension... And I want to use a token module...

    Thank you all for your time, help and Happy holidays!

    V/r,
    ~Bob

  2. #2
    damned's Avatar
    Join Date
    Mar 2011
    Location
    Australia
    Posts
    26,678
    Blog Entries
    1
    Quote Originally Posted by Diablobob View Post
    Hello,

    I'm making an extension for FG and I'm having issues using images and tokens in my module. Using image@module isn't working. I've tried using GetModule, getmoduleinfo, get path, get root... I think I'm getting close, but it has eluded me for the last couple weeks. I might just be messing up the syntax... I don't know anymore... It's extremely frustrating!

    I also do not know if I should use a onmodule load trigger, or just be able to use Oninit... Or if I need to identify the addressing in some way...

    I have been working hard to crack this cookie... Any help would be greatly appreciated!

    I'm trying to set an image (for bitmapWidget) or token (setting the prototype())but so far I have to include the file in the extension... And I want to use a token module...

    Thank you all for your time, help and Happy holidays!

    V/r,
    ~Bob
    welcome Diablobob
    I think because of load orders that things like widgets need to be in the ruleset or at the very least an extension.
    I think modules are loaded too late for use in most ofthese graphical elements.

  3. #3
    Quote Originally Posted by damned View Post
    welcome Diablobob
    I think because of load orders that things like widgets need to be in the ruleset or at the very least an extension.
    I think modules are loaded too late for use in most ofthese graphical elements.

    It's in an extension... I'm trying to access the images and tokens, in a module, from the extensions...

  4. #4
    So using an onmoduleload is probably my best bet... But still having pathing issues...

  5. #5
    damned's Avatar
    Join Date
    Mar 2011
    Location
    Australia
    Posts
    26,678
    Blog Entries
    1
    Quote Originally Posted by Diablobob View Post
    So using an onmoduleload is probably my best bet... But still having pathing issues...
    I could be wrong but modules load too late for what you are trying to do.
    It needs to be in the extension.

  6. #6
    I don't see why it would necessarily need to be "in" the ext...

    To my knowledge the load hierarchy is:
    FG
    Rulesets
    Extensions
    Modules

    If the sole problem was the load order, then rulesets would not be able to access modules... And the function I'm looking for is basically the same as the letters module usage by extensions and rulesets... Just instead of letters.mod, I want to use my module...

    Automatic Letters was even incorporated into coreRPG by moonwizard after Ikael made a module to do such, for the SW ruleset... Obviously it was changed for the ruleset... But, my question is how do I do it?...

    In the ruleset moonwizard made the addressing as token@module... I just need to know how to setup that same type of addressing for my extension...
    Last edited by Diablobob; December 25th, 2018 at 00:20.

  7. #7
    Also before it was added to corRpg, trenlo adjusted the extension code to be used in 5e... And it worked... I'm just trying to figure out that ability

  8. #8
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,404
    Quote Originally Posted by Diablobob View Post
    I'm trying to set an image (for bitmapWidget) or token (setting the prototype())but so far I have to include the file in the extension... And I want to use a token module...
    For tokens you need the full path to the token within the .mod file, plus the @<module name> reference (the <name> field from the module definition.xml file). For example: tokens/tokenname.png@Token Module

    I'm not really sure what you're trying to do and when. If you're trying to access tokens in modules during the initialization of an extension, then that probably won't work - which is what damned was mentioning. If your code is only ran once the campaign is fully loaded, then you should be able to access the token files in a module - assuming you have the path and module name correct.
    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. #9
    Quote Originally Posted by Trenloe View Post
    For tokens you need the full path to the token within the .mod file, plus the @<module name> reference (the <name> field from the module definition.xml file). For example: tokens/tokenname.png@Token Module

    I'm not really sure what you're trying to do and when. If you're trying to access tokens in modules during the initialization of an extension, then that probably won't work - which is what damned was mentioning. If your code is only ran once the campaign is fully loaded, then you should be able to access the token files in a module - assuming you have the path and module name correct.
    Ah! I think that is where I was having an issue... I miss understood the context of damned's message... If you read this damned, I'm sorry if I seamed rude in anyway! I was just trying to figure stuf out...

    Also thank you trenloe, I will try that... I was thinking that was the case, but I think I was placing it in the wrong location...

  10. #10
    I think what my main problem is I was trying to define them in the ext, but was missing adding them to the mod file definitions... I'll let you know when I get to try it out

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
  •  
FG Spreadshirt Swag

Log in

Log in