This will do what you want, including the bite attack on other enemies, however it requires 2.55 Alpha 46. That build is now available on zeldaclassic.com. None of that x/y positioning was required to make this enemy function. The engine handles position based on size of enemies.
The npc should be a type of Other, and you will need to set its Defences to ignore Script 01 weapons.
npc script wolfie { void run() { int clks[1]; lweapon bite = Screen->CreateLWeapon(EW_SCRIPT1); bite->X = this->X; bite->Y = this->Y; bite->HitHeight = 8; bite->HitWidth = 16; bite->DrawYOffset = -32768; bite->Damage = 2; while(1) { this->ConstantWalk({this->Rate, this->Homing, this->Hunger}); unless(bite->isValid()) { bite = Screen->CreateLWeapon(EW_SCRIPT1); bite->DrawYOffset = -32768; bite->Damage = 2; } if(bite->isValid()) { wolfnme::positionbite(this, bite); wolfnme::transformbite(this, bite); } Waitdraw(); wolfnme::transform2x1(this,clks); Waitframe(); } } } namespace wolfnme { void positionbite(npc n, lweapon bite) { switch(n->Dir) { case DIR_UP: bite->X = n->X; bite->Y = n->Y -1; bite->HitYOffset = -2; bite->HitXOffset = 0; break; case DIR_DOWN: bite->X = n->X; bite->Y = n->Y + 1; bite->HitYOffset = 24; bite->HitXOffset = 0; break; case DIR_LEFT: bite->X = n->X - 1; bite->Y = ((n->Y > 0) ? n->Y : n->Y + 1); bite->HitYOffset = 0; bite->HitXOffset = -2; break; case DIR_RIGHT: bite->X = n->X + 1; bite->Y = ((n->Y > 0) ? n->Y : n->Y + 1); bite->HitYOffset = 0; bite->HitXOffset = 25; break; } } void transformbite(npc n, lweapon l) { switch(n->Dir) { case DIR_DOWN: case DIR_UP: { l->HitWidth = 16; l->HitHeight = 8; break; } case DIR_RIGHT: case DIR_LEFT: { l->HitWidth = 8; l->HitHeight = 16; break; } } } void transform2x1(npc n, int clk) { ++clk[0]; int f4 = Floor(clk[0]/(n->ASpeed/4)); if( f4 >= 4 ) { f4 = 0; clk[0] = 0;} switch(n->Dir) { case DIR_DOWN: { n->Tile = (Game->LoadNPCData(n->ID)->Tile) + 4 + f4; n->OriginalTile = n->Tile; n->TileWidth = 1; n->TileHeight = 2; n->HitWidth = 16; n->HitHeight = 32; break; } case DIR_RIGHT: { n->Tile = (Game->LoadNPCData(n->ID)->Tile) + 60 + (f4 * 2); n->OriginalTile = n->Tile; n->TileWidth = 2; n->TileHeight = 1; n->HitWidth = 32; n->HitHeight = 16; break; } case DIR_LEFT: { n->Tile = (Game->LoadNPCData(n->ID)->Tile) + 40 + (f4 *2); n->OriginalTile = n->Tile; n->TileWidth = 2; n->TileHeight = 1; n->HitWidth = 32; n->HitHeight = 16; break; } case DIR_UP: { n->Tile = (Game->LoadNPCData(n->ID)->Tile) + f4; n->OriginalTile = n->Tile; n->TileWidth = 1; n->TileHeight = 2; n->HitWidth = 16; n->HitHeight = 32; break; } } } }FANTASTIC SCRIPT
Wolfie is a Killer now.
Great fun…
I LOVE IT!!!
BS Dodongo Animation Wolf - harm hero and enemies
Started by
Bagu
, Dec 10 2019 01:26 PM
npc script ghost
15 replies to this topic
#16
Posted 15 December 2019 - 01:09 PM
Also tagged with one or more of these keywords: npc script, ghost
Zelda Classic →
Scripting Discussion →
How to make a boss waiting for an intro ? (2.55 Alpha 115)Started by Pier , 23 Sep 2023 2.55, Alpha 155, NPC Script |
|
|
||
ghost
Zelda Classic →
Scripting Discussion →
Testers Wanted for Ghost 2.9.0Started by Timelord , 07 Oct 2021 ghost, autoghost, 2.9, 2.9.0 and 5 more... |
|
|
||
NPC script
Zelda Classic →
Scripting Discussion →
Script Requests →
Continuous Zora HPStarted by Bagu , 31 Jan 2020 NPC script |
|
|
||
NPC Script
Zelda Classic →
Scripting Discussion →
Script Requests →
Transform on Death - Wizzrobe EnemyStarted by Bagu , 13 Jan 2020 NPC Script, zquest 2.55 Alpha 47 |
|
|
||
NPC Script
Zelda Classic →
Scripting Discussion →
Script Requests →
Enemy "eats" Arrows/BombsStarted by Bagu , 28 Dec 2019 NPC Script and 1 more... |
|
|
2 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users
-
Facebook (1)