The following warnings occurred:
Warning [2] Undefined array key "" - Line: 1584 - File: inc/functions.php PHP 8.0.27 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/functions.php 1584 errorHandler->error_callback
/inc/functions_post.php 203 usergroup_displaygroup
/showthread.php 1118 build_postbit
Warning [2] Trying to access array offset on value of type null - Line: 1588 - File: inc/functions.php PHP 8.0.27 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/functions.php 1588 errorHandler->error_callback
/inc/functions_post.php 203 usergroup_displaygroup
/showthread.php 1118 build_postbit
Warning [2] Trying to access array offset on value of type null - Line: 1588 - File: inc/functions.php PHP 8.0.27 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/functions.php 1588 errorHandler->error_callback
/inc/functions_post.php 203 usergroup_displaygroup
/showthread.php 1118 build_postbit
Warning [2] Trying to access array offset on value of type null - Line: 1588 - File: inc/functions.php PHP 8.0.27 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/functions.php 1588 errorHandler->error_callback
/inc/functions_post.php 203 usergroup_displaygroup
/showthread.php 1118 build_postbit
Warning [2] Trying to access array offset on value of type null - Line: 1588 - File: inc/functions.php PHP 8.0.27 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/functions.php 1588 errorHandler->error_callback
/inc/functions_post.php 203 usergroup_displaygroup
/showthread.php 1118 build_postbit
Warning [2] Trying to access array offset on value of type null - Line: 1588 - File: inc/functions.php PHP 8.0.27 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/functions.php 1588 errorHandler->error_callback
/inc/functions_post.php 203 usergroup_displaygroup
/showthread.php 1118 build_postbit
Warning [2] Trying to access array offset on value of type null - Line: 1588 - File: inc/functions.php PHP 8.0.27 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/functions.php 1588 errorHandler->error_callback
/inc/functions_post.php 203 usergroup_displaygroup
/showthread.php 1118 build_postbit
Warning [2] Trying to access array offset on value of type null - Line: 1588 - File: inc/functions.php PHP 8.0.27 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/functions.php 1588 errorHandler->error_callback
/inc/functions_post.php 203 usergroup_displaygroup
/showthread.php 1118 build_postbit
Warning [2] Undefined array key "useravatar" - Line: 6 - File: inc/functions_post.php(938) : eval()'d code PHP 8.0.27 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/functions_post.php(938) : eval()'d code 6 errorHandler->error_callback
/inc/functions_post.php 938 eval
/showthread.php 1118 build_postbit
Warning [2] Undefined array key "userstars" - Line: 11 - File: inc/functions_post.php(938) : eval()'d code PHP 8.0.27 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/functions_post.php(938) : eval()'d code 11 errorHandler->error_callback
/inc/functions_post.php 938 eval
/showthread.php 1118 build_postbit




Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Gloom Example
#1
Marcus,

Ran through the Gloom examples and all ran flawlessly except for example #5. Whilst navigating through the level I would 'touch' a medkit and an error box pops up "Line 172 Font has not been loaded", the click 'ok' and it terminates. Tried it a couple of times for each of the two medkits with the same result. I think "set font 1" is referring to the 'arial' font? I checked the Gloom "fonts" folder and did not see 'arial'. The two font files in there were ui.bin and ui_bold.bin. Did I do something wrong?

J

May have fixed it.... changed line 169 to read "set font 0".... Medkit was picked up, "You picked up a medkit" and the level continued...
Reply
#2
Sorry, thanks for noticing. The program tries to use 'create font', which doesn't work on Linux (yet).

Maybe I should post something about how to create fonts on Linux, because it's not difficult at all.
Reply
#3
@marcus Is there any video tutorial for Gloom like you did for Raycasting and Platformer?
This world is ruled by Evils, we need Batman.
Reply
#4
(04-29-2018, 07:25 AM)indru91112 Wrote: @marcus Is there any video tutorial for Gloom like you did for Raycasting and Platformer?

Not yet, I'm afraid Sad

But the basics are quite simple. Here follows a small tutorial.
  • Start the gloom map editor
  • Without changing any settings, just click on the map to draw some lines (walls)
  • Save the map somwhere as my_map.txt
  • All the walls will be saved together with a value, and since you didn't change anything in the settings, this value will be 1. This value is important.
  • Now create a new program in the same folder as my_map.txt and cut and paste this code:
Code:
import "gloom.lib"
import "Keycodes.lib"
import "Speed.lib"

set redraw off

if not GLOOM_Init(75.0, 640, 480) then end

if not GLOOM_LoadMap("my_map.txt") then end

load image 1, "my_wall.png"

_GLOOM_InitMap GLOOM_LoadedMapWidth(), GLOOM_LoadedMapHeight()
_GLOOM_BuildLoadedMapWalls

playerX# = float(GLOOM_LoadedMapWidth()/2)
playerZ# = float(GLOOM_LoadedMapHeight()/2)
playerAngle# = 0.0

do
    if keydown(VK_LEFT)
        playerAngle = playerAngle - 2.0
    endif
    if keydown(VK_RIGHT)
        playerAngle = playerAngle + 2.0
    endif
    if keydown(VK_UP)
        playerX = playerX + cos(playerAngle)*0.04
        playerZ = playerZ + sin(playerAngle)*0.04
    endif
    if keydown(VK_DOWN)
        playerX = playerX - cos(playerAngle)*0.04
        playerZ = playerZ - sin(playerAngle)*0.04
    endif
    _GLOOM_PushOut playerX, playerZ, 0.3

    set color GLOOM_FogR(), GLOOM_FogG(), GLOOM_FogB()
    cls

    _GLOOM_Render playerX, playerZ, playerAngle
    redraw

    _SPD_HoldFrame 60    
until keydown(VK_ESC, true)



Before running the program, right click on this image and save it in the same folder as the map and your program:

[Image: my_wall.png]

Now the program should run fine.

I said that the value, 1, set for every wall in your map was important. It's important because it means that every wall in your map will use image 1. That's why we load the wall image as:

   load image 1, "my_wall.png"

If you open the gloom map editor again, load your map, change the value next to "Value" to 2 and draw some lines, these new lines will be saved together with the value 2. And if you, in your program, load another image:

   load image 2, "my_other_wall.png"

, the new walls will use that image.

That's the basics Smile
  • In the gloom map editor, use the value next to "Value" to decide what image (texture) to use for every new line (wall) that you draw
  • In your program, load images with the same IDs as the values used in the map editor


If there's anything you don't get about the code, feel free to ask Smile The biggest difference compared to the raycaster editor is that the gloom map editor itself doesn't save any information about images. It only saves a value per wall. When you call "GLOOM_BuildLoadedMapWalls" you tell the library to build the loaded walls and to treat their values as image IDs. The gloom library is a bit more "low level" than the raycaster library.
Reply
#5
Thumbs Up 
kool! Thanks for the short tutorial. That's all I needed. Also, I'm now going through the examples.

Thanks for keeping NaaLaa alive, you know what NaaLaa is one of the things which I tried way back in 2011(if I'm not wrong). Smile
This world is ruled by Evils, we need Batman.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)