Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/20/24 01:28
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 609 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
game_save / game_load : HELP #202120
04/13/08 14:04
04/13/08 14:04
Joined: Oct 2003
Posts: 1,550
United Kingdom
indiGLOW Offline OP
Serious User
indiGLOW  Offline OP
Serious User

Joined: Oct 2003
Posts: 1,550
United Kingdom
Just wondering if there is a way to use game_save/game_load with objects that exist outside of pre-declared paths.

I am adding .mdl objects into the game world at run time and saving. if the added objects do not exist within the paths defined in the master .wdl file, during load the game crashes. When models are added from locations that have already been defined as paths, the save / load functionality works fine.

I have read a little about 'add_struct' but I am unclear if this would allow saving of the additional information (i.e pointers to new paths) or not.

So any advice would be much appreciated.

TIA


The Art of Conversation is dead : Discuss
Re: game_save / game_load : HELP [Re: indiGLOW] #202693
04/16/08 15:11
04/16/08 15:11
Joined: Oct 2003
Posts: 1,550
United Kingdom
indiGLOW Offline OP
Serious User
indiGLOW  Offline OP
Serious User

Joined: Oct 2003
Posts: 1,550
United Kingdom
Anyone? Is it the question is too hard to answer or that the question is just to confusing \:\) lol

Please anyone who can offer help, much appreciated.

Q: How do I include the non-WDL specified paths for models added externally within the game save file?

Here's hoping \:\)


The Art of Conversation is dead : Discuss
Re: game_save / game_load : HELP [Re: indiGLOW] #202861
04/17/08 14:48
04/17/08 14:48
Joined: Sep 2003
Posts: 733
Whitefish, Montana
JazzDude Offline
User
JazzDude  Offline
User

Joined: Sep 2003
Posts: 733
Whitefish, Montana
I'm guessing you are talking about file paths. If so, why aren't you including the models in the work folder?

Re: game_save / game_load : HELP [Re: JazzDude] #202863
04/17/08 14:53
04/17/08 14:53
Joined: Jan 2002
Posts: 4,225
Germany / Essen
Uhrwerk Offline
Expert
Uhrwerk  Offline
Expert

Joined: Jan 2002
Posts: 4,225
Germany / Essen
You could use file_copy to copy the model from somewhere else. Other than that most functions dealing with files work also with absolute paths.


Always learn from history, to be sure you make the same mistakes again...
Re: game_save / game_load : HELP [Re: Uhrwerk] #202888
04/17/08 19:30
04/17/08 19:30
Joined: Oct 2003
Posts: 1,550
United Kingdom
indiGLOW Offline OP
Serious User
indiGLOW  Offline OP
Serious User

Joined: Oct 2003
Posts: 1,550
United Kingdom
Thanks for the responses guys \:\)

Let me explain a little more:

Our current project development means that we are currently implementing an internally focused level editor, for use by our development team, and ultimatly to be shipped with our planned title(s).

This tool allows level designers and artists to generate and use new assets in the creation of the level. As a result we have a constantly shifting and expanding collection of assets.

Obviously part of the level editor requires the ability to save and load work, and due to the nature of the dynamic assets, it also needs to maintain relative paths, including those outside of pre-defined 'paths'

I was hoping that within the save settings, would be an option to store the chunk of memory or indeed, the paths to the objects. Hence this topic \:\)

One alternative we have considered is to use a hidden model, always within a pre-defined path area, and then once the positions of all assets has been loaded, each of these proxy assets would then be switched to what ever path was stored in one of the model skills....

However, a large percentage of the level editor tool is complete already and this would mean a large amount of thrown away work.

Hope that helps clarify what we are trying to achieve.

The remaining alternative is that save and load would function through the exported level data, instead of the handy .sav files.

TIA for any help and advice



Last edited by indiGLOW; 04/17/08 19:30.

The Art of Conversation is dead : Discuss
Re: game_save / game_load : HELP [Re: indiGLOW] #202911
04/17/08 23:42
04/17/08 23:42
Joined: Mar 2003
Posts: 4,264
Wellington
Nems Offline

.
Nems  Offline

.

Joined: Mar 2003
Posts: 4,264
Wellington
Why not use a created path [empty folder perhaps] where the added models can be saved to then accessed after creation on demand?

Re: game_save / game_load : HELP [Re: Nems] #202914
04/17/08 23:58
04/17/08 23:58
Joined: Jan 2002
Posts: 4,225
Germany / Essen
Uhrwerk Offline
Expert
Uhrwerk  Offline
Expert

Joined: Jan 2002
Posts: 4,225
Germany / Essen
An alternative would be to load complete folders. My idea is the following: Define a savedir like "cache" and add it even to the paths 3dgs is using. In this directory you can copy all the files you need for the loading process and then load the file as you did until now. You can copy the files using the windows API function "int SHFileOperation(LPSHFILEOPSTRUCT lpFileOp);" that is capable of copying any number of files from any directory to any directory. Before loading the next folder you should clean up the directory. Again you can use SHFileOperation for this.

EDIT: Sorry, I just noticed this is the c-script forum and not the Lite-C one. So directly accessing the windows API won't work. However you can use one of the various .dlls available here for file operations.


Always learn from history, to be sure you make the same mistakes again...
Re: game_save / game_load : HELP [Re: Uhrwerk] #203006
04/18/08 20:07
04/18/08 20:07
Joined: Oct 2003
Posts: 1,550
United Kingdom
indiGLOW Offline OP
Serious User
indiGLOW  Offline OP
Serious User

Joined: Oct 2003
Posts: 1,550
United Kingdom
Thanks for the suggestions.

FYI:
- Yes I am sticking with A6 for the time being, so C-Script is all I got \:\)
- I am utilizing the file.dll already, including a fully explorable interface for browsing an already specified directory (defined as a true "path" in .wdl).

There are several options I could investigate, if moving files around in real time, met all the requirements. However maintaining the folder structure, and allowing it to dynamically be saved is vital.

I am going to mark this down as: ".SAV's do not store paths outside of pre-defined locations."

Therefore an alternative solution will need to be sourced.

Thanks for the help guys. If anyone can explain how to include dynamic paths within a .SAV using the game_save / game load functions, please post or get in tough with me.

Thanks again


The Art of Conversation is dead : Discuss
Re: game_save / game_load : HELP [Re: indiGLOW] #203159
04/20/08 00:20
04/20/08 00:20
Joined: Jan 2002
Posts: 4,225
Germany / Essen
Uhrwerk Offline
Expert
Uhrwerk  Offline
Expert

Joined: Jan 2002
Posts: 4,225
Germany / Essen
From my point of view your idea is impossible. The .sav files contain no directory information at all. When loading a .sav you the files needed will be looked up in the games paths. Either it's there an everything is fine or you'll get an error message. I guess precaching is the only way to do it. However, if this is not an option for you I am running out of ideas.


Always learn from history, to be sure you make the same mistakes again...
Re: game_save / game_load : HELP [Re: Uhrwerk] #203183
04/20/08 08:48
04/20/08 08:48
Joined: Jul 2001
Posts: 6,904
H
HeelX Offline
Senior Expert
HeelX  Offline
Senior Expert
H

Joined: Jul 2001
Posts: 6,904
There is one unique problem why this doesn't work: when A6 loads the entity (from e.g. an absolute path like I guess you do), later on we only know the filename and not the location. This is fine for standard cases in which assets are located in registered paths, the game folder or WRS ressources. So you will be never be able to work with game_save/game_load until you work out a real hack that could be worser then everything else :P

If you are just dealing with the leveleditor (and not save files which should be readed in the game like save games), my suggestion would be to replace (or modify) your function that loads entities into the scene by saving the path string into it. Later, when you save the scene, you will save it into a custom format. This format saves for each entity: position, rotation, scaling, skills, flags, material, action and finally the relative filename.

Then you make a function that can read out this datafile and creates all entities after another. Since you saved also the filepath in that file, you don't have a problem with it.

I have not to mention that you are required to compile these functions into a DLL. If you hve further questions on this, don't hesitate to ask me.

Hope this helps,
- Christian

Last edited by HeelX; 04/20/08 08:49.
Page 1 of 2 1 2

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1