Tiled Map Engine

By the way, I’ve opened up a new topic for it here; please comment on it to follow up.

http://forums.coronalabs.com/topic/42355-dusk-engine/

  • Caleb

Hey guys,

first of all I really like the Tiled Map Engine and the Tiled Map Editor.

I am doing pretty fine in creating levels with the editor but as soon as it comes to defining collisions on layers within the layers properties by adding “physics:enabled = true” and save and export the map and load it into my lua game - I get a Runtime error saying that ther is a error in file "… Dusk/dusk_core/layer/tilelayer.lua on line 35 and “Attempt to call global ‘tprint_error’ (a nil value)”.

Does anyone have a clue what I am doing wrong?

Would be so happy if you could give me an advise on this… Thanks so far in advance and cheers,

Johannes

You’re adding physics:enabled = true without require()-ing physics before you do it.

That’s my first assumption, though it shouldn’t be giving you that error (that’s a coding problem in the engine, but it still served to alert you of the error :))

  • C

Hi Calep P,

thank you for your reply.

Unfortunately (from my point of view) I required physics like following:

require( "physics" ); physics.setDrawMode( "hybrid" ); physics.start( ); physics.setGravity( 0, 10 );

But I get the error shown like in my last posting. The interesting thing is that everything is working until I add the “physics:enalbed = true” to one layer in the tileMap Editor.

So I dont know what causes the error :frowning:

You got any further ideas/hints/tipps/anything? This is really depressing ;-(

Are you doing that before require()-ing Dusk?

  • C

OMG – now I got it !!! Thank you so much!!!

I didnt know (yet) that I had to declare the physics before requireing the dusk engine. Thanks again!

Cheerio,

Johannes =D

Normally, it would tell you (using the function “tprint_error”), but it couldn’t find that function, so you got that error instead of a nice pretty-printed one :slight_smile:

  • C

good to know - I ll keep that one in mind - cheers :wink:

Hey guys,

first of all I really like the Tiled Map Engine and the Tiled Map Editor.

I am doing pretty fine in creating levels with the editor but as soon as it comes to defining collisions on layers within the layers properties by adding “physics:enabled = true” and save and export the map and load it into my lua game - I get a Runtime error saying that ther is a error in file "… Dusk/dusk_core/layer/tilelayer.lua on line 35 and “Attempt to call global ‘tprint_error’ (a nil value)”.

Does anyone have a clue what I am doing wrong?

Would be so happy if you could give me an advise on this… Thanks so far in advance and cheers,

Johannes

You’re adding physics:enabled = true without require()-ing physics before you do it.

That’s my first assumption, though it shouldn’t be giving you that error (that’s a coding problem in the engine, but it still served to alert you of the error :))

  • C

Hi Calep P,

thank you for your reply.

Unfortunately (from my point of view) I required physics like following:

require( "physics" ); physics.setDrawMode( "hybrid" ); physics.start( ); physics.setGravity( 0, 10 );

But I get the error shown like in my last posting. The interesting thing is that everything is working until I add the “physics:enalbed = true” to one layer in the tileMap Editor.

So I dont know what causes the error :frowning:

You got any further ideas/hints/tipps/anything? This is really depressing ;-(

Are you doing that before require()-ing Dusk?

  • C

OMG – now I got it !!! Thank you so much!!!

I didnt know (yet) that I had to declare the physics before requireing the dusk engine. Thanks again!

Cheerio,

Johannes =D

Normally, it would tell you (using the function “tprint_error”), but it couldn’t find that function, so you got that error instead of a nice pretty-printed one :slight_smile:

  • C

good to know - I ll keep that one in mind - cheers :wink:

Sorry to ask this, but i searched for the entire forum before.

Whats is the properties i need to set on an object, tile, or layers to make then a body. They dont colide with my sprite. I was using lime and was working.

I found the properties objects:bodyType and tile:… here in forum. But i think is missing something or i am using wrong. Where do i use this properties? Is on Properties on Tiled right?

This is actually the original old post… The new one is http://forums.coronalabs.com/topic/42355-dusk-engine/. If you’ll post there instead, that would be good.

However, to answer your question, the properties you’re looking for are the physics: properties. You can make a single object or tile physical by adding physics:enabled = true to your object or tile properties, or the entire layer physical with physics:enabled = true as a property on the layer. Each parameter you need to add to the physics options (bounce, density, etc.) are all just the name prefixed with physics: - physics:bounce, physics:density, etc.

I think I have something about this in the docs; just open docs/index.html (from the main Dusk project folder) up in your browser and go to FAQ.

  • Caleb

I’m locking this thread since there is a new one being used.  Please continue the conversation here:

http://forums.coronalabs.com/topic/42355-dusk-engine/

Thanks

Rob

Sorry to ask this, but i searched for the entire forum before.

Whats is the properties i need to set on an object, tile, or layers to make then a body. They dont colide with my sprite. I was using lime and was working.

I found the properties objects:bodyType and tile:… here in forum. But i think is missing something or i am using wrong. Where do i use this properties? Is on Properties on Tiled right?

This is actually the original old post… The new one is http://forums.coronalabs.com/topic/42355-dusk-engine/. If you’ll post there instead, that would be good.

However, to answer your question, the properties you’re looking for are the physics: properties. You can make a single object or tile physical by adding physics:enabled = true to your object or tile properties, or the entire layer physical with physics:enabled = true as a property on the layer. Each parameter you need to add to the physics options (bounce, density, etc.) are all just the name prefixed with physics: - physics:bounce, physics:density, etc.

I think I have something about this in the docs; just open docs/index.html (from the main Dusk project folder) up in your browser and go to FAQ.

  • Caleb