Biker and rider map

O Ilusionista

Captain 100K
The concept of "biker / rider" is very useful, but I noticed a problem: the "rider" entity (which is invoked when you hit a subtype biker entity) is always invoked with the default palette.

1697463741808.png

Is there any native way to change this? Or do I have to resort to scripts?

Another question: When the rider entity is invoked, does it already natively know who the parent is? One way would be to make it copy the parent's palette - which is exactly what I want to do, so I can spawn the Biker with different palettes and the rider copies them.

Thanks!
 
The concept of "biker / rider" is very useful, but I noticed a problem: the "rider" entity (which is invoked when you hit a subtype biker entity) is always invoked with the default palette.

View attachment 5406

Is there any native way to change this? Or do I have to resort to scripts?

Another question: When the rider entity is invoked, does it already natively know who the parent is? One way would be to make it copy the parent's palette - which is exactly what I want to do, so I can spawn the Biker with different palettes and the rider copies them.

Thanks!

I don't remember in either case (derp). I'm supposed to have my new gear in on the 18th, so I can look at the code after that and find out for you.

DC
 
Looks the be here, just can't pinpoint where:
C:
//drop the driver, just spawn, dont takedamage
// damage will adjust by the biker
entity *drop_driver(entity *e)
{
    int i;
    s_spawn_entry p;
    entity *driver;
    memset(&p, 0, sizeof(p));


    if(e->modeldata.rider >= 0)
    {
        p.index = e->modeldata.rider;
    }
    else
    {
        return NULL;    // should not happen, just in case
    }
    p.position.y = e->position.y + 10;
    p.weaponindex = -1;
    strcpy(p.alias, e->name);


    // Carrying an item, so let's transfer that to spawn
    // entry for the driver.
    if(e->item_properties)
    {
        strcpy(p.item_properties.alias, e->item_properties->alias);


        p.item_properties.index         = e->item_properties->index;
        p.item_properties.colorset      = e->item_properties->colorset;
        p.item_properties.alpha         = e->item_properties->alpha;
        p.item_properties.health        = e->item_properties->health;
        p.item_properties.player_count  = e->item_properties->player_count;
    }




    //p.colourmap = e->map;
    for(i = 0; i < MAX_PLAYERS; i++)
    {
        p.health[i] = e->modeldata.health;
    }
    p.boss = e->boss;


    driver = smartspawn(&p);
    if(driver)
    {
        driver->spawntype = SPAWN_TYPE_BIKER;
        driver->position.x = e->position.x;
        driver->position.z = e->position.z;
    }
    return driver;
}
And looks like the rider is spawned at Y+10 from the parent.

EDIT: the manual says "Bikers should normally be spawned further out than other enemies. You'll probably want around 400 or -80 (But not more than -200 or 520, or they'll die)" but, from what I saw at the code, one of the values is wrong:

C:
// for old bikers
int biker_move()
{


    if((self->direction == DIRECTION_RIGHT) ? (self->position.x > advancex + (videomodes.hRes + 200)) : (self->position.x < advancex - 200))

Unless I am mistaken, they are spawn either at -200 or (video horizontal resolution +200)
 
Last edited:
The line p.colourmap = e->map is what should match the palette, but as you can see it's commented out, so that's why the rider always starts defaulted. I seem to recall now restoring that in the working source code. There's nothing you can do in the current version though except force it with script.

There's nothing at all transferring parent over. The concept of parent was a much later thing. Rider/biker code is from the OG BOR and left intentionally simple.

DC
 
EDIT: the manual says "Bikers should normally be spawned further out than other enemies. You'll probably want around 400 or -80 (But not more than -200 or 520, or they'll die)" but, from what I saw at the code, one of the values is wrong:

C:
// for old bikers
int biker_move()
{


if((self->direction == DIRECTION_RIGHT) ? (self->position.x > advancex + (videomodes.hRes + 200)) : (self->position.x < advancex - 200))
Unless I am mistaken, they are spawn either at -200 or (video horizontal resolution +200)

You are correct. The formula makes sure to put them 200 pixels off screen no matter what resolution you use. The old formula was a hard coded -80 behind scroll position or 400 in front of it. Obviously that's going to break on bigger screens, so we had to update it when the ability to pick your own size became available.

That's why I don't like the old manual, a lot of it is just plain wrong or over a decade out of date.

DC
 
Back
Top Bottom