Advertisement

Author Topic: Burn objects longer script (ACCEPTED)  (Read 1115 times)

0 Members and 1 Guest are viewing this topic.

Offline johnnyboy

  • OFPEC Patron
  • ****
  • Matan los Pantalones!!!
Burn objects longer script (ACCEPTED)
« on: 04 Apr 2007, 18:37:12 »
Most objects that burn when they are destroyed (cars, tanks, barrels, ammo boxes, etc.), only burn for a few minutes or less.

This is a simple script that lets you specify how long the object will burn.

Once the object has been destroyed in game (damage = 1), the script will replace the burning object with a new burning object of the same type, position and direction every 10 seconds.

To use the script, place this line in your burnable object's init field:

Code: [Select]
dummy=[this, 6000] execvm "obj_burn_replace.sqf";
First parameter is the object, second is number of seconds to burn.
« Last Edit: 01 Sep 2007, 19:35:17 by Mandoble »
El Cojon: "Do you like to Tango?"
You: "Only in Bagango."
Download Last Tango in Bagango and discover how El Cojon earned his name...

Offline Cheetah

  • Former Staff
  • ****
Re: Burn objects longer script
« Reply #1 on: 04 Apr 2007, 22:15:07 »
Haven't tested this script yet, but could you tell a bit more about the performance of this script? Because by judging it from what I've read it seems pretty CPU demanding, replacing the object every once in a while. Would a fire script (particle array stuff..) be less CPU intensive? Not telling you that I don't like the script, just a question.
Like missions? Help with Beta Testing! or take a look at the OFPEC Missions Depot for reviewed missions!

Offline johnnyboy

  • OFPEC Patron
  • ****
  • Matan los Pantalones!!!
Re: Burn objects longer script
« Reply #2 on: 05 Apr 2007, 18:48:16 »
Hello Cheetah,

Quote
tell a bit more about the performance of this script?

Every 10 seconds it creates a new object at [0,0,0], setdammaged to 1, deletes the original object, and moves the new object to original position.  Note that each previous object is removed via deleteVehicle.

I really have no idea if this is a performance issue or not.  I can say that I am working on a complex SP mission with many units, wahypoints and triggers.  In this mission this script will run on 3 ammo boxes when they are destroyed.   I have seen no performance problem in this limited case. 

Would a valley full of 50 burning vehicles lag?  It wouldn't surprise me.

I do wonder about the "waitUntil (getDammage _object == 1)" that I have at the beginning of the script.  I don't know how CPU intensive waitUntil is.  But I can easily change that to a loop that checks every 5 seconds.

Do you have an opinion on "waitUntil"?

Quote
Would a fire script (particle array stuff..) be less CPU intensive?

Again I have no idea.  My script is very simple, and is intended to be used on only objects that already burn when damaged.   The particle array stuff is harder for me to understand right now, so I haven't looked into it.

For fire scripts, I'm waiting for someone to encapsulate the particle array code into a simple multi-use script like General Barron did for OFP (very useful and versatile script, which parameterized fire size, duration, etc.).   I see alot of particle array script activity happening on the forums now, but I don't yet see a real clean multi-use script like General Barron's.

This script is not intended to be the ultimate fire script, just a simple solution to a limited problem:  "Burn burnable objects longer."  I saw an BI forum post working on this same problem, so I posted this script here to help them out, and linked a BI forum post to it.

Now I do have performance issues with the Coup De Grace script I posted...if someone took a glance at that, I would greatly appreciate it!
El Cojon: "Do you like to Tango?"
You: "Only in Bagango."
Download Last Tango in Bagango and discover how El Cojon earned his name...

Offline F2kSel

  • Members
  • *
Re: Burn objects longer script
« Reply #3 on: 06 Apr 2007, 15:12:31 »
I just had a look at he FPS issue and didn't notice much difference, both types of fire particle and normal caused a 10fps loss for one fire but the more fires I started the loss got less and after about 5 fires it seems to be about 2fps per fire.
I carn't really see why this should be.

One thing to remember particle fires look less dramatic and don't light up the area around them at night so you still need to add say a lite fire to get a good effect.


Offline Cheetah

  • Former Staff
  • ****
Re: Burn objects longer script
« Reply #4 on: 06 Apr 2007, 16:35:40 »
Indeed, I was a bit worried about the performance but I took a look and the script is quite good. Adds up to the atmosphere, especially at night.
Like missions? Help with Beta Testing! or take a look at the OFPEC Missions Depot for reviewed missions!