TheGameCreators / GameGuruRepo

The GameGuru Repository For Community Collaboration
http://www.game-guru.com
137 stars 56 forks source link

Text files not included in standalone #5047

Open AvengingEagle opened 9 months ago

AvengingEagle commented 9 months ago

Lots of CineGuru MAX's best features rely on instructions written out in .txt files. These can be used to control actors, display subtitles on screen, and create scrolling credits. We have added a dynamic lua field to allow the user to select these text files.

Screenshot 2023-11-02 213928

Issue 1: These text files are not being included in standalone builds and, currently, must be transferred into the standalone's file structure manually, meaning they aren't encrypted.

Issue 2: The scripts looking for these files currently throw an error message on everybody else's machine but the PC that built the standalone because GameGuru MAX is looking for the files using the filepath in its entirety (e.g. C:\users\Scott\My Documents\GameGuru Apps\GameGuru MAX\Files\scriptbank\CineGuru MAX\actions.txt) instead of simple looking for the relative location of the files within the standalone's "Files" folder (e.g. Files\scriptbank\CineGuru MAX\actions.txt). This is particularly strange because other types of files like images and audio seem to be correctly referenced the latter way.

AvengingEagle commented 9 months ago

I've just learned encryption on text files that need to be read by lua scripts is not possible (not without you guys exposing your decryption key in lua, thereby compromising all other encrypted files), so you don't need to worry about that one. But issue 2 still stands.

LeeBamberTGC commented 9 months ago

@AvengingEagle Email me the CG ACTOR script along with a sample text file and I will sort, thanks!

AmenMoses commented 9 months ago
-- *** GG MAX part, does nothing in GG classic *** --
-- DESCRIPTION: Cine Guru Actor script. 
-- DESCRIPTION: [TextFile$=""]
-- DESCRIPTION: Speech file (.wav) for lip-sync [SPEECH0$=""]
-- DESCRIPTION: Speech file (.wav) for lip-sync [SPEECH1$=""]
-- DESCRIPTION: Speech file (.wav) for lip-sync [SPEECH2$=""]
-- DESCRIPTION: Speech file (.wav) for lip-sync [SPEECH3$=""]

function cg_actor_properties( e, script )
    local actor = actors[ e ]
    if actor == nil then return end
    actor.script = script
end                

The string passed into cg_actor_properties contains the whole path of the file, should just be the relative path.

As to how the auto copying to standalone should be accomplished I'm not sure how you would do that, how does it work for the audio files?

LeeBamberTGC commented 9 months ago

@AmenMoses In the next EXP build I now convert the file to relative as its specified in the behaviour, and also converts abs to relative for any files strings that make it to the standalone export process :)