Deconstructing the example Multi Vexirk

This forum is for the Lua scriptable clone of DM/CSB called Dungeon Strikes Back by Sophia. Use DSB to build your own highly customised games.

Moderator: Sophia

Forum rules
Please read the Forum rules and policies before posting. You may Image to help finance the hosting costs of this forum.
Post Reply
User avatar
Gambit37
Should eat more pies
Posts: 13770
Joined: Wed May 31, 2000 1:57 pm
Location: Location, Location
Contact:

Deconstructing the example Multi Vexirk

Post 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
User avatar
Sophia
Concise and Honest
Posts: 4306
Joined: Thu Sep 12, 2002 9:50 pm
Location: Nowhere in particular
Contact:

Re: Deconstructing the example Multi Vexirk

Post 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.
Post Reply