Fulqrum Publishing Home   |   Register   |   Today Posts   |   Members   |   UserCP   |   Calendar   |   Search   |   FAQ

Go Back   Official Fulqrum Publishing forum > Fulqrum Publishing > IL-2 Sturmovik: Cliffs of Dover > FMB, Mission & Campaign builder Discussions

Reply
 
Thread Tools Display Modes
  #1  
Old 01-05-2012, 04:40 AM
salmo salmo is offline
Approved Member
 
Join Date: Mar 2011
Posts: 632
Default Ship oil fire effect script

Presenting a small script to create an oil fire on the water after a transport ship is sunk.

How it works: The script tests when an actor is destroyed to see if it's a transport ship. If it is a transport ship, then there is a random chance that a large fire object will be placed on the water where the ship sank.

code removed by author
__________________
When one engine fails on a two engine bomber, you will always have enough power left to get to the scene of the crash.

Get the latest COD Team Fusion patch info HERE

Last edited by salmo; 10-18-2012 at 09:29 AM.
Reply With Quote
  #2  
Old 01-05-2012, 08:24 AM
Ataros Ataros is offline
Approved Member
 
Join Date: Jun 2010
Location: USSR
Posts: 2,439
Default

Great idea! Maybe a smaller fire can be set at locations of plane crashes, especially in cities (with random chance of spreading to the whole city ).
Reply With Quote
  #3  
Old 01-05-2012, 09:38 AM
Continu0 Continu0 is offline
Approved Member
 
Join Date: Aug 2011
Location: Luzern, Switzerland
Posts: 702
Default

Great Idea indeed. May I ask for Screenshots/Vids?
__________________
AMD Penom ll 6x 1055T Processor 2.8 GHz // 8GB Ram // XFX Radeon HD 7870 Black Edition DD (2048 MB Memory DDR5, GPU 1055MHz) // Windows 7 Professional 64 Bit Version
Saitek x52 // Saitek Throttle Quadrant // Saitek Pro Flight Rudder Pedals // Track IR 5
Reply With Quote
  #4  
Old 01-17-2012, 06:42 PM
Lookaloft Lookaloft is offline
Approved Member
 
Join Date: Dec 2010
Posts: 38
Default

Hi salmo
Wonderfull scripts for cod-missions this Forum has. Easy to implement in home-made missions, nice to see them perform their specific jobs but not so easy to understand what makes them work. So I decided to enlighten myself a little bit in this respect. I thought I might try to realise this by taking a closer look at a certain script, preferably a relative small one. So I copied your Ship_oil_ fire_effect scrip into Visual Studio Express 2010 as a new project and added the necessary References to it (hereby following Kodiak’s instructions in Tutorial Simple Scripting Lessons I).
After this I ploughed myself through the programme, line for line and sometimes the penny dropped, sometimes it got jammed.
Much appreciated were the various explanations after double slash.
What I failed to understand completely was the line that says:
int i = random.Next(0, 100 + 1);

Perhaps you would be so kind to help me out.
Reply With Quote
  #5  
Old 01-17-2012, 06:45 PM
FG28_Kodiak FG28_Kodiak is offline
Approved Member
 
Join Date: Dec 2009
Location: Swabia->Bavaria->Germany
Posts: 884
Default

You get random Numbers between 0 and 100
Minimum is 0
Maximum is 100

in the Next- command the first Number is the minimum Value (included) the second is the max Value (excluded)
so for all Numbers from 0 to 100 the second Value must be 101.

Last edited by FG28_Kodiak; 01-17-2012 at 06:48 PM.
Reply With Quote
  #6  
Old 01-18-2012, 02:45 AM
salmo salmo is offline
Approved Member
 
Join Date: Mar 2011
Posts: 632
Default

Hi LookaLoft, Here's the script again with annotations & detailed comments that may help you get a better understanding of what some of the commands are doing. Copy/paste into Visual C# Express.

code removed by author

The int i = random.Next(1, 100 + 1); line generates a random integer between 1 & 100 (inclusive) & stores the value in the variable called i. Hence it's used to determine the "percentage" (1-100) chance of the oil fire occuring. The random integer generated needs to be less than the percent chance you specify for the variable j (int j = 10; ) for the fire object to be spawned. You could change the variable j value to 100 & an oil fire would occur every time a cargo ship was sunk (ie fire occurs 100% of the time), but I thought that might be a bit too boring so I made it just a 10% chance of a fire. I would have liked to have the fire burn for a small (random) length of time, but unfortunately there seems to be no method to de-spawn (destroy) a stationary object via script.
__________________
When one engine fails on a two engine bomber, you will always have enough power left to get to the scene of the crash.

Get the latest COD Team Fusion patch info HERE

Last edited by salmo; 10-18-2012 at 09:30 AM.
Reply With Quote
  #7  
Old 01-18-2012, 10:04 AM
Lookaloft Lookaloft is offline
Approved Member
 
Join Date: Dec 2010
Posts: 38
Default

Thanks a lot salmo and you too Kodiak.
Have a good day.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 09:09 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright © 2007 Fulqrum Publishing. All rights reserved.