The two main guns trick!

Modders can post their questions on scripting and more.

Moderators: Slitherine Core, BA Moderators

Post Reply
TopoSolitario
Corporal - 5 cm Pak 38
Corporal - 5 cm Pak 38
Posts: 45
Joined: Tue Dec 28, 2010 9:59 am
Location: Madrid - Spain
Contact:

The two main guns trick!

Post by TopoSolitario »

Image
free gif maker

So, here it is... the two main guns trick:

1. Your FIRE animation should look like this in the unit.txt

Code: Select all

[FIRE00]
FRM 0 20
FX 0 0
FX 4 0
SFX 1 43
SFX 5 43
CALL 2 0 2
Note that you play two times the same FX in your animation, one in frame 0 and second in frame 4.

2. As you only have one #!0 object for the FX in your MAX model... add a key in frame 0 on the muzzle of the first gun, and then on frame 4 move it to the muzzle of the second gun...

It works outstanding for guns, machineguns, rockets and whatever you need :)

Put the FX in consecutive frames and the effect is almost invisible!

Ingame, the two guns should mean more accuracy for this little BasterdJäger :p
TopoSolitario
Corporal - 5 cm Pak 38
Corporal - 5 cm Pak 38
Posts: 45
Joined: Tue Dec 28, 2010 9:59 am
Location: Madrid - Spain
Contact:

Post by TopoSolitario »

Thinking about the animation file... I've a question!!

The CALL line is the call to the unit's custom_trigger (in "trigger.bsf"). Currently the custom trigger ONLY draws tracers from the emmiter and only if the passed first parameter equals zero (CALL <frame> <param> <param> <param>)...

So, if we have a look at the Churchil file:

Code: Select all

[MGFIRE00]
FRM 180 200 //From frame 180 to frame 200
FX 2 1 //At 182 we start showing machinegun fire
FX 12 0 //At 192 we fire the main gun
SFX 0 29 118 119 //Sound at 0 for the machineguns
SFX 12 43 //Sound at 12 for the main gun
CALL 2 0 2 
CALL 6 1 2
CALL 9 1 2
CALL 11 1 2
So, why are the calls made for? If I'm correct (probably not):

- the first CALL 2 0 2 draws one and only one tracer from the first emmiter at frame 2... as there is no third parameter the emiter can or cannot be the main gun.
- next calls at frames 6 9 and 11 just do nothing as a "1" means no tracer, and custom_trigger does nothing else...

So... WHY using the CALLs if we don't do anything? I'm lost!

PS: In the animated GIF above you can see the tracer from the CALL 2 0 2 at the second frame (two frames after the flash) :p
IainMcNeil
Site Admin
Site Admin
Posts: 13558
Joined: Fri Apr 01, 2005 10:19 am

Post by IainMcNeil »

Now that's cool - asking Richard about the CALL because I dont use the unit files so not sure what they mean.
Merr
Captain - Heavy Cruiser
Captain - Heavy Cruiser
Posts: 903
Joined: Mon Aug 16, 2010 2:00 pm

Post by Merr »

That is cool! You're breaking new ground Topo!

I see what you're trying to do ... make a tracer for that right gun (as I can see only one come out the left gun)...

What if you made another [FIRE01] ... using the 01 emmiter for the 2nd gun ... using the same tags as [FIRE00] ??

I don't know this stuff ... just an uneducated guess ...

Pip ?? I think Richards forum name is "TwoEyes" ?
pipfromslitherine
Site Admin
Site Admin
Posts: 9865
Joined: Wed Mar 23, 2005 10:35 pm

Post by pipfromslitherine »

The tying together of the emitters and the FX is pretty arcane to be honest. This is a pretty clever way of doing it until we get the particle editor polished up so that people can use it sensibly.

I'm not sure about the call stuff - now I reread it it seems a little confused. It's using a as both the command, but then passing it in as the emitter, it might be a little broken...

Cheers

Pip
TopoSolitario
Corporal - 5 cm Pak 38
Corporal - 5 cm Pak 38
Posts: 45
Joined: Tue Dec 28, 2010 9:59 am
Location: Madrid - Spain
Contact:

Post by TopoSolitario »

I like the effect pruduced just moving in the animation FX object #!0 to each muzzle... it is a extremely fast change, and the minimun delay makes it more spectacular than just invoking the same effect at the same time.

Anyway... If I want tracers in both guns the way is this:

Code: Select all

[FIRE00]
FRM 0 20
FX 0 0 // main gun
FX 4 0
SFX 1 43
SFX 5 43
CALL 2 0 2
CALL 6 0 2
Actually all you have to do is ensure that #!0 is at the right place on frames 2 and 6

But there is something wrong as you can't use other emmiter than 0 (main gun) if you use other emmiter (1,2..) the IF in custom_trigger doesn't iterates... so... no tracer.

I think it is a bug, or something overseen while finishing the game... solution is easy, just modify custom_triger to allways show tracer and use accurately the right emmiter... anyway it is a less than minor bug... I don't really see tracers as much important for other units different from infantry with rifles... the rest has enough muzzle flash! :D
Post Reply

Return to “Battle Academy : Modders Corner ”