Doors/Teleports

Oct 3, 2009 at 8:03 PM
Junior Member
"Wow! The more I drink of this magical beverage, the more games I can play! Wheee!"
Join Date: Sep 28, 2009
Location:
Posts: 26
Hey guys, I'm sorta new to modding Cave Story. I'm able to edit the maps and such very easily, but I added my own maps in SW, and I'm very, very confused about adding doors. I've looked at examples here, used the search function, and even looked through the original lines of code. Can anyone point me in the right direction?

All I'm trying to do is just teleport from one room (any room) to another room.

Thanks in advance. If you don't understand just say.


EDIT: Also, I've put some code examples I've found into my scripts, changed all the teleport options, and it comes up with an error and has to close out.

Also, I'm using Vista, if that matters...
 
Oct 4, 2009 at 12:13 AM
Level 73 Procrastinator
"Life begins and ends with Nu."
Join Date: Apr 6, 2009
Location: Forgotten Tower
Posts: 2052
Let's take a look at the original script.
Back at the Start Point, you can see the entity 18 is a doorway. You'll also see that flag bit 0x2000 is turned on, which means whenever the player goes up to that entity and pushes the down key, the event number of that entity is ran.
Looking at the event number given to the entity, you can see it's 100, which means event 0100 in the script is what it runs.
Code:
#0100
<PRI<CNP0100:0000:0000
<SOU0011<FAO0001
<TRA0012:0091:0037:0011
<PRI hides the HUD and freezes the player, <CNP makes the doorway disappear, seeming like it opened. <SOU plays the open door sound, <FAO fades out, and <TRA transports the player to map 12, running event 0091, at the X and Y coordinates 37 and 11.
Now, this is only half the needed script. The second half is going to be event 0091 in map 12, which is the First Cave. There's a few simple things newbies tend to forget that ruin the game.
Code:
#0091
<MNA<CMU0008<FAI0001<END
<MNA, not really important, it just displays the map name "First Cave". <CMU sets the music, which is pretty important, but the key thing is <FAI, which fades the game back in, else you'll be stuck with a blank screen. <END, of course, ends the event. {Notice you don't need one for the first event, because the event continues on when the <TRA starts event 0091 on the next map}

So basically, you need an event like the first one to teleport out of a room, and then an event that 'catches' the player when they enter.
<TRA is the most important command here, and it's crucial you know what each of the four sets of digits do.
The first set tells the game which map to send the player to, the second telling them what event to run to 'catch' the player. The third and fourth tell the game where to place the player in the map, using X and Y coordinates. Using CE, you can easily tell the X/Y coords by hovering your mouse over a spot in the editor. The numbers appear at the very top of the window as (X , Y).
 
Oct 4, 2009 at 12:21 AM
Lvl 1
Forum Moderator
"Life begins and ends with Nu."
Join Date: May 28, 2008
Location: PMMM MMO
Posts: 3713
Age: 32
VoidMage_Lowell said:
PRI hides the HUD and freezes the player,

<PRI hides the HUD and freezes the game in general, including npc animations and enemies (like critters hopping). <KEY is what you should use if you want animations to be seen or if you don't care about enemies around you. <KEY locks key input and hides the HUD. <PRI does the same, but freezes all npcs around you as well (pretty much stops the whole game engine until the event tells it to resume).
 
Oct 4, 2009 at 12:29 AM
Level 73 Procrastinator
"Life begins and ends with Nu."
Join Date: Apr 6, 2009
Location: Forgotten Tower
Posts: 2052
GIRakaCHEEZER said:
<PRI hides the HUD and freezes the game in general, including npc animations and enemies (like critters hopping).
Yeah, but it doesn't freeze entity changes.
Which is why you can see the door 'open' when the <CNP runs, even though <PRI came before it.
 
Oct 4, 2009 at 12:36 AM
Lvl 1
Forum Moderator
"Life begins and ends with Nu."
Join Date: May 28, 2008
Location: PMMM MMO
Posts: 3713
Age: 32
VoidMage_Lowell said:
Yeah, but it doesn't freeze entity changes.
Which is why you can see the door 'open' when the <CNP runs, even though <PRI came before it.

I never said it did, you just assumed that freezing the physics/animations engine freezes the rendering engine as well, which is false. If you created smoke (npc type 4) while <PRI was active, I'm sure it would initialize, just it wouldn't run through it's frames/kill itself (it does normally).
 
Oct 4, 2009 at 2:00 AM
Junior Member
"Wow! The more I drink of this magical beverage, the more games I can play! Wheee!"
Join Date: Sep 28, 2009
Location:
Posts: 26
Ah, thanks a lot both of you. The short summary of teleportation was really needed and I think I have a clue on what I'm doing now...

Thanks again! Expect me to ask more questions in the near future :D

EDIT: Hehe, another question. does the <FAI and <FAO number have to be the same?

And I'm pretty confused about the whole flags thing...

Sorry I'm such a newbie >.<
 
Oct 4, 2009 at 2:08 AM
Lvl 1
Forum Moderator
"Life begins and ends with Nu."
Join Date: May 28, 2008
Location: PMMM MMO
Posts: 3713
Age: 32
goldenclaw13 said:
EDIT: Hehe, another question. does the <FAI and <FAO number have to be the same?

And I'm pretty confused about the whole flags thing...

Sorry I'm such a newbie >.<

No, they can be different, and someone should really make a flags tutorial (if one hasn't already been made....).
 
Oct 4, 2009 at 2:14 AM
Level 73 Procrastinator
"Life begins and ends with Nu."
Join Date: Apr 6, 2009
Location: Forgotten Tower
Posts: 2052
More answers

goldenclaw13 said:
EDIT: Hehe, another question. does the <FAI and <FAO number have to be the same?
No, the number just tells the game which way to fade.
I forgot what number means what direction, but you can either have it fade from down, up, left, right, or have it fade from all four corners at one.
goldenclaw13 said:
And I'm pretty confused about the whole flags thing...
Pretty sure I gave a long lecture thingy over these, too...
Or do you mean the bit flags? Like 0x2000, which means an entity will run an event if a player pushes down in front of them.
goldenclaw13 said:
Sorry I'm such a newbie >.<
I suppose we all were, at first...
Or were we? o.o;
 
Last edited by a moderator:
Oct 4, 2009 at 2:22 AM
Junior Member
"Wow! The more I drink of this magical beverage, the more games I can play! Wheee!"
Join Date: Sep 28, 2009
Location:
Posts: 26
Ooh, thanks so very much, I'm really getting the hang of this now...I'll keep working and see if anything works...

I may have to ask more questions very, very soon >.>
 
Oct 4, 2009 at 2:27 AM
Level 73 Procrastinator
"Life begins and ends with Nu."
Join Date: Apr 6, 2009
Location: Forgotten Tower
Posts: 2052
Probably.

You better, we don't want a half-done mod :D
But we'd prefer if you'd ask your questions here from now on.
 
Back
Top