Pages: [1]
Author Topic: functions?  (Read 2587 times)
Posts: 1

View Profile
« on: January 22, 2010, 08:22:28 PM »

Hello, I'm currently making a basic Spelunky mod and learning Gamemaker syntax and built-in variables and functions at the same time.  A few questions:

I noticed that while using the instance_crate function, the object location variables obj.x and obj.y are called directly without 'get' functions?
Do I use instance_exists or object_exists in order to determine if there's a brick, block, tree etc. at that specific square?
Is there a simple argument that I can add to exists that determines if there's an obstacle (which can be in a whole range of objects from blocks to trees)?

Thank you!
Big Bossy
Posts: 9806

The will of the Galaxy.

View Profile WWW Email
« Reply #1 on: January 22, 2010, 09:00:47 PM »

I might be wrong but
instance_exists= means one object (one bullet, not all bullets)
object_exists = one type of object (bullets, not trees)

And there is a drag and drop for "If object is at X Y," but I don't know the code off hand.

Show your power, Gun Del Hell! Show them their fate! Yes! Yes! Yes! Yes! Yes! Here we go! Let's go, go, go, go, Django! Light and Dark! It comes down to this! Be afraid, Sun!
Posts: 97

View Profile
« Reply #2 on: January 23, 2010, 02:30:08 AM »

You should read the GM8 help first. Go to the index and type in instance_exists and object_exists and you will see that that's all they tell you: whether or not that one thing exists somewhere.

Second, you should look through the existing code. There are a number of functions used for checking whether something is somewhere, depending on the situation. collision_rectangle and instance_position are the two most common (IIRC).
Pages: [1]
Jump to: