Page 1 of 1

Deconstructing the example Multi Vexirk

Posted: Sun Mar 04, 2012 6:54 pm
by Gambit37
I'm trying to get a handle on how the mutli-vexirx attack bitmaps work, but I don't follow the logic.

What code displays the yellow attack frame? It seems to be this:

Code: Select all

function multivexirk_close(arch, id, back_tile)
	dsb_ai(id, AI_ATTACK_BMP, 4)
        .....
I assume dsb_ai is just returning the value 4 to the attack code, which picks the fourth bitmap from the attack bitmap array?

I had a look in the DSB Wiki, but there's no mention of AI_ATTACK_BMP in the list of monster AI...
http://dmwiki.atomas.com/wiki/DSB/Monster_AI

Re: Deconstructing the example Multi Vexirk

Posted: Mon Mar 05, 2012 4:53 am
by Sophia
I guess AI_ATTACK_BMP is newer and I (or anyone else) never updated the wiki. Sorry about that. You figured it out, though.

To summarize, dsb_ai is used to send various messages to the AI. When sending an AI_ATTACK_BMP message, the argument specifies the index in the array of attack animations that the monster should use-- in that case, the fourth one. On the other hand, in multivexirk_missiles, the index of the attack animation that should be used is simply returned. There is still a call to dsb_ai with AI_ATTACK_BMP, of course, but it's in the base code due to the complexities involved in making monsters launch missiles.