Mar 25, 2012 at 8:02 PM
Professional Whatever
"Life begins and ends with Nu."
Join Date: Jan 13, 2011
Location: Lasagna
Posts: 4481
Ohhh okay
I thought trail was some fancy assembly term.
I'll take a look tomorrow, I have to work today :/
 
Mar 25, 2012 at 10:55 PM
Absentee Modder
"Ha! Ha! Ha! Mega Man is no match for my Mimiga Man!"
Join Date: Sep 7, 2010
Location: Outside your window. No no, don't check, it's okay
Posts: 272
Age: 29
I've been doing some weapon hacking, trying to turn the Fireball into blades like the Gaudi Armor throw.

To do that, I've got to make it bounce off the ceiling, not just the floor and sides like the fireball does.

Can someone explain to me how the bouncing off walls part of the code works? I know it's the part around 00404D1B-00404D57, but I don't know how it's detecting which side it's hitting, etc.
 
Mar 25, 2012 at 11:02 PM
Been here way too long...
"Life begins and ends with Nu."
Join Date: Jan 4, 2008
Location: Lingerie, but also, like, fancy curtains
Posts: 3054
Fireballs do bounce off the ceiling, I thought.
In any case, when the collision byte is anded with different values, that's how it figures out what's what.

Edit: See Dubby's post down thar v. My notes were WONG :0
 
Mar 25, 2012 at 11:11 PM
Absentee Modder
"Ha! Ha! Ha! Mega Man is no match for my Mimiga Man!"
Join Date: Sep 7, 2010
Location: Outside your window. No no, don't check, it's okay
Posts: 272
Age: 29
Thanks!

... it seems to have an entry for 08, but not for 02.
Curiouser and curiouser...

Just to be clear, WallT is for colliding with the TOP of a wall, yeah? Not for having a wall above the bullet?
 
Mar 26, 2012 at 12:33 AM
Been here way too long...
"Life begins and ends with Nu."
Join Date: Jan 4, 2008
Location: Lingerie, but also, like, fancy curtains
Posts: 3054
Honestly I'm not sure.
This seems to be from a long whiles bach.
I'd figure out by experimentation.
 
Mar 26, 2012 at 12:47 AM
Absentee Modder
"Ha! Ha! Ha! Mega Man is no match for my Mimiga Man!"
Join Date: Sep 7, 2010
Location: Outside your window. No no, don't check, it's okay
Posts: 272
Age: 29
Well, I got it working, although I'm still not sure which one it is lol. Honestly, the whole system doesn't make any sense to me, because it seems like it does the bounce for a given direction only if it's NOT facing that direction. But whatever. It works now, and that's the important part. Thanks again, Lace!
 
Mar 26, 2012 at 1:19 AM
Senior Member
"Ha! Ha! Ha! Mega Man is no match for my Mimiga Man!"
Join Date: Jan 21, 2011
Location:
Posts: 249
x01 = Right-Wall collision (which is the left side of the entity)
x02 = Ceiling collision (which is the top of the entity)
x04 = Left-Wall collision (which is the right side of the entity)
x08 = Floor collision (which is the bottom side of the entity)

Also when handling collisions versus NPCs, their left or right direction is taken into account as the hitrect specifications always understand that the numbers are when the sprite is facing to the right (forward). If they have flag x1000 set, that inverts this consideration.

Also, also bullets do not collide properly with flat sides of sloped tiles. This is because of a limitation in the original engine, although I believe I've found a work around - I just haven't gotten to coding it yet.

Also, also also, when modifying the fireball's bounce behavior, remember to only alter one axis at a time, not both, and based on the existing sign of that axis (positive or negative). (ie: If colliding with the floor (x08), and if Y.vel is positive, then invert it. otherwise do nothing). If not done this way, the fireball will hug the ground, as a bullet collides with a tile many times upon first touching it - especially the fireball. (If the collision in question is moving, don't forget to add the opposing entity's opposite axis to the bullet's, and it doesn't hurt to offset the bullet by +- x200)
 
Mar 26, 2012 at 1:35 AM
Absentee Modder
"Ha! Ha! Ha! Mega Man is no match for my Mimiga Man!"
Join Date: Sep 7, 2010
Location: Outside your window. No no, don't check, it's okay
Posts: 272
Age: 29
Thanks for the info!

x01 = Right-Wall collision (which is the left side of the entity)
x02 = Ceiling collision (which is the top of the entity)
x04 = Left-Wall collision (which is the right side of the entity)
x08 = Floor collision (which is the bottom side of the entity)
Oh, okay, that sounds right, and it explains why it looked like it was the wrong directions before.


(ie: If colliding with the floor (x08), and if Y.vel is positive, then invert it. otherwise do nothing). If not done this way, the fireball will hug the ground

...Huh. That makes sense, but I totally didn't take that into account in the code, and it still works perfectly.
 
Mar 27, 2012 at 3:40 AM
Senior Member
"Ha! Ha! Ha! Mega Man is no match for my Mimiga Man!"
Join Date: Jan 21, 2011
Location:
Posts: 249
That would be because of the size of the display rect versus the hit rect (note that the display rect listed on the compendium is actually the render rect). Depending on the size of those two rects, the fireball may trigger collision calls multiple times for one face of a tile over several frames. It's kind of nasty.
 
Mar 27, 2012 at 11:36 AM
Bonds that separate us
Forum Administrator
"Life begins and ends with Nu."
Join Date: Aug 20, 2006
Location:
Posts: 2846
Age: 33
Quick question out of interest before I forget again: Itoh does have a right-facing sprite, but is there any way to actually access it? <ANP in direction 0002 and the custom entity flags don't appear to do anything.
 
Apr 1, 2012 at 5:34 PM
Junior Member
"Fresh from the Bakery"
Join Date: Apr 1, 2012
Location: Boston
Posts: 12
Age: 24
Can somebody tell me whats the coding to make a warp event(A,k,A a door) ive tried to figure it out on my own but im still kinda confused.
 
Apr 1, 2012 at 5:48 PM
Based Member
"Life begins and ends with Nu."
Join Date: Dec 31, 2011
Location: United States
Posts: 2307
Age: 27
See what this does for you.
 
Last edited by a moderator:
Apr 1, 2012 at 7:25 PM
Junior Member
"Fresh from the Bakery"
Join Date: Apr 1, 2012
Location: Boston
Posts: 12
Age: 24
It helped,i was able to create a door and the sound's all right but it warps me back to the door when i enter it.
Here's my script in case i did anything wrong and a screen.

#0090
<MNA<CMU0008<FAI0000<END
#0091
<MNA<CMU0008<FAI0001<END
#0092
<MNA<CMU0008<FAI0002<END
#0093
<MNA<CMU0008<FAI0003<END
#0094
<MNA<CMU0008<FAI0004<END

#0100
<PRI<CNP0100:0000:0000
<SOU0011<FAO0001
<TRA0012:0091:0037:0011

#0200
<KEY<SKJ0005:0091<PRI<CMU0000<MSG
You Receive a transmition.<NOD<CLO<FL+0430<TRA0018:0500:0002:0000

#0216
<PRI<MSGTEST<NOD<END

#0222
<PRI<MSGYou'r hoverbike,its better to leaveit here.<NOD<END

#0080
<PRI<CNP0100:0000:0000
<SOU0011<FAO0004
<TRA0001:0094:0037:0011


And the screen:
http://img593.imageshack.us/img593/9950/screnniessa1.jpg

And a video of my problem
http://img19.imageshack.us/img19/757/ero.mp4
 
Apr 1, 2012 at 7:40 PM
Based Member
"Life begins and ends with Nu."
Join Date: Dec 31, 2011
Location: United States
Posts: 2307
Age: 27
Either your video file isn't working, or my computer doesn't have the necessary application installed tosee the video. But I'd have to take a guess that your problem is caused by transitioning to the wrong room. See the room number of the room you want it to transition to, and whether or not it matches the first parameter of the <TRA command in event number 100 80. For example, try seeing what happens when you change <TRA0001 to <TRA0002, or <TRA0003, or whatever room you want to transition to.
 
Apr 1, 2012 at 7:50 PM
Offensive User
"Big Joe Tire and Battery Restaurant! Opening Soon! Eat at Big Joes!"
Join Date: Sep 7, 2011
Location: IT'S TIME FOR A SHAQDOWN
Posts: 539
So... where's the script for event 80?
 
Apr 1, 2012 at 8:19 PM
Offensive User
"Big Joe Tire and Battery Restaurant! Opening Soon! Eat at Big Joes!"
Join Date: Sep 7, 2011
Location: IT'S TIME FOR A SHAQDOWN
Posts: 539
Basically, here's how it works:
If there is not event where you tell the it to go to, it will go to its next-of-kin, in which case is event 90 which shows the map name, fade out, and and finally ends the script (also it changes the music but the map music is already the same as before so it won't matter).

Keep in mind, this will also occur if you don't have an <END to any script, excluding things like <TRA and <EVE
 
Apr 1, 2012 at 9:31 PM
Junior Member
"Fresh from the Bakery"
Join Date: Apr 1, 2012
Location: Boston
Posts: 12
Age: 24
Sorry to bother again but how do i chose the warp coordinates?(Where the character appears after going through the door)
After messing around some of the other warping in the game i "sorta" figured it out how to create a door and to get to the area ant but i dont know how to change where on the map i appear.
...I probably should search for some tutorial shouldn't i?Anyway while i do that if anyone can answer me or show me to a good tuto i would be gratefull.
 
Apr 1, 2012 at 9:38 PM
Based Member
"Life begins and ends with Nu."
Join Date: Dec 31, 2011
Location: United States
Posts: 2307
Age: 27
In this code below:

<TRA0012:0091:0037:0011

The thirty seven corresponds to where you character will spawn along the X axis on the map, and the eleven corresponds to where your character will spawn along the Y axis on the map. This tutorial is a very good place to learn how to mod Cave Story.
 
Top