Jump to content


Photo

R.e.a.l. External Resource Extraction (ver 5.1b)


  • Please log in to reply
99 replies to this topic

#41 Potnop

Potnop

    GMC Member

  • GMC Member
  • 3101 posts

Posted 17 June 2007 - 06:17 PM

OK this error also happens when trying to run REAL_LOADING_CORE 4.

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.
  • 0

#42 Armageddon

Armageddon

    Earth, Wind & Fire

  • New Member
  • 64 posts

Posted 05 August 2007 - 03:06 AM

Damn, and I was just looking for an update!
  • 0

#43 Potnop

Potnop

    GMC Member

  • GMC Member
  • 3101 posts

Posted 06 August 2007 - 08:01 AM

What do you mean?
  • 0

#44 dender

dender

    GMC Member

  • New Member
  • 308 posts

Posted 08 August 2007 - 12:56 PM

Hello again. I wonder where did all these help files gone?
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?
  • 0

#45 Revel

Revel

    ɹǝqɯǝɯ ɔɯƃ

  • GMC Member
  • 4873 posts
  • Version:GM8

Posted 28 August 2007 - 04:52 PM

Hope there is a manual. I was looking for something exactly like this! THANKS!

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.

  • 0

#46 Revel

Revel

    ɹǝqɯǝɯ ɔɯƃ

  • GMC Member
  • 4873 posts
  • Version:GM8

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
  • 0

#47 dender

dender

    GMC Member

  • New Member
  • 308 posts

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...

<{POST_SNAPBACK}>


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.
  • 0

#48 Revel

Revel

    ɹǝqɯǝɯ ɔɯƃ

  • GMC Member
  • 4873 posts
  • Version:GM8

Posted 29 August 2007 - 05:05 PM

i didnt edit anything :P
  • 0

#49 Potnop

Potnop

    GMC Member

  • GMC Member
  • 3101 posts

Posted 31 August 2007 - 02:40 AM

OK, so the only way for that to happen is if you did something wrong. This was really complicated for me to figure out as well and I'm not the creator.

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.

  • 0

#50 wurdup

wurdup

    GMC Member

  • GMC Member
  • 840 posts

Posted 31 August 2007 - 09:29 AM

all the links for 'real loading 4' are broke
  • 0

#51 Potnop

Potnop

    GMC Member

  • GMC Member
  • 3101 posts

Posted 01 September 2007 - 08:31 AM

Heh, OK... I'll see about those soon. Tomorrow maybe... Right now I'm gonna go to sleep.
  • 0

#52 XboxKing

XboxKing

    GMC Member

  • New Member
  • 5 posts

Posted 10 September 2007 - 03:24 AM

I can't get it to extract anything.
  • 0

#53 Potnop

Potnop

    GMC Member

  • GMC Member
  • 3101 posts

Posted 13 September 2007 - 11:30 PM

Uh, OK. So what exactly are you doing with it? Are you getting error messages or what?
  • 0

#54 XboxKing

XboxKing

    GMC Member

  • New Member
  • 5 posts

Posted 14 September 2007 - 08:57 AM

No errors or anything thats why i didn't write much
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.

  • 0

#55 Potnop

Potnop

    GMC Member

  • GMC Member
  • 3101 posts

Posted 21 September 2007 - 12:20 AM

Uh, OK.

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);
  • 0

#56 SLarouche

SLarouche

    GMC Member

  • GMC Member
  • 91 posts
  • Version:GM:Studio

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.

<{POST_SNAPBACK}>


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
  • 0

#57 blue123

blue123

    GMC Member

  • New Member
  • 365 posts

Posted 29 September 2007 - 11:27 AM

Potnop, can you re-host the files? The links don't work.
  • 0

#58 SLarouche

SLarouche

    GMC Member

  • GMC Member
  • 91 posts
  • Version:GM:Studio

Posted 08 October 2007 - 11:05 AM

Potnop, can you re-host the files? The links don't work.

<{POST_SNAPBACK}>


So, the links are still not working... Anyone got a working example?

thanks,

Smon

Edited by SLarouche, 08 October 2007 - 01:19 PM.

  • 0

#59 dender

dender

    GMC Member

  • New Member
  • 308 posts

Posted 08 October 2007 - 12:10 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
  • 0

#60 SLarouche

SLarouche

    GMC Member

  • GMC Member
  • 91 posts
  • Version:GM:Studio

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

<{POST_SNAPBACK}>


Cheers, works great. thanks.

Smon
  • 0




1 user(s) are reading this topic

1 members, 0 guests, 0 anonymous users