PDA

View Full Version : Bigger Enemies



SpacemanDan
06-23-2008, 11:17 AM
I read somewhere that it's possible to make enemies bigger without the use of scripts. If I did read this right, how do you do this?

Joe123
06-23-2008, 11:26 AM
I'm pretty sure you have to use scripts.
It wouldn't be a very complicated script to just make, say, a 2x1 enemy or something though.

SpacemanDan
06-23-2008, 11:41 AM
I figured I read something wrong. >_<
How would one make a bigger enemy through scripts?

Joe123
06-23-2008, 11:42 AM
e->Extend = 3;
e->TileHeight = bigger;
e->TileWidth = bigger;

Specifics?

SpacemanDan
06-23-2008, 12:03 PM
No real specs, I'd just need something I can throw number into to make bigger enemies.

Would Ijust have to through in the numbers in that script there?

Joe123
06-23-2008, 12:10 PM
Sort of.
Depends how you want it to work, and how big you want the enemy to be though.
Do you want it to just take an enemy from the list (so say, take the first enemy, or take the 5th enemy or whatever), or work for all enemies of a certain type or what?

SpacemanDan
06-23-2008, 12:11 PM
I'd like it if it worked on a certain enemy on the list.

Dart Zaidyer
06-23-2008, 02:10 PM
I'm going to chime in here and say I'd like to be able to do this for an assortment of enemies in the LttP tileset, so they're always the right size. Many of them need to be 1x2 or 2x2 tiles.

Joe123
06-23-2008, 06:15 PM
ffc script enemyresize{
void run(int n, int h, int w){
if(h==0) h=1;
if(w==0) w=1;
Waitframes(4);
npc e = Screen->LoadNPC(n);
e->Extend = 3;
e->TileHeight = h;
e->TileWidth = w;
e->HitHeight = h*16;
e->HitWidth = w*16;
}
}

D0: Number of enemy on list to load
D1: Height of new enemy
D2: Width of new enemy

Should be pretty universal.


Oh yeah, it doesn't work for all animation types.
It gets pretty funky if you try it with Tektites.
It's good for 4-frame 4-dir types though.
Dunno about anything else, I haven't tried it.

bigjoe
06-23-2008, 07:07 PM
One thing you really gotta be aware of is that enemies resized have to be drawn the right way. So if you're resizing an enemy you already have and don't want to have to sacrifice it's "small size" tiles to make it large, you should set it to a new tile. Here is a revision.




ffc script enemyresize{
void run(int n, int h, int w, int t){
if(h==0) h=1;
if(w==0) w=1;
Waitframes(4);
npc e = Screen->LoadNPC(n);
e->Tile = t;
e->Extend = 3;
e->TileHeight = h;
e->TileWidth = w;
e->HitHeight = h*16;
e->HitWidth = w*16;
}
}



D3: Tile of new enemy.

Joe123
06-23-2008, 07:19 PM
Ah, I assumed it was for a completely new enemy, only handled by the script.
Good idea though, but maybe something like this?

ffc script enemyresize{
void run(int n, int h, int w, int t){
if(h==0) h=1;
if(w==0) w=1;
Waitframes(4);
npc e = Screen->LoadNPC(n);
if(t!=0) e->Tile = t;
e->Extend = 3;
e->TileHeight = h;
e->TileWidth = w;
e->HitHeight = h*16;
e->HitWidth = w*16;
}
}


I like your signature by the way =P
Made me laugh =P

bigjoe
06-23-2008, 09:55 PM
It would be cool to further augment the script somehow to keep enemies from walking through walls. I don't think it would be too hard but I'm not going to do it right this second.

Joe123
06-24-2008, 02:49 AM
Walking through walls?
Why should they walk through walls?

bigjoe
06-24-2008, 04:28 AM
if you increase an enemy's size, it makes them capable of hanging off of it's tile.

Joe123
06-24-2008, 11:06 AM
Hanging off of it's tile?

Wacha mean by that?

The_Amaster
06-25-2008, 03:13 PM
I think that actual solidity of the enemy remains at 1x1.

...but hitbox is now 2x1 or 2x2, right?

Joe123
06-25-2008, 05:38 PM
I increased the hitbox to be the same size as the tilesize, won't that increase the size of the enemy?

If the solidity does remain at 1x1, that's ok for say, a 2x1 aLttP Knight or something though still.

bigjoe
06-25-2008, 07:36 PM
that increases their interaction with weapons. However, their hitbox can still go through walls.

Revfan9
06-25-2008, 08:51 PM
I've not yet actually tried messing with this yet, but lemme see if I can boil down what you're saying:

The entire system was very, very poorly programmed, mirite?

bigjoe
06-25-2008, 09:10 PM
Not at all. It works very well if you do a little extra scripting to control the movement. It was left unfinished to avoid delaying the release much further than it is already delayed.

jman2050
06-26-2008, 12:25 AM
I've not yet actually tried messing with this yet, but lemme see if I can boil down what you're saying:

The entire system was very, very poorly programmed, mirite?

As an accurate approximation of the behavior of Zelda 1 enemies, it as very well programmed.

As a flexible easily modified system, it's far from.

SpacemanDan
06-26-2008, 07:08 PM
Thanks for the help everyone! :D I'll give it a shot ASAP. I appreciate it! :D (I realize I'm a little late, sorry 'bout that.)