Remap an spawned enemy

dantedevil

Well-known member
I want to know as possible set a specific pallette of spawned enemy in two different. cases.

1) I have a bike enemy with differrent palletes:
name BIKER2
health 100
type enemy
subtype biker
gfxshadow  1
candamage        player obstacle
nolife 1
load         bd2
rider         bd2

load         bd5
load         bikexp

palette data/chars/biker/idle0.png
alternatepal data/chars/biker/map.png
alternatepal data/chars/biker/map2.png
As you can see the rider is "bd2"
If I set one remap of the bike, only change the map until the bike dies.
Code:
spawn  biker2
health  50
map 1
alias   black_death_gang
coords  680 230  
at   0
I want change the remap of the rider (bd2),  to match with the selected map of the bike.

2) In this bike I have a spawn animation, where another enemy comes in the back seat of the bike and then jump.
Code:
anim spawn
	loop	0
	offset	88 130
	delay   5
        sound	data/chars/biker/bike.wav
	frame	data/chars/biker/bike_bd200.png
	frame	data/chars/biker/bike_bd200b.png
	frame	data/chars/biker/bike_bd200.png
	frame	data/chars/biker/bike_bd200b.png
	frame	data/chars/biker/bike_bd200.png
	frame	data/chars/biker/bike_bd200b.png
	frame	data/chars/biker/bike_bd200.png
	frame	data/chars/biker/bike_bd200b.png
	frame	data/chars/biker/bike_bd200.png
	frame	data/chars/biker/bike_bd200b.png
	frame	data/chars/biker/bike_bd200.png
	frame	data/chars/biker/bike_bd200b.png
	frame	data/chars/biker/bike_bd200.png
	frame	data/chars/biker/bike_bd200b.png
	frame	data/chars/biker/bike_bd200.png
	frame	data/chars/biker/bike_bd200b.png
	frame	data/chars/biker/bike_bd200.png
	frame	data/chars/biker/bike_bd200b.png
	frame	data/chars/biker/bike_bd200.png
        subentity bd5
        spawnframe 20 -55 1 20 0
	frame	data/chars/biker/bike_bd200b.png
	offset	88 103
	frame	data/chars/biker/bike00.png
I want change the remap of this spawnded enemy (bd5),  if not always be the default pallete.

I want to know  in both cases if there is any way to choose the specific palette, as we do to spawn the enemies in each level.

EX:

spawn  dominatrix
map    4
alias  vipers_gang
coords  -100 230 
at  0
 
For #1. you can use this function:

Code:
void spawnM(void Name, float dx, float dy, float dz)
{ // Spawn certain entity and matches its map with own's map
   void self = getlocalvar("self");
   int map = getentityproperty(self,"map");
   void Spawn;

   Spawn = spawn01(Name, dx, dy, dz);
   changeentityproperty(Spawn, "map", map);
}

However you must disable rider bd2 and set this script to spawn bd2
I think I have better function for this, let me check

For #2, there's no direct way aside of script. Even so you need to you need to define how spawned enemy choose his palette. Is it defined in level or same as biker2 or it has it's own palette choice?
 
Thanks my friend!
I think I have better function for this, let me check
For now I'm going to check this script,  if you find a better solution, let me know.

For #2, there's no direct way aside of script. Even so you need to you need to define how spawned enemy choose his palette. Is it defined in level or same as biker2 or it has it's own palette choice?
The two options are good for me.
The idea is this enemy dont have the same map of the biker. This way look better.
 
For now I'm going to check this script,  if you find a better solution, let me know.

I have found the function but it doesn't have health adjustment yet. I'll post it when I'm done :)

The idea is this enemy dont have the same map of the biker. This way look better.

I'm still not sure so which one of this:
1. Dropped enemy's remap is defined in level
2. Dropped enemy's remap is fixed
 
I prefer #2 since it's simpler

Anyways, I've tried to replicate dropped rider feature default biker has with no result :(. Maybe it has something to do with subtype biker, I'm not sure
If you want the function here it is:

Code:
void tossEnemy(void Name, float dx, float dy, float dz, float Vx, float Vy, float Vz, int Damage, int Flag)
{ // Tossing fallen enemy
    void self = getlocalvar("self");
    int iDirection = getentityproperty(self, "direction");
    int map = getentityproperty(self,"map");
    void vSpawn;

    vSpawn = spawn01(Name, dx, dy, dz);

    damageentity(vSpawn, self, Damage, 1, openborconstant("ATK_NORMAL"));

    if(iDirection == 1){
      tossentity(vSpawn, Vy, Vx, Vz);
    } else {
      tossentity(vSpawn, Vy, -Vx, Vz);
    }
    if(Flag == 1){
      changeentityproperty(vSpawn, "map", map);
    }
}

This function will drop other entity from defined relative distance (dx,dy,dz) with these velocities (vx,vy,vz) . Damage defines how much damage it receives when he/she/it is dropped. Flag =1 will set dropped entity to use same palette as spawner
 
Back
Top Bottom