richtige PND erstellen mit GLBasic?

Previous topic - Next topic

erico

Quote from: Ian Price on 2015-Mar-26
... I doubt your game uses anything that's only available in later versions of GLB, so there's no drawback. You can have two versions of GLB on the go without any obvious issues - I do...

Exactly, and in fact, that is another GLB feature.  ;)
I should look into it very soon me hopes.
Thanks for sharing!

nabz32

Thx for the PND Creation Folder dummy Ian!

I have trouble with the PND creation though.
It seems as soon the PND tries to write data it crashes back to the desktop.

Also which folder should the info src point to?
/mnt/utmp/ReggieWorld/readme.txt is not found when trying to open the documentation on the Pandora.

Ian Price

QuoteIt seems as soon the PND tries to write data it crashes back to the desktop.
That's probably because you've not set the save/load directory properly.

At the start of your program, ensure you use -
Code (glbasic) Select

GLOBAL fileinfo$=PLATFORMINFO$("DOCUMENTS")


Then in your save function use something like this -

Code (glbasic) Select


LOCAL file$=fileinfo$+"/Reggie.sav"

OPENFILE (1,file$,FALSE)

...
...

CLOSEFILE 1



Info source?

If you just mean the "ReadMe" to see instructions from the Pandora menus, then the dummy folder should have that in already - just change my ReadMe for yours.
I came. I saw. I played.

nabz32

#18
I am a bit confused here,

the GLBasic pandora exe pnd automatically created files in the appdata/companyname/gamename.
It autodetected, wether the file is in the appdata folder or in its media folder.
Does that mean I have to check for each file that can be updated by the game when loading, If its in the pnds media folder or in the Directory given by PLATFORMINFO$("DOCUMENTS")?

Is it possible that the PND, at first startUp, extracts a copy of the Media folder inside and places it in the appdata/gamename folder?
I also want people to replace graphics etc. in the game, that would make it much easier.



Ian Price

The game automatically creates a folder to save data in - this is what the PLATFORMINFO$ is referring to.

In-Game data is loaded from within the .PND and NOT from the save directory.

You can allow people to replace gfx etc, but you'd have to tell the game to look in the appdata folder, rather than the .PND Media folder.

Copying over the Media folder shouldn't be too problematic, but it's not something I've ever tried to do.
I came. I saw. I played.

nabz32

Thx for the clarification Ian.

I am worried how to switch back to the PND directory after switching to the "Documents" folder.

Ian Price

Why do you need to switch?

In any case what you can do is use something like this at the start of your code-

Code (glbasic) Select

SETCURRENTDIR("Media") // go to media files

GLOBAL dir$=GETCURRENTDIR$()


This gets the path for the Media folder.

If you switch to another folder you can switch back by using-
Code (glbasic) Select

SETCURRENTDIR(dir$)


:)
I came. I saw. I played.

nabz32

wow what an incredible nice solution to this.
Thank you very much Ian, i will update my code accordingly
and post my results.