kontiuka Posted October 6, 2013 Posted October 6, 2013 Is there a way to explode a unit using lua script? I know how to do it using the mission editor trigger action but I'd like to do it using a script if possible. Thx. Kon
Grimes Posted October 6, 2013 Posted October 6, 2013 trigger.action.explosion(Vec3 point, number power) trigger.action.explosion(Unit.getByName('unitsName'):getPosition().p, 100) The right man in the wrong place makes all the difference in the world. Current Projects: Grayflag Server, Scripting Wiki Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread) SLMOD, Wiki wishlist, Mission Editing Wiki!, Mission Building Forum
Stonehouse Posted October 6, 2013 Posted October 6, 2013 slight variation of the above question. I'm trying to simulate an airfield that has been recently taken by friendly ground units as a starting point for a mission. So I'd like to have some smoking wrecks and buildings - I know I can destroy them using triggers and now thanks to Grimes's answer the same via scripts but these show up in the debriefing as units lost as well as the players seeing the explosion at mission start. How would you set a unit as destroyed at mission start with the usual smoke effect? Is that possible even? Thanks, Stonehouse
kontiuka Posted October 6, 2013 Author Posted October 6, 2013 (edited) The mission editor allows you to place destroyed units as static objects; like blown out Bradleys, Abrahms, T-90's, etc. Someone with more experience than I might be able to help with the smoke question. Edited October 6, 2013 by kontiuka
kontiuka Posted October 6, 2013 Author Posted October 6, 2013 You also should be able to place destroyed static structures as well. When you place a static object or structure onto the map, you have the option of making it dead or not. There's a little checkbox labelled 'dead'.
Stonehouse Posted October 6, 2013 Posted October 6, 2013 Unfortunately they are dead but are just a black wreck with no smoke. Which considering there isn't much real rubber in vehicles these days is probably ok as they'd stop producing much smoke in a matter of hours. Buildings on the other hand could smoke for quite a long time. The smoke markers available are not suitable for a number of reasons one of which is they are the wrong colour. Previously I've tried forcing the units to be destroyed on a mission start trigger which is fine if they are not in line of sight to a player although it does tend to cause a distinct pause while a number of units blow up at the same time.
Recommended Posts