Drew77 0 Posted March 5, 2007 Hi, I was wondering if it is possible to make cars burn forever. Beciase I like it better when cars burn (more smoke, more fire) and those little camp fires are to samll, so is there a way to make more smoke and fire or cars to burn longer, let me know.Thanks Share this post Link to post Share on other sites
Wolfrug 0 Posted March 6, 2007 The traditional approach is to have an ever-repeating script running that insta-heals and then re-kills the object in question whenever it approaches the end of its life. Here, this should do it: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_car = _this select 0 _time = _this select 1 #NeverEndingLoop ~0.1 _car setDamage 1 ~_time _car setDamage 0 goto "NeverEndingLoop" Copy-paste that into notepad, save it as something like, say "carburn.sqs" (no quotes) into your mission folder, and then run it in, for instance, the init field of the car as so: [this, 60] exec "carburn.sqs" Then just mess around with the "time" factor (it's in seconds) -> I believe different objects smoke for different amounts of time, just make it whatever suits you best. Good luck. Regards, Wolfrug Share this post Link to post Share on other sites
bk1276 0 Posted March 6, 2007 Wolfrug thanks this blows up great but i have one small prob i cant get it to loop i can change the burn time from 10 to 120 seconds but i cant get it to loop (burn again) i copyed the code straight from the screen . i even tryed to read up on looping items/commands and ended up with a sore head . so can someone please re explain to me or help in any way bk1276 Share this post Link to post Share on other sites
Rhodite 3 Posted March 6, 2007 A more basic option would be to setpos a fire (inflame) under the vehicle. You can also set the height of the fire so it is hidden inside the vehicle but the flames and smoke still show. I have used this basic method to reasonable effect. Share this post Link to post Share on other sites
Drew77 0 Posted March 6, 2007 I have the same prob BK1276 has. ^^^^^ ArmA= One of the best games I have ever played Share this post Link to post Share on other sites
Wolfrug 0 Posted March 6, 2007 Hey, got your PM, and tried the script in the editor. What strangeness My observations: It works - it really does. Loops nicely. Try it with something that explodes when it's setdamaged to 1 (like a tank), and you can spot every loop of the script. BUT, after a couple of loops it starts getting out of synch...loops slower, for some reason, and eventually doesn't loop at all, at which point the vehicle stops burning. HOWEVER, if you put a couple of bullets in the vehicle, it'll start burning again! Sometimes it started burning after itself after a couple of seconds of not-burning. I just tried it by switching the code around so that it actually physically spawns a new car at every loop (same type, same position, same direction) : no cigar. It still stops after a while, at which point no shooting or nudging works. I put in a check to see how many times it loops, and even without any of the other commands, it loops a maximum of 7 (! ) times. And considerably slower than it should (doesn't seem to matter what the value of the ~ is, in fact. Argh! ) I don't know what to tell you - anyone else have any clue why the thing won't loop for more than 7 times? I'd write you a .sqf, but those things are known for not being very loopative. Then again it could probably be made to run itself for all eternity. Argh. We'll see what I can do. Strange, strange, strange stuff, nonetheless. Regards, Wolfrug Share this post Link to post Share on other sites
mattxr 9 Posted March 6, 2007 We need a fire script made Share this post Link to post Share on other sites
-duke- 0 Posted March 6, 2007 A more basic option would be to setpos a fire (inflame) under the vehicle.You can also set the height of the fire so it is hidden inside the vehicle but the flames and smoke still show. I have used this basic method to reasonable effect. I use this all the time, especially when I add static, destroyed, vehicles and when destroying buildings. It works fine but the only thing I don't like is the smoke effect looks silly next to any object that was actually destroyed ingame as the smoke trail is far too small. Anyone have any ideas on how to stretch out the smoke effect and make it trail higher into the sky? I thought I'd add that creating more than one fire in the same location makes it a bit more robust in appearance but does nothing for the smoke effect. Thanks. Share this post Link to post Share on other sites
Big Dawg KS 6 Posted March 6, 2007 Hey, got your PM, and tried the script in the editor.What strangeness  My observations: It works - it really does. Loops nicely. Try it with something that explodes when it's setdamaged to 1 (like a tank), and you can spot every loop of the script. BUT, after a couple of loops it starts getting out of synch...loops slower, for some reason, and eventually doesn't loop at all, at which point the vehicle stops burning. HOWEVER, if you put a couple of bullets in the vehicle, it'll start burning again!  Sometimes it started burning after itself after a couple of seconds of not-burning. I just tried it by switching the code around so that it actually physically spawns a new car at every loop (same type, same position, same direction) : no cigar. It still stops after a while, at which point no shooting or nudging works. I put in a check to see how many times it loops, and even without any of the other commands, it loops a maximum of 7 (! ) times. And considerably slower than it should (doesn't seem to matter what the value of the ~ is, in fact. Argh! ) I don't know what to tell you - anyone else have any clue why the thing won't loop for more than 7 times? I'd write you a .sqf, but those things are known for not being very loopative. Then again it could probably be made to run itself for all eternity. Argh. We'll see what I can do. Strange, strange, strange stuff, nonetheless. Regards, Wolfrug Silly Wolfrug, _time is a reserved variable. The variable _time will always return the time that the script has been running, that explains why the loop gets slower and slower as the script runs. You can use _t, _timer, _time1, etc... but not _time (using CHOFPSE the variable always shows in a different color than regular local variables so I remember not to use it). Just coincidence really. Share this post Link to post Share on other sites
Wolfrug 0 Posted March 6, 2007 Haha! Thanks Kyle. Man, I knew that, of course, but...yeah. Heh! Obviously it'd keep getting longer and longer as time passed and....yeah. Guys : just change _time to something like _waitFor or whatever and you'll be fine! Thanks for righting me there, Kyle. Scripting-mind must've been asleep. Regards, Wolfrug Share this post Link to post Share on other sites
Drew77 0 Posted March 6, 2007 It still does not work, Now the car will not light on fire for about 20 sec then only stays lit for about 5 sec then never goies back on, this is what I have _car = _this select 0 _t = _this select 1 #NeverEndingLoop ~0.1 _car setDamage 1 ~_time _car setDamage 0 goto "NeverEndingLoop" In the cars ini i have [this, 60] exec "carburn.sqs" Try to mess around with the 60 but nothing. Share this post Link to post Share on other sites
Platoon_Patton 0 Posted March 6, 2007 u still use: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">~_time change it to <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">~_t Share this post Link to post Share on other sites
Drew77 0 Posted March 6, 2007 I have tryed to change that one but when I do nothing ingame happens. the car just sits there. Share this post Link to post Share on other sites
Jackal326 1179 Posted March 6, 2007 *Removed because replying to a troll was a waste of time* Share this post Link to post Share on other sites
Drew77 0 Posted March 6, 2007 *Removed because replying to a troll was a waste of time* Share this post Link to post Share on other sites
Lt_Damage 0 Posted March 6, 2007 Umm, can someone just ban that guy, he is so wrong on so many levels it hurts... In any case, fire scripts have been around for ages, why don't you just use one of those? Otherwise the burning fire under the car trick is something used since OFP 1.0 so that's just as good. There are also scripts that setoff heat shells or satchells, look them up on OFPEC. Share this post Link to post Share on other sites
Big Dawg KS 6 Posted March 6, 2007 I have tryed to change that one but when I do nothing ingame happens. the car just sits there. Did you change both simultaneously? <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_car = _this select 0 _t = _this select 1 #NeverEndingLoop ~0.1 _car setDamage 1 ~_t _car setDamage 0 goto "NeverEndingLoop" Share this post Link to post Share on other sites
W0lle 1048 Posted March 6, 2007 No he acts like a 11yo pre-puberty kid flooding the forums with his flaming. Replying to his posts makes it even more worse cause, we should have learnt that in the past. It's a waste of time. It's <censored> like him slowing the forums down that bad these days. Share this post Link to post Share on other sites
Drew77 0 Posted March 6, 2007 Thank you for trying to help Kyle but I just cant get it to work. I have tryed everything, but the car will not stay on fire. The only reason I dont use fire under the car is, It does not make as much smoke and fire. Share this post Link to post Share on other sites
bk1276 0 Posted March 7, 2007 as drew77 said thanks KyleSarnik for trying to help out and Wolfrug for posting this script to start with just we cant get it to reignite . maybe someone at sometime may sort it for every one(it may be down to arma 1.05 uk) heres hopeing the effect was great up to the loop thanks again bk1276 Share this post Link to post Share on other sites
Wolfrug 0 Posted March 7, 2007 Just tried it - and afaik, it works. Although somewhat sketchily, the reason for which I have nooo idea. Anyway, here's a somewhat revised script, should be relatively foolproof. Called the same way : <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_car = _this select 0 _t = _this select 1 _type = typeOf _car _i = 0 #NeverEndingLoop ;_i = _i + 1 ~0.01 _car setDamage 1 ~_t _pos = position _car _dir = direction _car _vectorUp = vectorUp _Car _vectorDir = vectorDir _Car deleteVehicle _car ~0.01 _car = _type createVehicle _pos _car setDir _dir _car setVectorUp _vectorUp _Car SetVectorDir _vectorDir ;hint format ["%1", _i] goto "NeverEndingLoop" This script will essentially create a new car of the same type in the same location facing the same direction every _t seconds. I put it on a 1 second loop and acctimed as much as it would go, and watched it loop for a couple of hundred times. So it should work. Note that there's a slightly more obvious and ugly switch between destroyed and not-destroyed, if you want you can try removing the extra ~0.01s, I mostly put those there since it's good praxis to let the system rest now and then. That shouldn't be a problem though if _t is large enough, and you're not unlucky enough to look at it for the 0.01 seconds it occurs Note : if you move the car for some reason, i.e. smashing into it so that it topples over, the new car will be created slightly hovering, with no physics applied to it before someone touches it/shoots it >_< Old OFP bug, can't do anything about it, I'm afraid. But yeah. Imagine a simple car-burning script could get so complicated. Do tell me if this doesn't work either. (note the commented lines _i and the hint format are there for debugging, uncomment them if you want to check the amount of times the script has looped) Good luck Regards, Wolfrug Share this post Link to post Share on other sites
bk1276 0 Posted March 7, 2007 Wolfrug you have done it , it worked a charm. placed empty red car with <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">[this, 30] exec "carburn.sqs" in the ini box on the left and placed empty white car with <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">[this, 30] exec "carburn.sqs" in the ini box on the right and you get constant smoke and flames in both cars you dont even see the break in the smoke and flames now my recomendation is make it up zipit up and post it up to ofpec for every one keep up the good work and again thankyou for all your help and effort bk1276 Share this post Link to post Share on other sites
Drew77 0 Posted March 7, 2007 Thank you so much Wolfrug, I will give it a shot, It is people like you that try so hard to make the game better for every1. Thanks for you hard work Wolfrug Share this post Link to post Share on other sites
satexas69 0 Posted April 4, 2007 Should this be run by a game logic "SERVER" or by the player locally? I would ASSUME server in a multi-player environment?[ IF you want to see the car burn forever ONLY AFTER it's destroyed, use this code instead: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_car = _this select 0 _t = _this select 1 _type = typeOf _car _i = 0 #Loop ? (GetDammage _car > 0.05) : GoTo "NeverEndingLoop" ~1 GoTo "Loop" #NeverEndingLoop ;_i = _i + 1 ~0.01 _car setDamage 1 ~_t _pos = position _car _dir = direction _car _vectorUp = vectorUp _Car _vectorDir = vectorDir _Car deleteVehicle _car ~0.01 _car = _type createVehicle _pos _car setDir _dir _car setVectorUp _vectorUp _Car SetVectorDir _vectorDir ;hint format ["%1", _i] goto "NeverEndingLoop" Share this post Link to post Share on other sites