Pages: [1]
  Print  
Author Topic: oPlayer1 object creation?  (Read 613 times)
Massif
Seedling
*
Posts: 5


View Profile
« on: January 01, 2011, 12:31:29 PM »

I'm curious where the oPlayer1 object is created in normal levels. From looking at the code, I can see that custom levels create it in scrLoadLevel and the Title screen level has multiple instance_create calls (one for each entrance). Does the instance that is created in the Title screen get carried through to each level?

Thanks in advance to anyone who can answer this Smiley
Logged
halibabica
Bossy
Mossy
*
Posts: 1921


*whipcrack*


View Profile WWW Email
« Reply #1 on: January 01, 2011, 01:00:32 PM »

I tried to track this down once myself, but I couldn't find it.  The player object is created in a bunch of different places on the title screen and at the entrance for custom levels, but I don't know where exactly the code generates it for normal levels.  The object isn't persistent, nor is it present in transition screens, so there's no way it's the same one from the start.  Unless I'm horribly mistaken, that is.
Logged

Sometimes I wonder if I like Spelunky too much.
ManTrap mod - Tastes Like Spelunky
Hand-drawn comic - Spelunkying
Moloch
Mossbaby
*
Posts: 373



View Profile WWW
« Reply #2 on: January 01, 2011, 04:58:19 PM »

Check the rooms themselves in the room editor (rLevel, rLevel2, etc). Move the oRoom object that's in the upper left corner and you'll see oPlayer1 behind it!  Wink
Logged

Wonkyth
Big Bossy
Mossy
*
Posts: 1964



View Profile
« Reply #3 on: January 01, 2011, 08:40:59 PM »

Man, it seems GM could really use a better code editor.
Copy the source into another text editor and use a search function to find references to whatever it is you need.
Logged

"I love doing research on dentist"
I AM A ROCK GOD!
Tastes Like Spelunky: Rock the Ate's!
I make chiptunes!
Massif
Seedling
*
Posts: 5


View Profile
« Reply #4 on: January 01, 2011, 09:31:16 PM »

That's exactly what I did. I exported all of the scripts to a text file and each individual object to its own file (soooo time consuming) and searched for oPlayer1.

Moloch was right though. The player instance was hidden behind the big red square in each level.
Logged
Moloch
Mossbaby
*
Posts: 373



View Profile WWW
« Reply #5 on: January 02, 2011, 12:49:55 PM »

That's exactly what I did. I exported all of the scripts to a text file and each individual object to its own file (soooo time consuming) and searched for oPlayer1.

 Shocked
For scripts, go to Scripts menu > "Search in Scripts.."
For objects go to Edit menu > "Show Object Information" (Game Maker will freeze up for a few seconds) to get every object in one file.
Logged

halibabica
Bossy
Mossy
*
Posts: 1921


*whipcrack*


View Profile WWW Email
« Reply #6 on: January 02, 2011, 04:37:25 PM »

Ah, that explains it!  The player object isn't created by a script; it's just relocated at from behind the wall at the start of the room.  I would bet this has something to do with how many objects require the existence of oCharacter to function properly.

But whatever, we have our answer!
Logged

Sometimes I wonder if I like Spelunky too much.
ManTrap mod - Tastes Like Spelunky
Hand-drawn comic - Spelunkying
Pages: [1]
  Print  
 
Jump to: