Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - loftcat

#16
@svenart Nice looking game well done! Great to see an html5 release too, inspiraton for me to work on something using the compiler.
#17
Interesting to hear this too as I'd also like to try Steam for releasing a game one day. Does Steam help to make your games easy to update?

Also fascinating you came from Symbian, I too released a game for the Symbian range some years back. What tools did you use back then? I used NSBASIC for Symbian. I don't think there were too many of us using it.
#18
I have the same problem. You would think I would recognise my own code but no!  =D
#19
My Python version is 3.10.7
#20
First cut of some steps for another GLBASIC-HTML5 newbie like myself...  what do you think? Anything to add or amend ?

GLBASIC v16 (Steam edition) - Getting started with the HTML Compiler (Windows 10)

Pre-requisites: GLBASIC v16 Steam Edition

1. Purchase the HTML Compiler from Steam as GLBASIC DLC. Once purchased, the HTML Compiler should automatically install via Steam.
There isn't an obvious change to GLBASIC when you launch it, but under Project->Options on the menu, HTML5 and HTML5-webGL options should be available.

2. Install Python. This is not mandatory for the compiler to work, but is needed if you want to test your compiled html5 program in the simplest way. You can install the latest version of Python from the Microsoft App Store.

3. Create a new project with the following code:

SETLOOPSUB "MainLoop1"
SUB MainLoop1:
   PRINT "Hello World",10,10
   SHOWSCREEN
ENDSUB

The key thing is a SETLOOPSUB should be used for main loops when compiling to HTML5.

4. On the menu go to Project->Options and set Platform Configuration to 'HTML5-WebGL' and click OK.

5. Go to Compile->Build Multiplatform. Click on HTML5-WebGL to compile your project.

6. Locate your project folder in your GLBasic home folder. Navigate to the ..\<projectName>.app sub-folder of your project. If there isn't a Media folder, create one. Inside your Media folder, if you do not have any files, create a simple dummy text file. It doesn't matter what it is called, as long as a file exists here.

7. Go to Compile->Build Multiplatform. Click on HTML5-WebGL to re-compile your project

8. Navigate to the ..\distribute\HTML5 folder and you should see several files of these types: .data, .html, .js, .wasm and .bat. Providing you have installed Python in step 2, you should be able to click on the run_local_test.bat file to run your project in a browser using a local web server.
#21
Quote from: Qedo on 2022-Sep-23
about the local web server not working but are you sure you have python installed?
To check this, open a cmd and run python.exe

Aha! Installed Python and it works  :booze:
So simple when you know how. I'm going to do a little getting started guide for sure!
#22
QuoteYet Gernot in HTLM5 the mouse test:

SETLOOPSUB "MainLoop1"
SUB MainLoop1:
    PRINT "X:" + MOUSEAXIS (0), 0, 0
    PRINT "Y:" + MOUSEAXIS (1), 0, 20
    PRINT "Z:" + MOUSEAXIS (2), 0, 40
    PRINT "A:" + MOUSEAXIS (3), 0, 60
    PRINT "B:" + MOUSEAXIS (4), 0, 80
    PRINT "C:" + MOUSEAXIS (5), 0.100
    SHOWSCREEN
ENDSUB

only the left mouse button works.
Any idea?

When testing today I noticed if I put a mousewait into my MainLoop1 the HTML5 compiled but failed to run. But I could call out to a procedure to do it and it works.
#23
Thank you so much for the help. Still no luck with running the bat file to run the local webserver, but my good news is that I can now compile, copy the content of the folder to XAMPP and it works! It now produces an html file which I can call from the web browser via localhost.

Main change I made was simply to add a file to a media folder. It's also imperative to use a SETLOOPSUB as you mentioned (Gernot sets that out in the pre-reqs to be fair although I did need reminding). When I get a few more minutes I'll put together an idiots guide to getting started with the HTML Compiler (mainly for me so I don't forget  =D, but for anyone in the future that might need it).

#24
Thanks for the advice. I've downloaded XAMPP and installed. Seems to be running ok as I can create a simple html file in the htdocs folder and open it fine.

I've tried recompiling to HTML5 webGL once again with a brand new simple three line program to display hello world. The good news I think is I'm no longer getting the OUTLINING_LIMIT error, but still getting an odd error at the end of the compiling:

Quoteem++: error: 'Q:\Compiler\platform\HTML5\emsdk\upstream\emscripten\tools\file_packager.bat C:\Users\tonyk\AppData\Local\Temp\glbasic\HelloAgain.data --from-emcc --export-name=Module --preload Media' failed (1)
distribute HTML5 to: C:/GLB/GLBasic/HelloAgain/distribute/HTML5
exit
success
_______________________________________
*** Finished ***
Elapsed: 11.1 sec. Time: 23:10
Build: 5 succeeded.

The wasm file is 235kb and along with run_local_test.bat are the only files generated. If I drop the wasm file into the XAMPP htdocs folder and try opening https://localhost/HelloAgain.wasm from a web browser it prompts to download the wasm file. It then does something odd where it automatically keeps opening multiple browser tabs until I force close the browser.  It's a bit odd and slightly inconsistent which isn't helping. Hoping Gernot might see this when he's feeling better and can help  =D
#25
Thanks for sharing how you created a menu for your games pack. One of the thngs I like is how they all feel a part of the same pack, well thought out. I have a few mini games that I'd like to do this with, I will have to think about all my procedures and variables and how easy this would be to do retrospectively.

Great looking maze by the way, keep us updated on your progress!
#26
Quote from: dreamerman on 2022-Aug-20
To be honest, last couple months I only fixed some small bug in game, and apart that I didn't have time to do proper coding ,specially in GLB :/ , just recently I played with maze generating algorithms in JavaScript. Now I will port it to GLB and make some 'game' from it, still I need to write some crazy code to generate 3d cube maze from prepared 2d arrays :> Not sure what later, I would like to finish that Solomon's Key clone, or at least push it to point that only sound and pr/steam/translation in missing, as I could do proper alpha testing in such case.
I'm waiting impatiently to see Yours projects :P and really any GLB project ;)

@dreamerman I bought your game pack on Steam and am very impressed. I like the way I can launch all the games from a single menu without having to completely exit the game pack each time. Curious how you did this... am I right thinking all the games are inside one executable?
#27
Anyone at all seen this error...?
#28
Quote from: Qedo on 2022-Sep-07
OUTLINING_LIMIT is an error I get when compiling with HTML5.
If I compile with HTML5-WebGL everything is OK
Tried with version 16.947 and the latest html5 Steam version (not sure which version)

Same observation for me Qedo, no OUTLINING_LIMIT error when compiling to HTML5_GL which is good, but unfortunately for me no luck getting an html5 program to launch :(   I am compiling and getting the attached report, the tail of which shows:

QuoteNothing to do!
em++: error: 'Q:\Compiler\platform\HTML5\emsdk\upstream\emscripten\tools\file_packager.bat C:\Users\tonyk\AppData\Local\Temp\glbasic\Hello_world.data --from-emcc --export-name=Module --preload Media' failed (1)
distribute HTML5 to: C:/GLB/GLBasic/helloworld/distribute/HTML5
exit
success
_______________________________________
*** Finished ***
Elapsed: 20.5 sec. Time: 11:25
Build: 5 succeeded.

In the Hello_world app folder it has generated a single file, Hello_world.html which appears to be a dummy file. The \distribute\HTML5 folder contains 2 files:

Hello_world.wasm
run_local_test.bat

When I open the bat file it briefly launches a command window which promptly closes itself, and the browser opens a tab telling me it cannot launch localhost:8000.

I'm not certain if the problem is the local server failing to launch or the program files haven't generated properly. I was expecting more files to be generated but maybe the above is correct?
#29
Ok I took the plunge and bought the HTML5 Compiler from Steam just to see where I could get to. It automatically installs it as DLC via Steam which is nice and start GLBasic is the usual way, through a desktop icon or Start menu in Windows 10.

I've made a really simple program with a SETLOOPSUB. I've then navigated to Project > Options and checked the Platform Configuration is set to 'HTML5', applied and exit. I've then gone to Compiler -> Build Multi-platform and clicked on HTML5.

The result is a .app project sub-folder containing a project.html file telling me it's a dummy file. In the Distribute folder an HTML5 sub-folder has been created containing 1 file: run_local_test.bat

The compile report contains the following:

Quote*** Configuration: HTML5 ***
precompiling:
GPC - GLBasic Precompiler V.17.312 SN:58f00c1b - 3D, NET
Wordcount:17 commands
compile+link:
Adding directories to PATH:
PATH += Q:\Compiler\platform\HTML5\emsdk\upstream\emscripten
PATH += Q:\Compiler\platform\HTML5\emsdk\node\12.18.1_64bit\bin
PATH += Q:\Compiler\platform\HTML5\emsdk\python\3.7.4-pywin32_64bit
PATH += Q:\Compiler\platform\HTML5\emsdk\java\8.152_64bit\bin

Setting environment variables:
PATH = Q:\Compiler\platform\HTML5\emsdk\upstream\emscripten;Q:\Compiler\platform\HTML5\emsdk\node\12.18.1_64bit\bin;Q:\Compiler\platform\HTML5\emsdk\python\3.7.4-pywin32_64bit;Q:\Compiler\platform\HTML5\emsdk\java\8.152_64bit\bin;Q:\Compiler\platform\HTML5\emsdk;Q:\Compiler\platform\HTML5\bin
EM_CONFIG = Q:\Compiler\platform\HTML5\emsdk\.emscripten
EM_CACHE = Q:/Compiler/platform/HTML5/emsdk/upstream/emscripten\cache
EMSDK_NODE = Q:\Compiler\platform\HTML5\emsdk\node\12.18.1_64bit\bin\node.exe
EMSDK_PYTHON = Q:\Compiler\platform\HTML5\emsdk\python\3.7.4-pywin32_64bit\python.exe
JAVA_HOME = Q:\Compiler\platform\HTML5\emsdk\java\8.152_64bit
emcc:WARNING: --js-opts ignored when using llvm backend
em++: error: Attempt to set a non-existent setting: 'OUTLINING_LIMIT'
- did you mean one of INLINING_LIMIT?
- perhaps a typo in emcc's  -s X=Y  notation?
- (see src/settings.js for valid values)
distribute HTML5 to: C:/GLB/GLBasic/htmltest4/distribute/HTML5
exit
success
_______________________________________
*** Finished ***
Elapsed: 5.7 sec. Time: 14:37
Build: 5 succeeded.

Any ideas what I'm doing wrong? Am I missing a component to make this work? There's clearly an error in the compile but I don't know if it's relevant. A search on the forum throws up a thread from 2020 about OUTLINING_LIMIT but doesn't conclude anything. Really hope I can get this working on some level.

Help appreciated!
#30
Quote from: Kitty Hello on 2022-Sep-05
I see. A port to cmake is overdue. That way you could open it in e.g. QtCreator on Linux or Mac and it "should" run.
Currently, my arm is broken, however.  :help:

Sorry to hear about your arm, I hope you get well soon!  :)
QtCreator is not something I've seen before but this sounds interesting!