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 10:30 AM.
|