PDA

View Full Version : e->Extend;



Joe123
06-19-2008, 12:11 PM
e[i]->Extend = 3;
e[i]->Tile = 4940;
e[i]->TileHeight = 2;
is my current code.

However the enemies seem to use tiles from 18 tilepages down from '4940'.
It's really unusual.
Sometimes they use the correct tiles, and sometimes they use these rather remote ones.
It's not random either, they seem to work when facing in certain directions or something and not others.

Can someone explain to me how I'm supposed to set up my tiles on the tilesheet?
I'm using tektite enemies, if that helps.

bigjoe
06-19-2008, 12:32 PM
Are you changing just his tile height? Try setting his This is a wild shot and might not do anything, but try setting TileWidth to 1. Assuming thats what you want.

CJC
06-19-2008, 06:34 PM
Is it a 4-frame animation or a 2-frame animation?

bigjoe has the right idea, you need to define TileWidth. However, you probably should set it to 4 if it is a 2x1 enemy, or 8 if it is a 2x2 enemy (I wonder if 12 would make it a 2x3 enemy?)

Aquamentus's TileHeight is 6, fyi (He's a good template for big enemies). That might be causing problems too.

Joe123
06-19-2008, 06:53 PM
4 and 6? =S

Really?
Why?

Shouldn't it be 2 and 1, because it's a 2x1 sprite?

I'll have a go though, thanks.

EDIT:

ffc script t{void run(){Waitframes(4);npc e = Screen->LoadNPC(1);Trace(e->TileWidth);Trace(e->TileHeight);}}
I just did this on an aquamentus, and I got '1.0000', '1.0000' printed in allegro.log
I don't get it.

At all =S


EDIT:
Ohhh, it just doesn't like the tektite animation type.
I changed it to 4 frame - 4 dir and it works fine now.
And it is meant to be a value of 2 for tileheight and 1 for tilewidth, I think you must be getting confused Cjc.
Thanks anyway though.

CJC
06-19-2008, 09:11 PM
Maybe. All I know is that in the enemy editor, TileH seems to be the height of the animation box (The box that contains all tiles of enemy animation) and TileW is the width of that same both. Aquamentus has a TileH of 6 and a TileW of 8, and since it was a 2x2 I thought that was the standard.

Apparently the script does not write to this value, though, which actually makes things simpler. I think I'll give your snippet a try and see if it works for bigger enemies.

Joe123
06-20-2008, 04:04 AM
Ah.
Those numbers in the enemy editor don't actually mean anything.
I think they're just for the size of the box that the enemy takes up on the tilesheet, so if you try to delete its tiles by accident, the game brings up that error message.