![]() |
#1
|
|||
|
|||
![]()
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. |
#2
|
|||
|
|||
![]()
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
![]() |
#3
|
|||
|
|||
![]()
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 |
#4
|
|||
|
|||
![]()
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. |
#5
|
|||
|
|||
![]()
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. |
#6
|
|||
|
|||
![]()
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. |
#7
|
|||
|
|||
![]()
Thanks a lot salmo and you too Kodiak.
Have a good day. |
![]() |
|
|