Enemy Range Above and Below Players for Same Altitude & Jump-Float Stuck to Moving Platforms

maxman

Well-known member
I have two issues that I need to get 'em resolved.

Issue #1:
When the enemy is above you at the second floor, while you're at the first floor, I'd like the enemy to act like he's not taking any action until you show up at the same floor as him. This level should not start from left-right direction, but from bottom to top like you play a vertical shooter from Ikari Warriors. Problem is when I spawn all enemies without setting groups, it lags the gameplay greatly. What I'm trying to do is to make enemies not do anything until they encounter the player. Plus, I'd like to spawn them in groups with Y value, similar to X value. Should I use scrollz for this? I already limited a number of enemies into 8 in 1 max (group 8 1; at 0), and it didn't lag this time. The player spawns at the bottom right, while direction is set as both. I'm having enemies that are on the left side. I'm not sure if it's correct.

Code:
spawn  box
alias  box
coords 190 2137 0
item coin
at 0

spawn    MalePur1
@script
void main(){
void self = getlocalvar("self");
performattack(self, openborconstant("ANI_FOLLOW9"));
}
@end_script
alias    Purifier
coords -120 2137 0
flip 1
at 0

spawn    Beamer2
alias    Beamer
coords -140 2137 130
flip 1
at 0

spawn  box
alias  box
coords -150 2137 0
item coin
at 0

spawn    SGunPur2
alias    Purifier
coords -200 2137 0
at 0

spawn    Beamer2
alias    Beamer
coords -360 2137 130
flip 1
at 0

spawn    MalePur1V
@script
void main(){
void self = getlocalvar("self");
performattack(self, openborconstant("ANI_FOLLOW9"));
}
@end_script
alias    Purifier
coords -355 2137 0
flip 1
at 0

spawn    FemPur
@script
void main(){
void self = getlocalvar("self");
performattack(self, openborconstant("ANI_FOLLOW9"));
}
@end_script

alias    Purifier
coords -390 2137 0
flip 1
at 0

Here's a concept for how it should be set up for having enemy range within the same altitude. The player is below the enemy waiting for his target to show up as he's idling.

range within same altitude.png

The enemy shouldn't take any action until the player walks to a certain point within the same altitude they are in. It's like range, but the difference is detecting the Y axis where its target is, either below or above.

I already coded a platformer before and can start from left to right without using groups and waits. Now, I want to learn a new one. It's having a new enemy spawn order within Y axis, but more freedom with the camera panning to follow you left or right directions in X axis.

Issue #2:
When I jump on the moving platform, the character gets stuck to it as it's bound like the example here from @DJGameFreakTheIguana's Sega Brawl mod, which I pointed out years ago. The platform moves up and you jump. But when you're in a jump mode before landing, you get stuck to it until you are free to move. Maybe it depends on how high the player jumps and how fast the platform moves. Not sure.
12-20-15-7-41-17-PM.gif


How can I make the player land properly without getting stuck in a jump mode action? I tried using landframe in anim jump when the platform moves up, but it doesn't skip to its landing frame.
 
I'd like the enemy to act like he's not taking any action until you show up at the same floor as him.

You'd need to design and code enemy's AI manually. First, you need to decide what the enemy will do while waiting for player to be in the same level. Then what enemy will do if player gets to same level. Then what enemy will do if player leave the enemy without killing the enemy. Those would be the basics.

In general, for vertical stage such as building stage, you might need to code scripted camera which moves in only one direction. Any enemy left behind by camera will be removed and player can't go back.
 
You'd need to design and code enemy's AI manually. First, you need to decide what the enemy will do while waiting for player to be in the same level. Then what enemy will do if player gets to same level. Then what enemy will do if player leave the enemy without killing the enemy. Those would be the basics.
Thank you, Bloodbane. Sorry for making another topic on this spawn-range thing, but the main reason for it is that I was confused whether the trap type entities should be set in groups or not. It was about enemies here, but now it's about type trap.

I think I'm gonna make a waiting animation for the trap depending on how far you are. For example, let's say that the trap is in the very middle while you're at the very bottom. You go up and the screen shows that there's a trap playing its idle actively, but only if the camera views the trap in the screen. If you walk past the trap and the trap is already offscreen from being viewed, the trap should not play its idle, meaning it would act like it's not active until the camera views it with where you are. It's to not kill it off, but let it act like it's not active offscreen.

In general, for vertical stage such as building stage, you might need to code scripted camera which moves in only one direction. Any enemy left behind by camera will be removed and player can't go back.
For the scripted camera for vertical stages, I'm gonna save that for another mod or another level if time comes.
 
Issue #2:
When I jump on the moving platform, the character gets stuck to it as it's bound like the example here from @DJGameFreakTheIguana's Sega Brawl mod, which I pointed out years ago. The platform moves up and you jump. But when you're in a jump mode before landing, you get stuck to it until you are free to move. Maybe it depends on how high the player jumps and how fast the platform moves. Not sure.
12-20-15-7-41-17-PM.gif


How can I make the player land properly without getting stuck in a jump mode action? I tried using landframe in anim jump when the platform moves up, but it doesn't skip to its landing frame.
Man this feels like a lifetime ago, lol. I never really understood why that happened like that, but that issue is why I had the platforms move quick like that, because making them go slower made it worse, iirc. It's weird to because in another level, I did have platforms going up and down very slowly, but they were meant to be floating in water, so the issue didn't come up then.

BTW, this was Sonic Adventure Revolution, not Sega Brawlers, but that titles for that level were used in SB first.

x)
 
Back
Top Bottom