Is it hard to disable an enemy's hitbox?
Hitboxes
#1
Posted 03 March 2018 - 07:30 PM
#2
Posted 03 March 2018 - 08:46 PM
npc->CollDetection = false;
#3
Posted 03 March 2018 - 09:26 PM
How would I apply that to an enemy?
#4
Posted 04 March 2018 - 03:02 AM
ffc script CreateEnemy { void run(int enemy_id, int n, int hp) { if(n == 0) n = 1; for(int i = 0;i < n; i++) { npc e = Screen->CreateNPC(enemy_id); if(!e->isValid()) continue; e->CollDetection = false; if(hp > 0) e->HP = hp; e->X = this->X; e->Y = this->Y; } } }
#5
Posted 04 March 2018 - 05:48 AM
Ah, so that would work for an enemy placed on the screen to begin with (which I would definitely use), but not for an enemy that appeared as the result of splitting upon hit or death (a second idea).
#6
Posted 04 March 2018 - 06:01 AM
#7
Posted 04 March 2018 - 07:44 AM
An enemy without a hitbox as a result of splitting was an idea for a "dry bones" type enemy where you can knock it out temporarily, but it always comes back
(normal, splits into no-hitbox, tribbles into normal)
#8
Posted 08 March 2018 - 09:44 AM
The 2.54 editor can move the enemy hitbox offscreen, by setting HiyYOffset to -32768 (or some other improbably vast number so that it is never on-screen), and enabling the override.
Is there a case for needing the hitbox on-screen, and having it disabled (from the editor)?
#9
Posted 08 March 2018 - 09:54 AM
Not unless you have some specific scripting plans. Moving it offscreen sounds fine.
#10
Posted 26 March 2018 - 04:08 AM
You'd have to load an enemy pointer and then disable collision. Example script that creates an enemy without collision:
ffc script CreateEnemy { void run(int enemy_id, int n, int hp) { if(n == 0) n = 1; for(int i = 0;i < n; i++) { npc e = Screen->CreateNPC(enemy_id); if(!e->isValid()) continue; e->CollDetection = false; if(hp > 0) e->HP = hp; e->X = this->X; e->Y = this->Y; } } }
I'd like specific Enemy IDs to always have no hitbox, and I want them to be enemies that appear as a result of spilt on hit or split on death (as opposed to creating an enemy).
Edited by Cukeman, 26 March 2018 - 05:19 AM.
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users