Jump to content


trope

Member Since 25 Nov 2006
Offline Last Active Feb 23 2012 10:07 PM

Posts I've Made

In Topic: Simple array as Inventory... HA not for me

22 February 2012 - 03:44 AM

2. you got theese:
A: object_get_name(object_index)
if the name is small_sword_obj, then you can use string_replace_all to switch out all the _ with spaces .. and string_copy with string_length - 4 to remove the _obj part



Cool, I was actually on the same path as this initially, then I abandoned the idea! I made each object 24x24 as well as 48x48, and added "small_" to the name, just as you proposed! Since I already have these images, implementing your suggested solution shouldn't be too difficult.

It makes me feel good I was somewhat close/on the right track!

Thanks again, everyone. If I can ever get my toddler to sleep, I will try to bang this out!

In Topic: Simple array as Inventory... HA not for me

22 February 2012 - 03:40 AM

Oh oh oh! I just did this! (it think) I used a video to figure it out.
here maybe it can help you too?
http://www.wizirdi.com/en/tutorials/gml-tutorial-part-2/


watching....  :biggrin:

In Topic: My Rollover routine is RIDICULOUS

22 February 2012 - 03:33 AM

Is there a reason you're putting a button baked into the background image? Usually buttons are kept separate, so you'd have a blank spot in the background there. Your button object would always be in that position, but it would have a 2-frame sprite: one frame that's darkened and another that's bright. Then you can just use the Mouse Enter and Mouse Leave events to change the image_index appropriately.

-IMP


That was mistake on my part early on. I thought I could compensate for the error one way or another during development.

Both your, and ParodyKnaveBob's recommendations are far better than what I have. I think I will try to implement both and see how it goes.

Thanks. I will update this post and let you all know how it goes.

Trope

In Topic: Parent Question

21 February 2012 - 07:46 AM

Ok, I got it. I played around with instances and objects until I fully got it.

Got it!

Thanks,

In Topic: Parent Question

20 February 2012 - 10:18 PM


Simply, if I create the child object in the room , is the parent object automatically created?

No. You create an instance of the child object in the room, the child object is only a template for that. The parent object is never directly involved.

You need to sort out the difference between instances and objects, that is something that is severely lacking in many GMC members.

GameGeisha



TO: GameGeisha

Yep, I agree 100%. As a matter of fact, I was drafting a question targeting that VERY SPECIFIC topic.

Now PLEASE, all you GM GML experts, don't take offense to this, but in my opinion, the documentation is VERY unclear on distinguishing between instance id, object index, etc etc. Now, please bare in mind - as with all languages, once you hit that "AH-HA!" moment, it's all trivial. But I am not there yet.

I have spent MANY hours trying to implement a simple inventory system where a player collides with an object, and is added to an inventory array. BELOW IS MY ENTIRE GAME.

I have avoided asking too many questions here, but now I am utterly at a loss.

Thanks. Please have a look if you don't mind.


http://www.mediafire.com/?t1nzfaqdn52r116