Tis the season for cocktails my friends...Molotov Cocktails!
My Xmas present to all the pyromaniacs in the community...
Demonstration video link: http://www.youtube.com/watch?v=d0ReNnmPAnYAddon required: EditorUpdate_v102.pbo.
With this script, AI and players can throw Molotov Cocktails.
1. Thrown grenade replaced by a bottle object.
2. Bottle in-flight has flame and smoke trail.
3. Bottle impact has glass breaking sound effect.
4. Flame appears at point of impact (i.e., half-way up a wall, on the ground, side or roof of vehicle).
5. Flame attaches and moves with vehicles.
6. Men hit with molotov cocktails will burn and die.
7. Unarmored vehicles will take slow burn damage and eventually explode.
8. Fires have burn sound effect.
9. Men scream when burned.
Known Issues and Plans:
1. Death animations of men result in visual position of body not consistent with position returned by getpos. This makes it impossible to keep the fire burning on the dead body. To get around this I am forcing men down when burning, and re-setposing the body (so flame now on body). The tradeoff is player may see abrupt anim change and body setposing. I think this is better than flame appearing 1 or 2 meters away from dead soldier.
2. Performance issues may develop if you have many fires (many scripts playing fire anims and sounds). Plan to only play a sound if there is not already another nearby fire playing a sound. This will reduce sounds played.
3. Player will see Grenade as Selected Weapon. I was hoping I could use a Ctrl Dialog to overlay the display of "Grenade" with "Molotov Cocktail", but there is no way to detect if Player has Grenade selected...
4. Cocktails will pass through window of cars, and through to other side. This is because I am using a spawned bullet for collision detection, and bullets pass through windows.
Plans for improvement:
A. Burn crew of vehicles if its an open vehicle.
B. Eject crew of vehicles if open vehicle.
C. Vehicle drive erratically if hit.
D. AI needs to react to incoming cocktails?
E. Add targeting function for AI to choose targets to throw at.
F. If player is burning, an evasive ROLL action may put out fire save him (if quick enough).
Will edit this post later with instructions on how to install and use...
Is it MP compatible? Any other suggestions to make it perform better?
All feedback welcome. Changes:
- Dec. 20th: Removed dependency on Editor addon.Edit: images lost in crash of 2009, but demo mission re-upped, courtesy of fleepee - WEK