You generally wouldn't use the tile animation feature of Editart for weapons, but instead show the tiles sequentially from the code according to the specific weapon animation speeds, like
WEAPONx_TOTALTIME. Unless someone else knows better, I haven't really been editing weapons in Duke3D for a year or two. The last time I made weapons was with sprites so I'm not entirely sure how to work with models. You'll still need to have proper totaltime and reload times, though you can get away with just checking for the kickback_pic a few times instead for every frame, assuming your model has been animated (read: timed) properly.
You'll be checking for player's
current weapon in
EVENT_DRAWWEAPON. If that weapon has an ironsight option to it, you check against the ironsight variable you created, then
call a separate state for either drawing the gun regularly or the ironsight version. Here's a stripped down example of how I'm handling it:
onevent EVENT_DRAWWEAPON
ifvare CURRENT_WEAPON 1
{
ifvare IRONSIGHT_ON 1 { ifvarg PISTOL_AMMO 0 { state drawpistolironsight } } else { state drawpistol }
}
endevent
Some stuff to note,
WEAPONx_TOTALTIME will be the total time your gun takes to fire, so if you set it to 5 for example, you'll have five frames of animation for the firing of the gun.
For instance here's some older code from one of my mods (meant for sprite weapons), the TOTALTIME is set to 5 so there's five frames of animation for the weapon:
state drawpistolironsight
setvar RETURN -1 // I forgot if this is even necessary
setvar weaptile 2513 // the idling frame of the pistol
getplayer[THISACTOR].reloading GUN_RELOAD // checking if player is reloading
ifvare GUN_RELOAD 1 { setvar IRONSIGHT_ON 0 } // if so, turn iron sight off
getplayer[THISACTOR].kickback_pic GUN_FIRE // get the weapon's current frame number and play through them
{
ifvare GUN_FIRE 0 { setvar weaptile 2513 } // ironsight idle
ifvare GUN_FIRE 1 { setvar weaptile 2514 } // ironsight firing frame 1
ifvare GUN_FIRE 2 { setvar weaptile 2515 } // firing frame 2
ifvare GUN_FIRE 3 { setvar weaptile 2516 } // firing frame 3
ifvare GUN_FIRE 4 { setvar weaptile 2517 } // firing frame 4
ifvare GUN_FIRE 5 { setvar weaptile 2518 } // firing frame 5
}
setvar weapx 155 // setting the horizontal positionwhere the weapon will be drawn
addvarvar weapx weapon_xoffset // add horizontal weapon sway
subvarvar weapx looking_angSR1 // another thing I forgot :P
setvar weapy 225 // setting the vertical position
addvarvar weapy looking_arc // adding the vertical sway
subvarvar weapy gun_pos // adding the vertical sway pt2
myospal weapx weapy weaptile weapshade weapor weappal // drawing the weapon
ends
For the regular version of the gun that has the reloading animation, you'd use exactly the same code (creating another state called drawpistol), except just with added kickback_pics for the reloading animation. The
WEAPONx_RELOAD will be the the number of frames the weapon uses for the reloading animation (and reloading time in general). Notice that if you use say, 50 as the reload time, it will need to be total of 50, not 55, as the reloading animation is started from the first frame after the firing animation. Basically you'll just add to the code like this:
ifvare GUN_FIRE 5 { setvar weaptile 2524 } // normal firing frame 2 -- this is where the kickback_pic checking ends in the ironsight drawing code
ifvare GUN_FIRE 6 { setvar weaptile 2528 } // reloading animation
// ...
ifvare GUN_FIRE 50 { setvar weaptile 2524 } // end of reloading animation, usually the weapon idle frame
I hope that helps.