Reaper_Man, on 18 December 2020 - 11:17 AM, said:
You can theoretically hack "seekplayer" to navigate towards any other actor, due to how it interacts with HoloDuke. From VM_AlterAng:
int const spriteAngle = vm.pSprite->ang; int const holoDukeSprite = vm.pPlayer->holoduke_on; // NOTE: looks like 'owner' is set to target sprite ID... vm.pSprite->owner = (holoDukeSprite >= 0 && cansee(sprite[holoDukeSprite].x, sprite[holoDukeSprite].y, sprite[holoDukeSprite].z, sprite[holoDukeSprite].sectnum, vm.pSprite->x, vm.pSprite->y, vm.pSprite->z, vm.pSprite->sectnum)) ? holoDukeSprite : vm.pPlayer->i; int const goalAng = (sprite[vm.pSprite->owner].picnum == APLAYER) ? getangle(vm.pActor->lastv.x - vm.pSprite->x, vm.pActor->lastv.y - vm.pSprite->y) : getangle(sprite[vm.pSprite->owner].x - vm.pSprite->x, sprite[vm.pSprite->owner].y - vm.pSprite->y);
This bit of code sets goalAng to the angle to face the target, where the target is either the player or the HoloDuke, specifically the actor stored on "holoduke_on" player member. Meaning you can do this:
// holoduke_on resets to -1 when holoduke_amount hits 0, so always keep the holoduke_amount at full setplayer[THISACTOR].holoduke_amount 2400 ifaction 0 { findnearsprite 100 32768 ACTOR_TARGET ifvare ACTOR_TARGET -1 killit setplayer[THISACTOR].holoduke_on ACTOR_TARGET action A_ACTOR move M_ACTOR seekplayer break }
This actor now is using "seekplayer" to seek out something other than the player.
Unfortunately, the catch is the "cansee" check, meaning that this only works if there's already line of sight between the actor calling this and the faked HoloDuke, rendering this mostly useless.
lol that's cool - but it also sounds like something unintended that's definitely going to break in some future eduke32 version
