Troubleshooting No Damage for spawned enemies "Transformations".

zexika

Member
This is likely an easily one, but this is perplexing me tonight. Okay so I'm trying to have a boss character transform and spawn a more powerful version of it. The example used is SuperBoss and SuperBoss2. I've used the following code as described in the Manual and in Bloodbanes post here: https://www.chronocrash.com/forum/index.php?topic=996.0

In SuperBoss.txt

In the header section I've added:

Code:
death   1
load    SuperBoss2

In the footer section, I then added:

Code:
anim	death
	delay   8
	offset  114 175
	spawnframe 0 0 0 0 0
	subentity SuperBoss2
	frame	data/chars/enemies/2d/bosses/SuperBoss2/idle1.png

I've made sure SuperBoss2 is also loaded in Models.txt! So, SuperBoss2 definitely spawns just fine after killing SuperBoss. The problem is he can't be damaged! He takes no damage and deals no damage. Whats strange, is when I directly load SuperBoss2 instead of SuperBoss into the level.txt he deals and takes damage fine.

Somehow I am missing a piece of this transformation code, or something is missing that I'm overlooking.
 
Zexika Hello, I think you can set the summon in the second frame of the death animation so that it will be better without problems. My "kunioLA" game also has enemies set like this, for example, edit below

Code:
anim death
	 range      0 50
	 loop       0
	 delay      1
	 offset     72 131
	 bbox       0 0 0 0
	 subentity  Carlos
	 spawnframe 1 0 0 0 0
        frame   data/chars/enemy05/0pa1.gif
        frame   data/chars/enemy05/0pa1.gif
        frame   data/chars/enemy05/0pa0.gif
 
Okay, thank you! I'll go and test it now. :)

Update: Odd. Okay so he spawns, but instantly dies.
Update 2: spawnframe seems to be causing the instadeath issue. If I set spawnframe to 1 0 0 0 0 it's isntadeath. If I set spawnframe to 0 0 0 0 0 it's back to being invincible/no dmg. If I set spawnframe to 2 0 0 0 0 same issue; invincible/no dmg.

Code:
anim	death
	range      0 50
	loop       0
	delay      1
	offset  114 175
	bbox       0 0 0 0
	spawnframe 2 0 0 0 0

I had a feeling this wasn't going to be that easy, lol.  ;D
 
spawnframe 1 0 0 0 0
The summoning entity should be normal. I also tested that 0 2 3 may have some stuck phenomenon. Of course, you will not be attacked.
In addition, "falldie 1" is the only command I set for death
 
pudu said:
spawnframe 1 0 0 0 0
The summoning entity should be normal. I also tested that 0 2 3 may have some stuck phenomenon. Of course, you will not be attacked.
In addition, "falldie 1" is the only command I set for death

In header, I changed death 1 to falldie 1. Then, in footer I changed spawnframe to spawnframe 1 0 0 0 0.

Same effect. Monster spawns, but does no damage and can't be damaged.
 
Bloodbane said:
Hmmm.... Zexika , does Superboss2 have script on his/her spawn?

I DMed you the entire character scripts, because I'm not 100% certain which part of the character script you're referencing.

Update: I'm still stumped. I've tried removing all scripts, updating to latest engine build, and changing bbox script format to no avail. Still open to suggestions.

Update 2: Solved by Kratus.

Step 1: In Level.txt, remove boss    1 from the character's spawn.


Then, the spawn script must be modified to set an entity as a boss:

Code:
void spawnEnemy(void vName, float fX, float fY, float fZ, int bossFlag)
{	//spawn01 (Generic spawner)
	//Damon Vaughn Caskey
	//07/06/2007
	//
	//Spawns entity next to caller.
	//
	//vName: Model name of entity to be spawned in.
	//fX: X location adjustment.
	//fZ: Y location adjustment.
	//fY: Z location adjustment.
	//bossFlag: set 0 to normal enemies, set 1 to activate the enemy as a boss

	void self 		= getlocalvar("self"); //GET CALLING ENTITY.
	void vSpawn; //SPAWN OBJECT.
	int  direction 	= getentityproperty(self, "direction"); //GET CALLING DIRECTION.

	clearspawnentry(); //CLEAR CURRENT SPAWN ENTRY.
	setspawnentry("name", vName); //ACQUIRE SPAWN ENTITY BY NAME.
	if(bossFlag != NULL()){setspawnentry("boss", bossFlag);} //SET BOSSFLAG FOR ENEMIES
	
	//IS ENTITY FACING LEFT? REVERSE X DIRECTION TO MATCH FACING
	if(direction == 0){fX = -fX;}
	
	fX = fX + getentityproperty(self, "x"); //GET X LOCATION AND ADD ADJUSTMENT.
	fY = fY + getentityproperty(self, "y"); //GET Y LOCATION AND ADD ADJUSTMENT.
	fZ = fZ + getentityproperty(self, "z"); //GET Z LOCATION AND ADD ADJUSTMENT.
	
	vSpawn = spawn(); //SPAWN IN ENTITY.

	changeentityproperty(vSpawn, "position", fX, fZ, fY); //SET SPAWN LOCATION.
	changeentityproperty(vSpawn, "direction", direction); //SET DIRECTION.
	
	return vSpawn; //RETURN SPAWN.
}
 
Back
Top Bottom