In Progress Night Stalkers by danno

The project is currently under development.
I've spent most of my time working on game breaking bugs recently, I discovered that the version I'm working on is essentially just a demo that Bonusjz released, his finally version which is mostly bug free as I've been doing many comparisons is in .spk unfortunately, so I've been playing catch up fixing bugs that are not in the secure pak final version, not only are the players throws bugged but the enemy throws are bugged too as they use the same outdated code so I'll have to recode enemy throws also, Throwing next to a wall teleports thrown entity onto the top of the wall which I've fixed with most characters but I've had to go through all the throws AGAIN.

Anyways here's a mock up of the new character select screen I'll be working on after I've squished more bugs.

woGNn9P.jpg
 
I love the new select screen!
By seeing how will be displayed the roster. It really looks like it will be a balanced one ;)

I'm not sure for the blue and red "only" for p1 and p2.
I imagine some borders of sprites/a frame. I would try something, but as you know, I'm already very involved in some sprite work right now :)

good luck with updating the throws!
 
Throwing next to a wall teleports thrown entity onto the top of the wall
This is the default behavior of the engine - if an entity is inside a wall, the engine moves that entity to the top of the wall up to a certain limit (1000px). If the wall is higher than this limit, the entity is removed (dead).

You can use an "antiwall" code to correct this - I use one that takes into account if you are on a wall too, as it can happen if you are on a wall that acts as a platform.

Kratus uses it differently - and very cleverly: In the fall animation of enemies, instead of whoever attacks.

As I abused the throws in my game, I think I can give you some tips that I use:

- Never use the Y position at 0 (I usually use 3), because if the entity is in a Fall animation and has a 0 position, the engine understands that it fell to the ground and the enemies will be able to use the riseattack during the throw.

- Whenever you "release" the entity you were grabbing, remember to set the position on the X axis to 0 - This ensures that the enemy will not be removed or stuck somewhere

- Remember to do the same on the Z axis too, because if you use walls to delimit where a character walks in a scenario and drop an enemy "behind" you on the Z axis, the engine will do the same procedure to remove it.

Edit: confirme, the max wall height before the entity is removed is 1000px
Code:
MAX_WALL_HEIGHT     = 1000;					// Max wall height that an entity can be spawned on
 
Thanks man, I have used anti wall and your tips releasing/not releasing at 0, I wished I knew a month ago but I eventually figured it all out hahaha, sometimes the default engine behaviour makes me want to quit hahaha but I understand
 
danno said:
Thanks man, I have used anti wall and your tips releasing/not releasing at 0, I wished I knew a month ago but I eventually figured it all out hahaha, sometimes the default engine behaviour makes me want to quit hahaha but I understand
On that case, the engine is doing right: if the entity wasn't removed, it will be stuck forever inside the wall and the game won't continue.
Also I've confirmed: its 1000px
MAX_WALL_HEIGHT    = 1000; // Max wall height that an entity can be spawned on
 
danno, While editing some stuff i do see a bunch of antiwall codes tho, i wonder how much buggier it would be if they weren't there.
 
nedflandeurse said:
I'm not sure for the blue and red "only" for p1 and p2.
I imagine some borders of sprites/a frame.

Thanks Ned, I made a mini picture frame :)  I just put plain colours for placement

1L8S5Nx.jpg


Thanks O ilu for the tips I highly appreciate it, The angle of walls is important too, I found flat walls are not too bad with scripted throws

https://www.youtube.com/watch?v=BDYi6YXjDTI

I need to make the landings smoother which I'll do later so It doesn't look too noticeable

oldyz do you mean the anti wall inside enemy walk and idle animations? they are just their to prevent the wall teleport when entity is grabbed near a wall
 
O_Ilusionista
Kratus uses it differently - and very cleverly: In the fall animation of enemies, instead of whoever attacks
Thanks buddy! Yeah, I'm using the antiwall script at the moment the grabbed entity is released by the grabber.

danno
Buddy, in case you want to know how the script works, I posted it below:

Code:
void throw(int damage, int type, int Vx, int Vy, int Vz, int face)
{//Damage as throw finisher
	void self 	= getlocalvar("self");
	void target = getentityvar(self,"grabbed");
	int z 		= getentityproperty(self,"z");
	int tDir 	= getentityproperty(target,"direction");
	int vDir;
	
	if(face == 0){ //SAME FACING?
		vDir = tDir;
	}

	if(face == 1){ //OPPOSITE FACING?
		if(tDir == 0){ //FACING LEFT?
			vDir = 1;
		}else{
			vDir = 0;
		}
	}

	if(target != NULL()){
		void eType = getentityproperty(target,"type");
		int dir    = getentityproperty(target,"direction");
		void atkType;
		void projectile;
		
		if(dir == 0){Vx = -Vx;}
		if(type == 1){atkType = openborconstant("ATK_NORMAL8");}
		if(type == 2){atkType = openborconstant("ATK_NORMAL9");}
		if(z > (openborconstant("PLAYER_MIN_Z")+openborconstant("PLAYER_MAX_Z"))/2){Vz = -Vz ;}
		
		if(eType == openborconstant("TYPE_PLAYER") || eType == openborconstant("TYPE_NPC")){
			changeentityproperty(target, "projectilehit", "type_player", "type_npc", "type_obstacle");
		}
		else
		if(eType == openborconstant("TYPE_ENEMY")){
			changeentityproperty(target, "projectilehit", "type_enemy", "type_obstacle");
		}
		
		damageentity(target, self, 0, 1, atkType);
		changeentityproperty(target, "direction", vDir);
		changeentityproperty(target, "aiflag", "projectile", 1);
		changeentityproperty(target, "damage_on_landing", damage); //RESET PROJECTILE STATUS TO 0 WHEN FALL ON THE GROUND, TOTAL DAMAGE
		tossentity(target, Vy, Vx, Vz); //TOSS OPPONENT
		antiWallG();
		setentityvar(self, "grabbed", NULL()); //CLEAR ENTITYVAR
	}
}

Code:
void slam(int damage, int type, int Vx, int Vy, int Vz, int face)
{//Damage as slam finisher
	void self 	= getlocalvar("self");
	void target = getentityvar(self,"grabbed");
	int tDir 	= getentityproperty(target,"direction");
	int vDir;
	
	if(face == 0){ //SAME FACING?
		vDir = tDir;
	}

	if(face == 1){ //OPPOSITE FACING?
		if(tDir == 0){ //FACING LEFT?
			vDir = 1;
		}else{
			vDir = 0;
		}
	}

	if(target != NULL()){
		void eType = getentityproperty(target,"type");
		int dir	= getentityproperty(target,"direction");
		void atkType;
		void projectile;
		
		if(dir == 0){Vx = -Vx;}
		if(type == 1){atkType = openborconstant("ATK_NORMAL8");}
		if(type == 2){atkType = openborconstant("ATK_NORMAL9");}
		
		if(eType == openborconstant("TYPE_PLAYER") || eType == openborconstant("TYPE_NPC")){
			changeentityproperty(target, "projectilehit", "type_player", "type_npc", "type_obstacle");
		}
		else
		if(eType == openborconstant("TYPE_ENEMY")){
			changeentityproperty(target, "projectilehit", "type_enemy", "type_obstacle");
		}
		
		damageentity(target, self, damage/1.5, 1, atkType); //SPLIT DAMAGE
		changeentityproperty(target, "direction", vDir);
		changeentityproperty(target, "aiflag", "projectile", 1);
		changeentityproperty(target, "damage_on_landing", damage/3); //RESET PROJECTILE STATUS TO 0 WHEN FALL ON THE GROUND, SPLIT DAMAGE
		tossentity(target, Vy, Vx, Vz); //TOSS OPPONENT
		antiWallG();
		setentityvar(self, "grabbed", NULL()); //CLEAR ENTITYVAR
	}
}

Code:
void antiWallG()
{//Checks distance from the walls, same as used in "animation event" but only for grab animations
 //The grabber checks if the grabbed entity is inside any wall when the grab move ends
 //In case the grabbed entity is inside any wall, the grabbed entity will be moved to the same grabber coordinates outside of the wall
	void self 		= getlocalvar("self");
	void target 	= getentityvar(self, "grabbed");
	int x 			= getentityproperty(self, "x");
	int Tx 			= getentityproperty(target, "x");
	int z 			= getentityproperty(self, "z");
	int Tz 			= getentityproperty(target, "z");
	float wall 		= checkwall(Tx, Tz);

	if(target != NULL()){
		if(wall){
			changeentityproperty(target, "position", x, z+1);
			changeentityproperty(target, "velocity", 0, 0, NULL());
		}
	}
}

https://www.youtube.com/watch?v=Z5qAEqmIo5g
 
Kratus nice work buddy. I've tested it and works great.
I just realized this line:
Code:
changeentityproperty(target, "position", x, z+1);

If you use z+1 instead of Z on a stage where you use a wall in front of the players, this will release the target inside a wall again.
 
Kratus thank you man I was already using antiwallG real nice piece of code :)

O_Ilusionista said:
Code:
changeentityproperty(target, "position", x, z+1);
If you use z+1 instead of Z on a stage where you use a wall in front of the players, this will release the target inside a wall again.

can confirm if wall is at an angle toward player, If wall is flat enemy travels down z by 1

Code:
changeentityproperty(target, "position", x-2, z);

I used this for jakes pile driver and all other throws when wall is in front of player, will do more tests

 
x-2 will make the enemy appear on grounds, holes, platforms, etc.
This is why you should use X and Z, because they are checked safe spots.

edit: ah the move at 0:32 should use a antiwall while throwing too, because you was able to bash the enemy inside the wall and while it won't bug, it looks a bit strange.
 
O_Ilusionista

If you use z+1 instead of Z on a stage where you use a wall in front of the players, this will release the target inside a wall again.
Yeah, you're right. I only added this "z+1" because some grab moves make the character still stuck near diagonal walls if the angle comes to behind the character or on top of the screen.
It's an adjustment specific for SOR2X because this game doesn't have walls at the bottom of the screen,

In addition, most grab moves will change the grabbed entity to a lower Z position to appear behind the grabber sprites, so depending on the game the chance to be stuck in walls behind the character is greater than the chance to be stuck in walls in front of the character.

pgcvK6H.png


Thanks to pudu for discovering this issue during gameplay.


danno
I used this for jakes pile driver and all other throws when wall is in front of player, will do more tests
Great! I saw your video and it seems that the script is working very well.
 
O_Ilusionista said:
edit: ah the move at 0:32 should use a antiwall while throwing too, because you was able to bash the enemy inside the wall and while it won't bug, it looks a bit strange.

I shall fix that, thank you sir

In night slashers sometimes there is a wall below and some walls the angle is towards you not away from player so z+1 can sometimes do the wall teleport :(  but I changed the throw move so entity is not tossed +z also

ZSi0hqJ.png
 
In night slashers sometimes there is a wall below and some walls the angle is towards you not away from player so z+1 can sometimes do the wall teleport :(  but I changed the throw move so entity is not tossed +z also
A tip that may help, it's possible to use the "player_max_z" as a "fake" wall if you need to block the player movement at the bottom of the screen. In SOR2X I always try to not use walls or platform below the character when I have walls at the left or right sides of the screen, and this way the "z+1" can work correctly.
 
O_Ilusionista

Yeah, I think the same. In my previous tests I saw that it's a very rare issue, and I was only able to fix it by adding this "z+1", but now I remade all the tests and maybe I found out what is causing it.
In the code below the "tossentity" function comes before the "antiWallG" function. So the grabbed character will be moved against a wall during a few centiseconds before the antiWallG fixes your position, and it could make the entity stuck.

Code:
damageentity(target, self, damage/1.5, 1, atkType); //SPLIT DAMAGE
lockMpG();
specialCostG(damage);
changeentityproperty(target, "direction", vDir);
changeentityproperty(target, "aiflag", "projectile", 1);
changeentityproperty(target, "damage_on_landing", damage/3); //RESET PROJECTILE STATUS TO 0 WHEN FALL ON THE GROUND, SPLIT DAMAGE
tossentity(target, Vy, Vx, Vz); //TOSS OPPONENT
antiWallG();
setentityvar(self, "grabbed", NULL()); //CLEAR ENTITYVAR

Now I inverted the order to see if the problem happens again, without the "z+1" code. Now the position will be fixed by the "antiWallG" before the "tossentity" function moves the grabbed entity.
Code:
damageentity(target, self, damage/1.5, 1, atkType); //SPLIT DAMAGE
lockMpG();
specialCostG(damage);
changeentityproperty(target, "direction", vDir);
changeentityproperty(target, "aiflag", "projectile", 1);
changeentityproperty(target, "damage_on_landing", damage/3); //RESET PROJECTILE STATUS TO 0 WHEN FALL ON THE GROUND, SPLIT DAMAGE
antiWallG();
tossentity(target, Vy, Vx, Vz); //TOSS OPPONENT
setentityvar(self, "grabbed", NULL()); //CLEAR ENTITYVAR
 
Inversion seems to have worked !!!! I had a similar problem with throw order until I inverted

Code:
    @cmd    keyint "ANI_FREESPECIAL40" 0 "UJ" 0 25
    @cmd    keyint "ANI_FREESPECIAL29" 0 "FJ" 0 25
    @cmd    keyint "ANI_FREESPECIAL30" 0 "BJ" 0 25
    @cmd    keyint "ANI_FREESPECIAL42" 0 "DJ" 0 25
    @cmd    keyint "ANI_FREESPECIAL43" 0 "J"  0 25
    @cmd    keyint "ANI_FREESPECIAL24" 0 "UJ" 0 200
    @cmd    keyint "ANI_FREESPECIAL34" 0 "DJ" 0 200
    @cmd    keyint "ANI_FREESPECIAL17" 0 "FJ" 0 200
    @cmd    keyint "ANI_FREESPECIAL27" 0 "BJ" 0 200

Throws look soo much smoother now

 
Back
Top Bottom