Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

script_load - automate saving to sdcard / bundling .gbc into Online Resource #286

Closed
Scachi opened this issue Dec 19, 2018 · 6 comments
Closed

Comments

@Scachi
Copy link

Scachi commented Dec 19, 2018

As mentioned there https://www.consoletuner.com/forum/viewtopic.php?f=26&t=11152&p=76620&hilit=script_load#p76620
it is not possible to automatically install .gbc files used/required by .gpc or .gbc script automatically onto the sd-card.

The script_load function has a lot of potential. Think of the "Street Figher V" trials script in the Online Resource.
With script_load it would be possible to do a "character" selection system utilizing the T2 segment display in the main system to select the actual gbc file to load. Allowing to merge all the downloads into a single script using a single slot of the T2 only.

I could move my extensive anti recoil adjustment code into an extra .gbc script to gain space to put more gameplay specific functions into the main gaming script.
As I would like to keep my main script available as source (.gpc) and loading from it a .gbc file this has to be possible too to include a .gbc file in a .gpc download script.

Without the possibility to automate the process of putting required gbc script into the same download/bundle them and get them installed onto the sd-card the cool script_load function wouldn't be used much..
As a user I would download a less feature rich script that doesn't require me to remove my sd card, access it externally via a reader to be able to put the additional files onto the sd-card.

This is somehow a bit related to this feature request #276
to link to optional related script like input translator files or "data package" scripts like weapon specific anti recoil presets, or the anti recoil adjustment when I don't want to include it by default or something like that.

@Scachi
Copy link
Author

Scachi commented Dec 19, 2018

Thinking about this more it may be required to change the sd-card storage structure.
Like separate directories for the different slots and their content including their macro files.

Is it possible to include macro files into scripts (gbc and gpc) in the Online Resource ? How is this handled with multiple scripts that may use the same macro name, but for different content .. file name collision ?

@Scachi
Copy link
Author

Scachi commented Apr 26, 2019

For a fast workaround, until this gets built in full automatic, to easily put .gbc files onto the sd-card without having to remove the sd-card:

Can you allow the "Macro Explorer (Micro SD)" dialog to also allow drag & drop and deletion of non default slot .gbc files please ? (you may want to filter filenames to avoid a "slot file name" collision.

...wasn't the macro explorer on earlier versions of GTuner IV able to read them from the sd-card via the macro explorer too to save them locally/for direct test and debug runs via dbl-click onto the file shown in the macro explorer ?
I think I have used this once when I create my macrorecplay script...maybe my memory's is playing tricks.

@J2Kbr
Copy link
Owner

J2Kbr commented Apr 21, 2020

Command to copy a script bytecode to the Micro-SD was added to Gtuner IV 1.08 (to be released soon).

The copy command is located on menu Install To -> Micro-SD Card.

Before start the copy procedure, the filename is validated (must have 8 or less characters). A dialog-box opens if is needed edit/adjust the filename that will be used to store the bytecode in the sd card.

image

The bytecode can then be loaded by the running script using script_load():

https://www.consoletuner.com/wiki/index.php?id=t2:script_load

@J2Kbr J2Kbr closed this as completed Apr 21, 2020
@Scachi
Copy link
Author

Scachi commented Apr 22, 2020

What about the second part of this issue ?
Bundling multiple .gbc files into a single download and automatic copy to sd on install when sd-card is present?
A script might not be useful at all when it requires the other .gbc files to work correctly.
And it is hard to tell the user to download 6 script manually and copy them all over fir the new copy feature when we can't link them directly in the online resource.

With this also solved we can take full advantage of this cool stuff then.

@J2Kbr
Copy link
Owner

J2Kbr commented Apr 23, 2020

Today the second part was implemented (Gtuner IV 1.08B rev 1).

All bytecode files referred by script_load() are now included when publishing a work.

If the user drag-and-drop the work from Online Resources to a memory slot, the additional bytecode files are stored in the Micro-SD Card automatically.

If the user choose to download the work to local disk, then each bytecode file must be loaded to the Micro-SD Card manually.

For publishing, each additional bytecode must be first generated via menu Compiler -> Build Bytecode...

@Scachi
Copy link
Author

Scachi commented Apr 24, 2020

That sounds perfect. Thank you very much for your hard work !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants