GLBasic forum

Other languages => GLBasic - de => Topic started by: nabz32 on 2015-Mar-24

Title: richtige PND erstellen mit GLBasic?
Post by: nabz32 on 2015-Mar-24
Hallo,

ich bin kurz davor den ersten Beta Test von Reggie World zu starten,
habe leider keine Ahnung wie ich eine fertige PND erstelle.

Im Momment läufts nur, wenn ich die PandoraEXE.pnd zusammen mit dem Media Verzeichniss zusammen
in zB. den Desktop Ordner der Pandora verschiebe.

Es ist ja auch noch eine PND mit dem Projektnamen in einem vorgelagerten Ordner vorhanden, kann man die irgendwie verwenden?
Title: Re: richtige PND erstellen mit GLBasic?
Post by: nabz32 on 2015-Mar-24
Mir ist auch noch was eingefallen, dass ich brauchen könnte,

kann man Systemspezifische Kommandos in GLBasic schreiben,
zB. Platform = Pandora -> loadKeyCnfg("PandoraDefault")
Platform = PC ->  loadKeyCnfg("PCDefault")?
Title: Re: richtige PND erstellen mit GLBasic?
Post by: Ian Price on 2015-Mar-25
The .PND that GLB creates is not a standard Pandora .PND. The full .PND is like a zip folder containing the executable file, screenshots, a runnable script, a PXML file (which needs valid information, including file name, version, etc. etc. The file also contains a ReadMe and an icon.

I can create a proper working .PND for you if you like. Or provide the tools for you to do it yourself.I'm at work now, so it will have to wait until tomorrow, but PM me and I can provide you with PNDTools and/or an empty .PND "shell" for you to populate (I'll provide instructions). It's easy once you know how, but still takes a couple of minutes.

As for format specifics, yes you can. At the start of your code use PLATFORMINFO$("DEVICE") to identify the current format and use this information to configure keys etc.
Title: Re: richtige PND erstellen mit GLBasic?
Post by: spacefractal on 2015-Mar-25
Ian, can you give the tools and instructions how compiling them currently?
Title: Re: richtige PND erstellen mit GLBasic?
Post by: D2O on 2015-Mar-25
Hi nabz32,

Code (glbasic) Select
PLATFORMINFO$()
sollte Dir eigentlich weiterhelfen.
Title: Re: richtige PND erstellen mit GLBasic?
Post by: nabz32 on 2015-Mar-25
@D2O

Danke, das war genau das was ich gesucht habe.
Nun muss ich nicht mehr Pandora bzw. PC spezifisches auskommentieren.
Title: Re: richtige PND erstellen mit GLBasic?
Post by: erico on 2015-Mar-25
Quote from: nabz32 on 2015-Mar-24
Mir ist auch noch was eingefallen, dass ich brauchen könnte,

kann man Systemspezifische Kommandos in GLBasic schreiben,
zB. Platform = Pandora -> loadKeyCnfg("PandoraDefault")
Platform = PC ->  loadKeyCnfg("PCDefault")?

In my case, I don´t need the code to autodetect platform, I just create a variable and set it up on program start before compiling, like:
comp=0 (caanoo)
comp=1 (pc/mac)
comp=2 (pandora)
etc.

My code make changes to the game according to the target computer, like touch controls, screen borders, object limits and fade effects.
Title: Re: richtige PND erstellen mit GLBasic?
Post by: nabz32 on 2015-Mar-25
that is also a good solution erico. ( Why didn´t I think of that before? )
But Platforminfo$ just fits perfectly for my purpose,
ie. the save / load keys function just takes the Platforminfo$ string and adds ".kcnfg" to it to write or read the
configuration.
Of course you could set a platform$ string according to the comp variable also.

I still wonder why the fully packed PND GLBasic generates won´t work on the Pandora,
all the informations seem to be in the XML already and it seems everything is packed in it allready ( size wise ).
Title: Re: richtige PND erstellen mit GLBasic?
Post by: kanonet on 2015-Mar-25
Quote from: nabz32 on 2015-Mar-25Nun muss ich nicht mehr Pandora bzw. PC spezifisches auskommentieren.
Müsstest du auch ohne PLATFORMINFO$ nicht, für Plattform-spezifischen Code gibt es den Präcompiler, bspw. ?IFDEF WINDOWS etc. Das hat übrigens den Vorteil, dass die Unterscheidung bereits zur Kompilierzeit abläuft und nicht benötigter Code erst gar nicht in die Executable integriert wird (=schneller), während die Verwendung von PLATFORMINFO$ zur Laufzeit erfolgen würde.
Title: Re: richtige PND erstellen mit GLBasic?
Post by: Ian Price on 2015-Mar-25
QuoteDanke, das war genau das was ich gesucht habe.
Nun muss ich nicht mehr Pandora bzw. PC spezifisches auskommentieren.

QuoteI still wonder why the fully packed PND GLBasic generates won´t work on the Pandora,
all the informations seem to be in the XML already and it seems everything is packed in it allready ( size wise ).

Did you not read my post AT ALL? I answered both of those questions.   ::)  :x
Title: Re: richtige PND erstellen mit GLBasic?
Post by: nabz32 on 2015-Mar-25
sorry, I missed your post while reading enricos.
PMed you

@ Kanonet:
Wäre wohl besser das im Präcompiler zu machen, danke
Title: Re: richtige PND erstellen mit GLBasic?
Post by: Ian Price on 2015-Mar-25
Here are both files that you will need -

YOUR_GAME_NAME is the "shell" of everything that your .PND will require. Make sure you read all of the ReadMe's in each folder and follow them exactly, as not doing so could cause you issues.

PNDTools is the drag & drop .PND creation system. It needs ALL the files that I have produced in the YOUR_GAME_NAME to ensure your game is created in a proper .PND format.


When the instructions ask you ro replace things, use the exact and actual name of your game (and your details) - don't use "YOUR_GAME_NAME" - and don't leave my email address in there either - I'm not going to give support to someone else's game! :p

If you have any issues, then let me know.
Title: Re: richtige PND erstellen mit GLBasic?
Post by: spacefractal on 2015-Mar-25
Im cant unzip PNDTools and that tool should have been include in glbasic really (if possible due the license its may uses?)

But im have im have quick looked about "YOUR GAME NAME".

Im thinks the prepare thing can been dore more easier by a little blitzmax tool (in same maner im did with xCode and Android, im perfer BlitzMax here) and replacing "makeapp.exe", but rename that to "Makeapp2.exe", so its can launch that first from the blitzmax app, but then its ran perfere the required bits after that (etc telling how to do directly in output).

But im dont thinks its really that hard at all when first understand it.


Title: Re: richtige PND erstellen mit GLBasic?
Post by: erico on 2015-Mar-26
I´m interested in that too Ian, thanks for the tools+instructions, will check it out.
But in my case I believe virtual screen is broken on pandora?
It will be a while till I can give it a go again. :(
Title: Re: richtige PND erstellen mit GLBasic?
Post by: Ian Price on 2015-Mar-26
QuoteBut in my case I believe virtual screen is broken on pandora?
Virtual screen works perfectly well in v10.XX of GLBasic, so use that to compile the required .PND file (as mentioned GLB creates two .PND files - the only one we need to use is the pandora.pnd.exe (or whatever it's called - I can't check right now)). It definitely works, as my Christmas Advent Calendar puzzle game used it successfully on Pandora. 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.

SpaceFractal - there might have been a problem with my upload of the PNDTools.zip. I'm at work now, but will upload it again tomorrow. Or you can grab a much more recent version from the Pandora site. The old one works perfectly for me, so I didn't bother updating.

With everything I've included in the YOUR_GAME_NAME folder, there really isn't much work required - it's just a simple cut & paste of text in a few areas. Nothing complex. Once you've got it working once, it's a doddle really.
Title: Re: richtige PND erstellen mit GLBasic?
Post by: erico on 2015-Mar-26
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!
Title: Re: richtige PND erstellen mit GLBasic?
Post by: nabz32 on 2015-Apr-02
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.
Title: Re: richtige PND erstellen mit GLBasic?
Post by: Ian Price on 2015-Apr-02
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.
Title: Re: richtige PND erstellen mit GLBasic?
Post by: nabz32 on 2015-Apr-02
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.


Title: Re: richtige PND erstellen mit GLBasic?
Post by: Ian Price on 2015-Apr-02
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.
Title: Re: richtige PND erstellen mit GLBasic?
Post by: nabz32 on 2015-Apr-02
Thx for the clarification Ian.

I am worried how to switch back to the PND directory after switching to the "Documents" folder.
Title: Re: richtige PND erstellen mit GLBasic?
Post by: Ian Price on 2015-Apr-02
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$)


:)
Title: Re: richtige PND erstellen mit GLBasic?
Post by: nabz32 on 2015-Apr-02
wow what an incredible nice solution to this.
Thank you very much Ian, i will update my code accordingly
and post my results.