Jump to content


Photo
- - - - -

Instance Creation Code


  • Please log in to reply
100 replies to this topic

#21 Blazed Pyro

Blazed Pyro

    Pyro Tech

  • New Member
  • 50 posts

Posted 31 March 2007 - 03:18 AM

Wow thanks Chronic, ive been banging my head against my desk wondering how to do this, and wondering why game maker didn't have it...

- Pyro
  • 0

#22 Kapser

Kapser

    GMC Member

  • GMC Member
  • 1584 posts

Posted 31 March 2007 - 03:28 PM

I just learned this function from another tutorial 2 minutes ago. I can't believe I did'nt know that. :D
  • 0

#23 Mattz

Mattz

    GMC Member

  • New Member
  • 57 posts

Posted 31 March 2007 - 11:01 PM

Wow, I never new about this, now I can have 1 object and rotate it within the room... Thankyou so much for this!

Mattz
  • 0

#24 cronus616

cronus616

    Cronus Games, co.

  • New Member
  • 394 posts

Posted 01 April 2007 - 09:00 PM

wow.
i didnt know that
  • 0

#25 Excalibur333

Excalibur333

    GMC Member

  • GMC Member
  • 347 posts
  • Version:Unknown

Posted 03 April 2007 - 07:02 PM

Cool I just found this a few days ago it is pretty nice.
Excalibur
  • 0

#26 Twisted-Liquid

Twisted-Liquid

    GMC Member

  • GMC Member
  • 497 posts

Posted 03 April 2007 - 08:18 PM

Love it! wish i knew sooner. I already made a billion objects that one single object could have done for my current project.
  • 0

#27 GloryAndBen

GloryAndBen

    Game Programmer

  • GMC Member
  • 943 posts

Posted 04 April 2007 - 10:27 PM

Now I don't need to make so many goddam objects over minor differences...
Thanks for this!
  • 0

#28 Alex

Alex

    3lite Member

  • New Member
  • 3098 posts

Posted 06 April 2007 - 06:00 AM

Wow. I can't believe all this time it was written there in plain English and I never tried it. Thanks for this. This will definitely solve a lot of problems.
  • 0

#29 The_Cookie_Monster

The_Cookie_Monster

    GMC Member

  • New Member
  • 217 posts

Posted 06 April 2007 - 08:50 PM

Wow, nice, cool, this will help alot!

You deserve a cookie now!
  • 0

#30 Daniel-Dane

Daniel-Dane

    GMC Member

  • New Member
  • 3581 posts

Posted 06 April 2007 - 10:17 PM

I can't believe that so many didn't know of this. There are both the manual and the explanation in the room editor. Good someone wrote this :blink:.
  • 0

#31 Blue_Ninja_Frog

Blue_Ninja_Frog

    GMC Member

  • New Member
  • 304 posts

Posted 07 April 2007 - 02:13 AM

Okay, question. Exactly WHEN do the actions in the Instance Creation Code get executed? In order to use this properly I will need to know this.
  • 0

#32 Chronic

Chronic

    Administrator

  • Global Moderators
  • 2713 posts
  • Version:GM:Studio

Posted 07 April 2007 - 09:07 AM

All i know is that its sometime before the instances create event. You'll have to do your own tests to see if anything is ran any earlier if required.
  • 0

#33 Daniel-Dane

Daniel-Dane

    GMC Member

  • New Member
  • 3581 posts

Posted 07 April 2007 - 09:37 AM

Okay, question. Exactly WHEN do the actions in the Instance Creation Code get executed? In order to use this properly I will need to know this.

<{POST_SNAPBACK}>

Why didn't you test it first?

Here is the order: (GM7)
1. Creation code
2. Create event
3. Game start event
4. Room start event
  • 0

#34 Jenner

Jenner

    Jenner

  • GMC Member
  • 904 posts

Posted 07 April 2007 - 09:54 AM

Thanks a lot Chronic, you just made my life a lot easyer. Please if you have more tricks like this one POST IT!
  • 0

#35 Grego

Grego

    GMC Member

  • New Member
  • 1155 posts

Posted 07 April 2007 - 11:32 AM

First, in the current room (if any) all instances get a room-end event. Next the non-persistent instances are removed (no destroy event is generated!).
Next, for the new room the persistent instances from the previous room are added.
All new instances are created and their creation events are executed (if the room is not persistent or has not been visited before).
When this is the first room, for all instances the game-start event is generated.
Now the room creation code is executed.
Finally, all instances get a room-start event.


Is that what you meant about the order..?
  • 0

#36 PLAY: More

PLAY: More

    Press F8 to enter BIOS

  • New Member
  • 824 posts

Posted 07 April 2007 - 11:53 AM

All i know is that its sometime before the instances create event. You'll have to do your own tests to see if anything is ran any earlier if required.

<{POST_SNAPBACK}>

I think it's after the Room Start but before Instance Create event.
  • 0

#37 Blue_Ninja_Frog

Blue_Ninja_Frog

    GMC Member

  • New Member
  • 304 posts

Posted 07 April 2007 - 04:24 PM

In my experiences with it, It runs before the create event which became a bother due to unknown variables and the like >.>
  • 0

#38 Splayer

Splayer

    GMC Member

  • New Member
  • 130 posts

Posted 17 April 2007 - 04:09 AM

Wow! Someone sticky this now! You have no idea how many problems this solves that i've had in the past. Thank you so much!
  • 0

#39 Igl00

Igl00

    GMC Member

  • New Member
  • 327 posts

Posted 19 April 2007 - 12:37 PM

Hmm... Why is it, that almost all the ppl here on GMC, didn“t knew that function? It was, kinda the first thing i learned, when i decided to start coding... Weird!
  • 0

#40 dark_master4

dark_master4

    GMC Member

  • GMC Member
  • 1176 posts
  • Version:GM:Studio

Posted 19 April 2007 - 01:32 PM

I knew this function existed 'cause I did read the whole manual... But I don't know why, I kinda forgot to use it because of everything I was learning at the same time. You tut is well done and did remind me this existed and I'll definetly use it in the futur, if needed.
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users