Decided to not use register resource on items since all that stuff is too dynamic but using it in cases where the image is attached to an object. (Not dynamic)
This approach is much better and working well. Apologies for all the posts. xD
Search found 75 matches
- Wed May 20, 2015 8:53 pm
- Forum: Support and Development
- Topic: Saving objects
- Replies: 18
- Views: 5538
- Wed May 20, 2015 7:22 pm
- Forum: Support and Development
- Topic: Saving objects
- Replies: 18
- Views: 5538
Re: Saving objects
Ugh.. nope. Trying to serialize unregistered userdata image This is starting to annoy me now. Right. I am registering the image but then I thought maybe the registered class is missing. So then I try it all and still see this message about unregistered userdata. What on earth is going on? for i=1,#i...
- Wed May 20, 2015 7:06 pm
- Forum: Support and Development
- Topic: Saving objects
- Replies: 18
- Views: 5538
Re: Saving objects
Think I got it.. almost. Not sure how to go about checking if resource already exists though. Failing on some images used more than once.
- Wed May 20, 2015 6:42 pm
- Forum: Support and Development
- Topic: Saving objects
- Replies: 18
- Views: 5538
Re: Saving objects
Right so I will come back to tackle this. I was delighted because I seemed to get the save game working. However since I ran into trouble I converted any images to strings and draw the images from that. I ended up getting save/load working BUT broke the game quite badly somehow. I will start again b...
- Wed May 20, 2015 6:26 pm
- Forum: Support and Development
- Topic: STI: Get current Position on map?
- Replies: 9
- Views: 2866
Re: STI: Get current Position on map?
Thanks Karai, setting the sprite.x, sprite.y.
I should probably make everything depend on player.x, player.y but im afraid I will break it all. :S
I should probably make everything depend on player.x, player.y but im afraid I will break it all. :S
- Wed May 06, 2015 7:08 pm
- Forum: Support and Development
- Topic: STI: Get current Position on map?
- Replies: 9
- Views: 2866
Re: STI: Get current Position on map?
How do I set tx and ty for STI library on load?
- Tue May 05, 2015 6:08 pm
- Forum: Support and Development
- Topic: STI: Get current Position on map?
- Replies: 9
- Views: 2866
Re: STI: Get current Position on map?
..but you see I'm already storing player.x, player.y. Its easier to just save these values instead of separate code to save tx,ty.
How do I set player location on load?
How do I set player location on load?
- Tue May 05, 2015 3:52 pm
- Forum: Support and Development
- Topic: STI: Get current Position on map?
- Replies: 9
- Views: 2866
Re: STI: Get current Position on map?
Thanks! So in the draw() method I can set it like this: player.x,player.y = tx,ty This works fine for saving the correct map position. However, how would I load the position? Putting tx,ty in load() won't work even if I make those tx,ty vars global. Doing this in draw() is also wrong because I only ...
- Mon May 04, 2015 9:00 pm
- Forum: Support and Development
- Topic: STI: Get current Position on map?
- Replies: 9
- Views: 2866
STI: Get current Position on map?
So basically I am using STI for my project. Implemented in probably a terrible way but it "just works" for what I need which is loading a TMX map file. As I moved onto file saving one thing I am missing is the player position on the map. player.x and player.y are useless because those are ...
- Mon May 04, 2015 8:36 pm
- Forum: Support and Development
- Topic: Saving objects
- Replies: 18
- Views: 5538
Re: Saving objects
Awesome lib dude! Thanks!