Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Oh, I think I can see what's wrong now: the x/y position displayed in the level editor is measured in TILES, but the position used for the starting coordinates is measured in PIXELS. If you change the starting coordinates to 33*TILESIZE for the x value and  147*TILESIZE for the y value it should work.


Knight isn't hardcoded to be the starting class specifically, the game defaults to the class with ID 0 (which happens to be the knight class).


You could probably remove that ggui_menu_add_option_multichoice line entirely (so the player can't change classes) but the default stats still will be read from the class data. Also there's a number of pcust_ macros (pcust_NAME for instance) which are used to refer to the different data in the character customization, these also needs to be adjusted if you remove anything from that menu.


Enemy state machine scripts are found in Scripts --> State Machine --> Enemy. (GM protip: you can middle-click asset names in code to instantly open them, use Ctrl + T to search by name, and Ctrl + Shift + F to search for text in the entire codebase)


Player animation is handled by the state machine, some states use a shared script like player_animate_ordinary, but some states just load an hardcoded animation with skelani_set_animation. Most enemies set their animation in their step / end step event with skelani_set_animation.


The light effect is controlled by an object called obj_darknesscontrol. Right now they're only spawned by the biome setup scripts (for cave, castle, forest, shrine and graveyard biomes) but nothing stops you from spawning them whenever you want, or copying the object to make special versions.


Backgrounds also are controlled by the biome, you can set this up in the level_init_biomes script. Right now it supports up to 3 backgrounds.


One way to extend the tile system to use pre-made tiles without having to get them into the system that's used in the engine now would be to add another case in pixel_vacant that checks if the tile's top position is >= 9*TILESIZE, and if so, treat it as a solid and abort early. (You'd place this before the check if the tile is in the DECO area). Now you can take the template (or the existing level tileset you want to use), resize the canvas so it's taller, and just paste the new "off-grid" tiles  at the bottom. (You can make it wider too if needed, of course)

(1 edit)

"Enemy state machine scripts are found in Scripts --> State Machine --> Enemy. (GM protip: you can middle-click asset names in code to instantly open them, use Ctrl + T to search by name, and Ctrl + Shift + F to search for text in the entire codebase)"

Did not see the enemy had a parrent, on that parrent object i could see the real name of the state script. Thanks!

"Backgrounds also are controlled by the biome, you can set this up in the level_init_biomes script. Right now it supports up to 3 backgrounds."
Thanks!

"One way to extend the tile system to use pre-made tiles without having to get them into the system that's used in the engine now would be to add another case in pixel_vacant that checks if the tile's top position is >= 9*TILESIZE, and if so, treat it as a solid and abort early. (You'd place this before the check if the tile is in the DECO area). Now you can take the template (or the existing level tileset you want to use), resize the canvas so it's taller, and just paste the new "off-grid" tiles  at the bottom. (You can make it wider too if needed, of course)"

Thanks, i just tried to add another row of 16 to the line #macro tstb_DECO 176 to 192, and it seems to be working, and it seems to be working with collision.


thanks for taking the time again. are there any special realation between the size off one room on the world map 1x1 vs how many pixels it is in the level editor. ? is that something that can be changed? 

One map cell is (by definition) a space of VIEW_W x VIEW_H pixels. (Those have default values 640 x 360, respectively). So changing VIEW_W and VIEW_H will change the size of map cells. (The cells aren't used for anything special in the level editor other than acting as a guide)

The views (and menu rooms' sizes) won't automatically adapt to this new size so if you change the view size you will need to change those as well.

(1 edit) (+1)

 Would changing those values also change the resolution of the game? say i want to run it as 1024/768 ?

If you ever want to build on this, add a way to add tiles in 2 layers, so you can have background tiles under the real tiles.