STI with Bump plugin

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
User avatar
DanielPower
Citizen
Posts: 50
Joined: Wed Apr 29, 2015 5:28 pm

Re: STI with Bump plugin

Post 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.
knuxyl
Citizen
Posts: 52
Joined: Sat Aug 13, 2016 4:40 am

Re: STI with Bump plugin

Post 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.
KyleFlores1014
Citizen
Posts: 73
Joined: Thu May 25, 2017 1:43 pm

Re: STI with Bump plugin

Post by KyleFlores1014 »

Sorry, Im new to this. Can I see the outcome? I dont quite get it.
User avatar
jojomickymack
Prole
Posts: 45
Joined: Tue Dec 26, 2017 4:52 pm

Re: STI with Bump plugin

Post 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 10432 times
Attachments
bump_sti.love
(76.67 KiB) Downloaded 386 times
nequals30
Prole
Posts: 9
Joined: Sun Sep 22, 2019 5:54 pm

Re: STI with Bump plugin

Post 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.
green fries
Prole
Posts: 6
Joined: Tue Sep 08, 2020 12:05 pm

Re: STI with Bump plugin

Post 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
green fries
Prole
Posts: 6
Joined: Tue Sep 08, 2020 12:05 pm

Re: STI with Bump plugin

Post by green fries »

bump_init module isn't found in my bump.lua file can anyone send any working bump.lua not from github
green fries
Prole
Posts: 6
Joined: Tue Sep 08, 2020 12:05 pm

Re: STI with Bump plugin

Post 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
RockEt__2580__
Prole
Posts: 12
Joined: Mon Sep 14, 2020 8:36 am

Re: STI with Bump plugin

Post by RockEt__2580__ »

Try changing line 5 to
...
require 'maps.bump'
...
RockEt__2580__
Prole
Posts: 12
Joined: Mon Sep 14, 2020 8:36 am

Re: STI with Bump plugin

Post by RockEt__2580__ »

And set a variable called bump to require bump:

local bump = require "map.bump"
Post Reply

Who is online

Users browsing this forum: No registered users and 9 guests