Scripting help

Jul 10, 2009 at 12:05 PM
Neophyte Member
"Fresh from the Bakery"
Join Date: Jul 10, 2009
Location: VIC, Australia
Posts: 6
Hey, I'm just popping in to get some help with a few problems.

I've got a mod started, but there comes a bug where if I 'use' a certain object (A computer to you nitpicks...) the script doesn't run, and I can't use anything else. I can still move, jump, and do all the rest however.

Here's the script for the room. Event #204 is Kazuma 1, #205 is the computer script I'm having trouble with, and #206 is Kazuma 2. I need to do a little reworking to make it a bit more foolproof, though. ;)
Code:
#0090
<MNA<CMU0014<FAI0000<END
#0091
<MNA<CMU0014<FAI0001<END
#0092
<MNA<CMU0014<FAI0002<END
#0093
<MNA<CMU0014<FAI0003<END
#0094
<MNA<CMU0014<FAI0004<END

#0100
<PRI<CNP0100:0000:0000
<FAO0001
<TRA0013:0091:0002:0011

#0101
<KEY<MSGIt's the main fire.<NOD
Keeps everyone toasty.<NOD<CLO<END

#0102
<PRI<CNP0100:0000:0000
<FAO0001
<TRA0004:0091:0000:0000

#204
<FLJ3480:0206<KEY<MM0<WAS<MSG<FAC0010Ah, hello.<NOD
Thought of any names
yet?<NOD<CLR<WAI0020
A transmission?<NOD From
who?<NOD Oh...<NOD<CLR
You might want to
look into it a
little...<NOD<CLO<FL+3480<END

#0205
<KEY<MSG Using your new-
found knowledge of
computers,<NOD you check the
network for any trans-
missions received
recently.<NOD<CLRYou find something
incredible... Better
tell Kazuma.<NOD<CLO<END

#0206
<KEY<MM0<WAS<MSG<...<NOD<CLR<FAC0010THE ISLAND?!<NOD<WAI0080
Oh God...<NOD<CLRLooks like
we have a problem
on our hands...<NOD
Look, I don't care
what, where or how,
we've got trouble
on our hands.<NOD
I'll ready our dragon.<NOD
You go and  get a
weapon from the
safe.<NOD<CLO<FL+3850<END
...Yeah, nevermind the dialog. XP

A download link to the miniminiminiminidemo, if you want to try its 1.5 rooms:
Clicky!

Cheers.
 
Jul 10, 2009 at 12:25 PM
Hax on....Hax off....
"Keep on rollin'!"
Join Date: Jan 5, 2009
Location: Easter Island
Posts: 474
Your problem is that you have a "<" in front of ...
You'd probably be getting an error message with <... or something in it.
This is cause anything in the script with < at the start, is gonna be a command.
<... Isn't a command so it'll come up with a error message.
Apart from that it's fine
 
Jul 10, 2009 at 12:29 PM
Neophyte Member
"Fresh from the Bakery"
Join Date: Jul 10, 2009
Location: VIC, Australia
Posts: 6
Makes me wonder how I possibly missed that... *Facepalm*
Much obliged!

EDIT: I tried it, and fixed a few other things. Now, it plays the Kazuma #1 Message when I use the computer...
Hmm.
Script now:
Code:
#204
<FLJ3480:0206<KEY<MM0<WAS<MSG<FAC0010Ah, hello.<NOD
Thought of any names
yet?<NOD<CLR<WAI0020
A transmission?<NOD From
who?<NOD Oh...<NOD<CLR
You might want to
look into it a
little...<NOD<CLO<END

#0205
<KEY<MSGUsing your new-
found knowledge of
computers,<NOD you check the
network for any trans-
missions received
recently.<NOD<CLRYou find something
incredible... Better
tell Kazuma.<NOD<CLO<FL+3480<END

#0206
<KEY<MM0<WAS<MSG...<NOD<CLR<FAC0010THE ISLAND?!<NOD<WAI0080
Oh God...<NOD<CLRLooks like
we have a problem
on our hands...<NOD
Look, I don't care
what, where or how,
we've got trouble
on our hands.<NOD
I'll ready our dragon.<NOD
You go and  get a
weapon from the
safe.<NOD<CLO<FL+3850<END
 
Jul 10, 2009 at 3:12 PM
In front of a computer
"Man, if only I had an apple..."
Join Date: Mar 1, 2008
Location: Grasstown
Posts: 1435
It must be #0204, not #204.
 
Jul 11, 2009 at 3:01 AM
Neophyte Member
"Fresh from the Bakery"
Join Date: Jul 10, 2009
Location: VIC, Australia
Posts: 6
Damnit, I'm really making foolhardy mistakes here...
Well, it all works fine now. Many thanks.

Questions:
How would I make it so that instead of having to go through a door to access an area, I would be able to just walk to the edge of the area?
How would I make something appear if a certain flag is set?
 
Jul 11, 2009 at 3:15 AM
Level 73 Procrastinator
"Life begins and ends with Nu."
Join Date: Apr 6, 2009
Location: Forgotten Tower
Posts: 2052
Experience

Pretty straight forward stuff, once you've learned enough about Cave Story.

The first one can be achieved by placing a Horizontal/Vertical Trigger entity {#46} on the edge the player's going to walk to. {Like right on the edge}
If the player's walking to the sides of a map, not the top and bottom, then you'd want to set the Horiz/Vert Trigger's "Option 2" flag {0x1000}, that'll make it so it'll run whatever event it's tagged to when the player reaches above or below it's position, making it a Vertical Trigger.
If you were going to make it so they'd move to another room upon reaching the top or bottom, like forsay in The King's Table, you'd set the "Option 2" flag {0x0100}, making it so it triggers when the player goes on either side of it, becoming a Horizontal Trigger.
Do note that the trigger's don't go off if there's a tile inbetween them and the player. I'm not sure which all work, but anything solid or even "No NPC" tiles will block them.

To make something appear when a flag is set involves more bit flags, like with the Horiz/Vert triggers.
Simply set the entities "Appears once FlagID is set" bit {0x0800} and set it's Entity ID to whatever flag you're planning for it.
Another note, the entities will not change instantly when the flags are set, so if you had it set so a bunch of critters would appear all around the player when he touched a Horiz/Vert trigger, and you did it by setting their flags on, they won't appear until after the player leaves and enters the room again.

Don't worry about foolhardy mistakes, with time comes ease.
At least you already figured out how the dialog works, no?
The more you mod, the easier it gets.
 
Jul 11, 2009 at 6:25 AM
Neophyte Member
"Fresh from the Bakery"
Join Date: Jul 10, 2009
Location: VIC, Australia
Posts: 6
Perfect. Thanks very much. I'll be back with more questions no doubt. :(
 
Back
Top