Page 2 of 3

Re: STI with Bump plugin

Posted: Fri Mar 17, 2017 4:41 pm
by DanielPower
Read the Bump documentation. Bump is the collision library. You'll need to add your player to the world, and then all movements will have to be called through bump's move function.

The bump github page gives examples on how to do all of this.

Basically, bump has a list of all collidables. When you move an object, like for example `player` with world:move(), bump will check between player's old position and player's new position to see if any collision would occur. If no collision occurs, it moves your player there, if a collision occurs, it moves your player to the collision, and then returns information about the collision.

If you just manually update player.x and player.y, bump no longer knows the current position of player, and cannot stop the player from going through collidables.

Re: STI with Bump plugin

Posted: Fri Mar 17, 2017 6:16 pm
by knuxyl
I got it working correctly, sti wasn't adding player to the bump world, only the tileset. Is there a boolean variable for collision on specific tiles I can use? I'm working on a super mario world engine and I need to code the item boxes.

Re: STI with Bump plugin

Posted: Sat Dec 23, 2017 12:11 pm
by KyleFlores1014
Sorry, Im new to this. Can I see the outcome? I dont quite get it.

Re: STI with Bump plugin

Posted: Tue Dec 26, 2017 8:40 pm
by jojomickymack
I was curious about this too - both 'bump' and 'simple tiled implementation' are fantastic libraries and they work really well together.

One huge advantage to combining these libraries is that sti anticipates that you will have a layer in your map with a boolean property called 'collidable' set to true. If that exists, collision detection on those tiles will be automatic.
bump_sti.gif
bump_sti.gif (100.95 KiB) Viewed 10365 times

Re: STI with Bump plugin

Posted: Sun Sep 22, 2019 6:01 pm
by nequals30
DanielPower wrote: Fri Mar 17, 2017 11:10 am If you need more complicated collisions, for example, using two collision boxes for a corner wall, or a smaller collision box for a thin wall, you can open the Tile Collision Editor in Tiled, and create collision boxes for an individual tile. If these collision boxes exist, STI's bump plugin will load these boxes instead of just one for the entire tile.

For this editor, you may need to name each box something specific. When I originally committed this feature, you'd have to call each box "colBox", but I believe that's since been changed to "collideable" or something similar. Check out the Bump project on Github for specifics.
This is a cool feature! It wasn't obvious to me how to use it at first.

In the Tiled "Tile Collision Editor", the collision box object needs to have the boolean custom property "collidable" set to true.

Also, tiles with custom collision boxes shouldn't have the "collidable" property set to true on the whole layer, they should be on a separate layer that is not "collidable". Otherwise it uses the custom collision box as well as the one of the whole tile.

Re: STI with Bump plugin

Posted: Tue Sep 08, 2020 6:35 pm
by green fries
having same problem
the code
function love.load()
require 'conf';
require 'vars';
bump = require 'maps/bump';
loc= require("maps/lv1")
local sti = require "maps"
world = bump.newWorld()
test = love.audio.newSource("audio/03 Towering Chieftain.mp3","static")
map = sti(loc ,bump)
map:bump_init(world)

end


it give me that nil value also

Re: STI with Bump plugin

Posted: Tue Sep 08, 2020 7:25 pm
by green fries
bump_init module isn't found in my bump.lua file can anyone send any working bump.lua not from github

Re: STI with Bump plugin

Posted: Thu Sep 10, 2020 9:35 am
by green fries
i known now and got the plugin from the STI on github but when i required it a new error came

Error

maps/bump.lua:7: loop or previous error loading module 'maps/bump'


Traceback

[C]: in function 'require'
maps/bump.lua:7: in main chunk
[C]: in function 'require'
main.lua:6: in function 'load'
[C]: in function 'xpcall'
[C]: in function 'xpcall'

the code

function love.load()
require 'conf';
require 'vars';
loc= require("maps/lv1")
require 'maps/bump'
local sti = require "maps"
test = love.audio.newSource("audio/03 Towering Chieftain.mp3","static")
map = sti(loc ,{"bump"})
world = bump.newWorld(16)
map:bump_init(world)
end

Re: STI with Bump plugin

Posted: Mon Sep 14, 2020 8:41 am
by RockEt__2580__
Try changing line 5 to
...
require 'maps.bump'
...

Re: STI with Bump plugin

Posted: Tue Sep 15, 2020 7:27 am
by RockEt__2580__
And set a variable called bump to require bump:

local bump = require "map.bump"