Author Topic: module location?  (Read 489 times)

jedione

  • Hero Member
  • *****
  • Posts: 699
  • punktoe
    • View Profile
module location?
« on: April 16, 2019, 07:03:14 AM »
any one know ,,is it possible to call modules like "fade" from within a layout

i could of sworn iv seen it before,


 
help a friend....

keilmillerjr

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 951
    • View Profile
Re: module location?
« Reply #1 on: April 16, 2019, 11:16:08 AM »
Code: [Select]
fe.load_module("fade");

jedione

  • Hero Member
  • *****
  • Posts: 699
  • punktoe
    • View Profile
Re: module location?
« Reply #2 on: April 16, 2019, 01:28:41 PM »
na,, sorry i ment,  have the fade module in a file in your layout,  and not in the modules folder.......
help a friend....

keilmillerjr

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 951
    • View Profile

jedione

  • Hero Member
  • *****
  • Posts: 699
  • punktoe
    • View Profile
Re: module location?
« Reply #4 on: April 17, 2019, 07:22:11 AM »
https://github.com/mickelson/attract/blob/master/Layouts.md#do_nut

#### `fe.load_module()` ####
fe.load_module( name )
Loads a module (a "library" Squirrel script).

Parameters:

name - the name of the library module to load. This should correspond to a script file in the "modules" subdirectory of your Attract-Mode configuration (without the file extension). :'(
help a friend....

keilmillerjr

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 951
    • View Profile
Re: module location?
« Reply #5 on: April 17, 2019, 01:46:31 PM »
Im really confused about what you are confused about.

rand0m

  • Sr. Member
  • ****
  • Posts: 218
    • View Profile
Re: module location?
« Reply #6 on: April 17, 2019, 02:33:18 PM »
Im really confused about what you are confused about.

I think Jedione wants the module code as a part of layout.nut (not external) and he is wondering how to call a module (use its function) if its in layout.nut. Script won't help if I am correct in my assumption since they are also external.

rand0m

  • Sr. Member
  • ****
  • Posts: 218
    • View Profile
Re: module location?
« Reply #7 on: April 17, 2019, 02:34:22 PM »
Im really confused about what you are confused about.

I think Jedione wants the module code as a part of layout.nut (not external) and he is wondering how to call a module (use its function) if its coded into layout.nut. Script won't help if I am correct in my assumption since they are also external.

keilmillerjr

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 951
    • View Profile
Re: module location?
« Reply #8 on: April 17, 2019, 02:51:21 PM »
Im really confused about what you are confused about.

I think Jedione wants the module code as a part of layout.nut (not external) and he is wondering how to call a module (use its function) if its in layout.nut. Script won't help if I am correct in my assumption since they are also external.

Not sure why you would want to duplicate code. You could copy and paste it into your layout.nut. Call classes and functions like normal. Official squirrel docs and electric imp is good resource. Keep in mind electric imp implementation has slight differences between official version, so cross reference docs.

dukpoki

  • Sr. Member
  • ****
  • Posts: 135
    • View Profile
Re: module location?
« Reply #9 on: April 17, 2019, 11:38:43 PM »
Code: [Select]
// Modules
fe.do_nut(fe.script_dir + "modules/fade.nut" );

If you have a subfolder "modules" in your layout folder and put the module in question in that subfolder.  Or you can put the modules in the main layout folder and just delete the "modules/" part.

jedione

  • Hero Member
  • *****
  • Posts: 699
  • punktoe
    • View Profile
Re: module location?
« Reply #10 on: April 18, 2019, 06:59:41 AM »
Code: [Select]
// Modules
fe.do_nut(fe.script_dir + "modules/fade.nut" );

If you have a subfolder "modules" in your layout folder and put the module in question in that subfolder.  Or you can put the modules in the main layout folder and just delete the "modules/" part.

ahh yes,, this is what i want!!!  sorry for the confushion.   

and the reason, you ask ...is because some potential themes i have use a modified module
and i only need it for that theme, so it makes sence to me at least to keep it with theme assets..thats all.
help a friend....