R.e.a.l. External Resource Extraction (ver 5.1b)
#41
Posted 17 June 2007 - 06:17 PM
First of all you shouldn't even try to run it. There are no rooms. The core just contains the scripts and objects that are needed for this to run. What you do is merge your game with the Core game maker file under file->merge game.
If you want to try running this, then I guess you can merge it with the Real Loading 4 example and delete the old scripts.
#42
Posted 05 August 2007 - 03:06 AM
#43
Posted 06 August 2007 - 08:01 AM
#44
Posted 08 August 2007 - 12:56 PM
I would really need thos right now.
Or then I'll ask it right away.
Was there a way to free memory from loaded stuff in middle of the game?
#45
Posted 28 August 2007 - 04:52 PM
Ok, so let me get this straight. You have a LevelLoader object that is persistent? And then you can call a script and it will read the sprite right from the 7z file?
So say i had my 7z set up like this:
Root
-\Images
-----\Something.png
\Sounds
-----\Something.mp3
How would i read these files. Im sorry but the README isnt very clear.
Edit:
When i run that init script, my game shuts down...
Edited by Revel, 28 August 2007 - 05:13 PM.
#46
Posted 28 August 2007 - 05:19 PM
ERROR in
action number 1
of Create Event
for object object837:
In script REAL_sprite:
Error in code at line 18:
LevelLoader.filetype[LevelLoader.arraycounter] = "sprite" // filetype to load -- what to do with file (sprite/background/sound/movie/include) (string)
at position 35: Unknown variable arraycounter
#47
Posted 28 August 2007 - 08:45 PM
So say i had my 7z set up like this:
Root
-\Images
-----\Something.png
\Sounds
-----\Something.mp3
How would i read these files. Im sorry but the README isnt very clear.
Edit:
When i run that init script, my game shuts down...
You really cant load files in folders in 7z compressed file. Everything has to be in Root. As long as I know you can't.
ERROR in
action number 1
of Create Event
for object object837:
In script REAL_sprite:
Error in code at line 18:
LevelLoader.filetype[LevelLoader.arraycounter] = "sprite" // filetype to load -- what to do with file (sprite/background/sound/movie/include) (string)
at position 35: Unknown variable arraycounter
well you really should not to edit those REAL_sprite, /_background etc scripts unless you are very aware what you are editing.
#48
Posted 29 August 2007 - 05:05 PM
#49
Posted 31 August 2007 - 02:40 AM
Anyway, the manual is in the readme folder that comes with the older versions. My newer version only has additional code and doesn't come with all the required files.
I think you can load files when everythting is in folders but to keep things simple I just keep everything jumbled together. It helps to have prefixes in front of the filenames to tell the different resources apart just like you would in GM so no conflicts between names occur.
To free memory from stuff in the game you simply use GM's functions like sprite_delete for sprites or whatever...
OK here's a little help on how I use REAL. It works very nicely for me. I might upload an example later, but here it is described in words.
So first I create a room called something like roLoadRoom. I also have a room called roPostLoadRoom.
For loading I have scripts for every time you need to load a set of resources. Like for the menus I have scLoadMenu, scLoadMenu_, and scUnloadMenu.
scLoadMenu is the initial script for all the loading and runs in the room roLoadRoom. scLoadMenu_ is the script that runs afterwards and is executed in roPostLoadRoom. scUnloadMenu can be executed any time you need to unload the set of resoruces.
So here is how I start the process.
room_set_code(roLoadRoom,"scLoadMenu();"); room_set_code(roPostLoadRoom,"scLoadMenu_(); room_goto(global.nextRoom);"); room_goto_(roLoadRoom);
I have it set the room creation codes to run the scripts upon creation. Then I have it go to the load room.
Here's an example of what would go in scLoadMenu();
global.nextRoom = roMenu;
//loads menu resources
REAL_init("Resources.7z","password goes here",0,0,true,"Menu Resources",roPostLoadingRoom);
/////////////////////////
//sprites
//------wall sprites----------//
//square
if(not variable_global_exists("spWall")) global.spWall = REAL_sprite(0,"spWall.gif",-1,false,false,false,true,0,0);
//diagonal
if(not variable_global_exists("spWallDUT")) global.spWallDUT = REAL_sprite(0,"spWallDUT.gif",-1,true,true,false,true,0,0);
/////////////////////////
//backgrounds
//------tilesets----------//
if(not variable_global_exists("baT_Doom")) global.baT_Doom = REAL_background(0,"baT_Doom.bmp",true,false,true);
/////////////////////////
//sound effects
//------items-------//
global.soItmWeaponPickup = REAL_include("soItmWeaponPickup.wav",temp_directory);
//////////////////////////
//music
global.soMusHangar = REAL_include("soMusHangar.mid",temp_directory);
//////////////////////////
//level file
global.Demo = REAL_include("Demo.d2m",temp_directory);
REAL_execute();In the beginning I call that REAL_init script. "Menu Resources" is the message that shows up on the loading bar during REAL's loading bar drawing. Then I call all the REAL load scripts. Notice how I check if the global variable exists already or not. That way it won't load it if it's already loaded or else you'd be getting memory leaks since things like sprites are still in memory even when you overwrite the variable that references them. This is why it's important to always remove resources from memory when U no longer need them.
This is the code that would go into scLoadMenu_(); It executes all the needed stuff afterwards like REAL_return. It's not needed for things like sprites and backgrounds since REAL loads those into the game straight away after the first script.
//////////////////////////////////// //sounds //------items-------// global.soItmWeaponPickup = REAL_return(global.soItmWeaponPickup); global.soItmWeaponPickup = scSXMSsoundAdd(global.soItmWeaponPickup,sxms.FMOD_DEFAULT,fal se); ////////////////////////// //music global.soMusHangar = REAL_return(global.soMusHangar); global.soMusHangar = scSXMSsoundAdd(global.soMusHangar,sxms.FMOD_DEFAULT|sxms.FMOD _CREATESTREAM|sxms.FMOD_LOOP_NORMAL,false); ////////////////////////// //level file global.Demo = REAL_return(global.Demo);
In this example for the sounds and music I used REAL_include because I use the SXMS sound system instead of loading the sounds into GM. I know REAL had some way to automatically load sounds into SXMS but I didn't bother with that because I was confused enough at the time just as you guys are confused now. And I also don't want to mess with something that works so I'm not using REAL's builtin SXMS loading thing...
Anyway after this script is done, the game will go to the level you specified as global.nextRoom in the first script because the room create event for the post loading room is set to do so.
Hopefully this will help push you guys in the right direction when using REAL.
BTW for those of you who are wondering, I think the way this works is the 7za executable extracts all files which is fairly fast. During this time the game is frozen. Then once it starts to load all the resources that are extracted that's when the game is unfrozen, and the LevelLoader object does its work loading all resources. I think it loads only 1 or a few per step which allows the game to still be playing, or having a loading bar display progress. Afterwards, the post loading actions such as REAL_return happen, which is also relatively fast and the game is frozen during this time until the script is complete.
Edited by Potnop, 31 August 2007 - 02:44 AM.
#50
Posted 31 August 2007 - 09:29 AM
#51
Posted 01 September 2007 - 08:31 AM
#52
Posted 10 September 2007 - 03:24 AM
#53
Posted 13 September 2007 - 11:30 PM
#54
Posted 14 September 2007 - 08:57 AM
any ways heres the code:
REAL_init("mainmenu.7z","TEST",working_directory+'\dll\',-1,true,"",0)
REAL_include("setup.list",working_directory+"\scripts")
REAL_execute()
And this part is in the step event
if global.Loaded=true{execute_file("setup.list")}
All i have in the setup.list file is:
show_message('Test Completed')
Edited by XboxKing, 14 September 2007 - 09:39 AM.
#55
Posted 21 September 2007 - 12:20 AM
Well to have the file be fully loaded you have to do real_return().
So you do something like
global.setup_list = REAL_include(args go in here);
Then in a script that runs after REAL_execute you need to do this or something...
global.setup_list = REAL_return(global.setup_list);
#56
Posted 21 September 2007 - 05:58 PM
Heh, OK... I'll see about those soon. Tomorrow maybe... Right now I'm gonna go to sleep.
Yep... download link to Example projects still doesn't work.
For some sad reason, I get:
Failed to initialize loading engine
error message or
Error defining an external function.
Probably something I didnt setup properly when merging or creating directories?
...
thanks
Smon
#57
Posted 29 September 2007 - 11:27 AM
#58
Posted 08 October 2007 - 11:05 AM
Potnop, can you re-host the files? The links don't work.
So, the links are still not working... Anyone got a working example?
thanks,
Smon
Edited by SLarouche, 08 October 2007 - 01:19 PM.
#59
Posted 08 October 2007 - 12:10 PM
It has REAL Demo, Core files and 5.1 update.
http://www.sponest.c...LLoading5.1.rar
#60
Posted 08 October 2007 - 01:20 PM
Okei I thought I'm gonna upload it somewhere.
It has REAL Demo, Core files and 5.1 update.
http://www.sponest.c...LLoading5.1.rar
Cheers, works great. thanks.
Smon
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users











