loyalguard 15 Posted May 20, 2010 (edited) CEG - Chernarus Electrical Grid Script Pack and Addon by Loyalguard Development Status: General Release Current Version: 1.1 Download: MediaFire (1.21 MB .zip) Mirrors: Armaholic Visual Guide: MediaFire (2.35 MB .pdf) OFPEC Beta Testing Thread: CEG - Chernarus Electrical Grid (Script Pack and Addon) (Beta) Changelog ------------ v.1.1 - 17 Jul 2010 -------------------- -NEW: Added mission maker option to add arc flash explosion (randomly or deliberately). -FIXED: Corrected code that might cause clients connecting to multiplayer host servers not to experience same effects as host. -CHANGED: Ensured that if mission script and addon versions were both present that the mission script version would be used instead of addon version to ensure backward compatibility. -CHANGED: Mission script version is now initialized by editor unit init line (e.g. game logic) instead of from the init.sqf to ensure priority over addon version. -ADDED: Added a seperate demo mission just for the addon version. Demo for mission script version renamed to avoid confusion. -ADDED: Added a custom game logic that when placed in the editor by the mission maker adds CEG as a required addon for the mission. -IMPROVED: Optimized smoke stack particle code. -UPDATED: readme.txt and missionmaker.txt v.1.0 - 21 Jun 2010 -------------------- -IMPROVED: Easier to find "Trip" and "Close" Circuit Breaker action menu items when near substation transformers by increasing the activation radius. -IMPROVED: Added a world name check to make sure CEG is only activated for missions on Chernarus. -IMPROVED: Power plants no longer emit circuit breaker opening and closing sounds. -ADDED: Added mission maker option to require password to access grid control system. -ADDED: Misson maker option to allow CCTV system to use nightvision during non-daylight hours (time customizable). -UPDATED: readme.txt and missionmaker.txt v.0.9.6 (Beta/Release Candidate) - 16 Jun 2010 ---------------------------------------------- -FIXED: Smokestacks no longer continue to emit smoke when destroyed. -IMPROVED: Size of sounds reduced to create a smaller download/install package. -IMPROVED: Adjusted plant noise sound levels to be more easily heard when outside a power plant. -IMPROVED: More realistic sounds of large substation circuit breakers tripping (opening) and closing. -IMPROVED: Circuit breaker closing sound no longer plays at mission start. -UPDATED: readme.txt and missionmaker.txt v.0.9.3 (Public Beta) - 05 Jun 2010 ------------------------------------ -Initial Release (as Beta) Overview The Chernarus Electrical Grid (CEG) for Arma2 is the succesor to Sahrani Electrical Grids (SEG) for ArmA. All of the functionality of SEG has been ported to CEG plus much more! All scripts have been completely re-written to take advantage of scripting features unavailable at the time of SEG's release for A1 and now available in A2. The scope of the project is to simulate a working electrical grid for Chernarus modeled on existing map objects (no new objects/models). The simulation consists of two power plants that transmit power to various electrical substations throughout South Zagoria. The substations in turn distribute power locally to nearby cities, towns, and other areas. The simulation's core function is to monitor the integrity (damage and connections) of electrical grid components (power plants and substations) and interrupt "power" to affected areas when integrity is lost or diminished. Power interruptions cause street lamps to turn off (other light sources are unaffected). Features: -2 power plants (Elektrozavodsk and Chernogorsk) with working smokestacks and power plant noises. -7 electrical substations that emit a transformer humming noise when energized. -Ability to interrupt power by destroying components or, if enabled by mission makers, by manually tripping circuit breakers via the action menu (if tripped, breakers can again be closed to restore power). Manually switching circuit breakers could cause arc flash explosions if enabled by the mission maker. -Mission makers can enable players to remotely logon to grid control software and substation video feeds via custom dialog. -Grid redundancy - if certain components go offline, power automatically switches to secondary circuits when available. -Built-in task/objective support via global/public variables (with examples). -Fully SP, MP, JIP, and persistent mission compatible. Each mode is optimized for minimal performance impact. JIP is self-contained and does not require onPlayerConnected code. -Extensive documenation for mission makers and players. Easy implementation into any mission. -Fully featured demo missions (for addon and script version). -Available in script only (no addons required) and addon versions. Addon version automatically adds CEG to any mission in Chernarus. Screenshots: Electrical Distribution Zone Map (Color Coded) Remote System Control Dialog Built-in CCTV System Demo Video: 8u7E8a_5Ag0 Developer Notes I am happy to announce the general release for CEG and am sincerely appreciative to everyone at OFPEC, Dev Heaven, and here on the BIF whose either direct input or previous work has allowed me to bring my electrical grid simulation to Arma2. The beta testing thread can be found at OFPEC. If you have comments, questions, or suggestions please post them! Edited October 22, 2011 by Loyalguard Updated Visual Guide Link Share this post Link to post Share on other sites
=FSI=Gen.Nembo 10 Posted May 20, 2010 News Added in ArmedAssault.info :ok: Share this post Link to post Share on other sites
wika_woo 182 Posted May 20, 2010 this is actually awesome Share this post Link to post Share on other sites
Nicolai 10 Posted May 20, 2010 this is really cool! thanks for your hard work! Share this post Link to post Share on other sites
M.Andersson(SWE) 4 Posted May 20, 2010 Yupp verry cool... One drop down only..The soundloop is HORRIBLE.. You can do better then that..I know you can.. Share this post Link to post Share on other sites
dimitri_harkov 10 Posted May 20, 2010 Great! One just has to love the modding possibilities of ArmA2! Thanks BIS & Loyalguard! Cheers, D. Share this post Link to post Share on other sites
wolfbite 8 Posted May 20, 2010 This is actually a brilliant idea... Good luck man.. Share this post Link to post Share on other sites
sickboy 13 Posted May 20, 2010 Very nice to see this 'out there', congrats! Share this post Link to post Share on other sites
TRexian 0 Posted May 20, 2010 (edited) Great work LG! :) Will try it out (and give feedback). :) (When released.) ;) Edited May 20, 2010 by TRexian Share this post Link to post Share on other sites
Laqueesha 474 Posted May 20, 2010 (edited) I can see it now. :D ArmA 2: The Ultimate Infrastructure Simulator Is it only going to effect streetlights? What about houses, office buildings, hotels, airports, shops/stores and such? (e.g. translucent textures) Edited May 20, 2010 by Laqueesha Share this post Link to post Share on other sites
loyalguard 15 Posted May 20, 2010 Thanks for the news link Nembo and thanks to everyone for the positive comments! @Andersson One drop down only..The soundloop is HORRIBLE..You can do better then that..I know you can.. Ah, yes...the sound loop. This has been a thorn in my side since A1/SEG. This is an area where I would love some help...I will post in an editing sub-forum all the details, but in short, the problem is that there is an approximate .10 second delay between one loop iteration and the next one despite all my efforts to prevent it. I think it just must be the time the engine needs to stop one and start the other. It used to me longer when I used an .ogg file but is better now that it is a .wss. This pause is not really noticeable with birds chirping or crickets because there are natural pauses...but for a near monotone hum it is very noticeable. So, right now it plays for 2 secs, pauses for .1 sec., plays for 2 secs, pauses .1 sec.... Here is an example (not to scale and not the actual waveform of the sound I am using). Top is how it should look, bottom is in-game playback: I would use a longer loop to make the pause sound less "rythmic", but if I were to use say a 10 second loop, if I cut the power off after 5 secs of a loop iteration, the sound still plays for another 5 seconds which is even more awkward than how it sounds now. The only way I have found to interrupt the sound when power is cut off is to deleteVehicle the logic that is the sound source (but right now I need that logic for other things). So, that is the quick overview, I will post more in another thread in the scripting forum as to avoid too many technical details here...in the meantime if anyone has any advice my ears are open! @Laqueesha - I am looking at houselights that are part of ALICE...and I have always looked at othe lights sources as well (towers, lighthouses, airports, traffic lights). ALICE houselights is doable, but doing so whithout breaking other ALICE is a little harder and needs more time. The other light sources would require a lot of other modding that is on the table, but not in the short term. I have always explained them away in SEG and (in CEG) as backed up by generators or other emergency power sources (and candles in the window ;). I am pursuing these further after general release. Share this post Link to post Share on other sites
TRexian 0 Posted May 20, 2010 Hey LG, On the sound issue, did you try a shorter loop? Like a 1 second wave (or less), but faster? It sounds odd, but sometimes the ear will "translate" something like that as a single sound, even if there is a brief pause. Or, 2 sounds, played somewhat out of sync with each other? Just a couple ideas. :) Share this post Link to post Share on other sites
cctoide 0 Posted May 20, 2010 I haven't done much with playing sounds from scripts, but couldn't the sound-playing loop use spawn{} to play the sound instead of playing the sound itself, so that one spawn{} process starts as the other is ending? You could edit the sound file so it fades in and out, so if they overlap it's not as noticeable. First thought that comes to mind is the 3ms rule interfering with the script, but I'm not sure what part of it is taking that long to run. Maybe other scripts are getting scheduled in between iterations? Regardless, this seems like an awesome addon. I love really technical addons, and the amount of thought put into this is nice. I'd consider lowering the volume on the substation humming, though. Could be annoying if you have to be near it for a while. Share this post Link to post Share on other sites
loyalguard 15 Posted May 20, 2010 @TRex - I have experimented with loops as short as .1 secs (the same duration as the delay) and actually even smaller (to see if I could actually create a 100hz sound by literally playing a new sound every .01 secs !) but I didn't think of increasing the speed. I will definitely look at that. On the two sounds suggestion (or "dueling hums" as I like to call it ;) ), I had looked at that and Myke suggested it as well and I might be able to make that work. It does involve a second logic as a sound source for each transformer since a logic can only "say" one sound at a time. Thanks for the suggestions! :) @cctoide - I did try spawn to start a new instance of the sound earlier in development, but, the problem is that since the sound used the same source (logic) there was still a delay even if I timed the new instance to start at the same hundreth of a second the old one stopped. But as discussed above, using it with a second source might work. Regarding fading in and out, that is what I did in the A1 version of the sim, SEG. Using it, you have no idea there is an actual delay as it seems "natural". Unfortunately, compared to the hum coming from an actual substation transformer, it does not sound realistic (not that a .1 sec delay does either!) Thanks for the suggestion and I will re-explore. Regarding the volume, I will look at that as well. I have set the DB level so that you can hear the hum up to 100m away (assuming there are no other audio distractions). I will look into this further to see what is the best fit for realism and gameplay. I do have to say when you are at substations like Elektro (the opening scene of the demo video), the three transformers all going at the same time can be annoying! Thanks again! :) Share this post Link to post Share on other sites
kroky 1 Posted May 20, 2010 Im looking forward to the addon version, to add this feature to Chernarus by default. Share this post Link to post Share on other sites
Binkowski 26 Posted May 20, 2010 The Sahrani electrical grid script / addon was awesome. Can't wait to see this! Share this post Link to post Share on other sites
dmarkwick 261 Posted May 21, 2010 The concept is great :) looking forward to seeing it in action. RE the sound loop - I had some amount of minor success by fading the sound in & out and overlapping slightly. It doesn't entirely solve the problem just changes it, but maybe the new problem will sound slightly more acceptable then the old problem :) Share this post Link to post Share on other sites
loyalguard 15 Posted May 25, 2010 (edited) I've made some good progress on improving the sound loop. The loop is now a 15 second sample of a consistent hum with minor environmental variations. The .1 sec pause is still there, but there is some distortion that precedes it (sampled from rapidly vibrating insulators) so the gap now sounds more "natural". There is also instant stoppage of the sound when power is turned off . I have also reduced the overall volume. I went to a local substation this weekend to see how far away you can hear the hum. It is now set to 25-50m which is more realistic. Below link is to a video with the new loop, instant stoppage, and output volume. Please excuse video quality. I have all settings on low to make development easier. 02LBu_lxnyo Thanks to everyone for your suggestions...I used a combo of things to get the effect. I added a new logic that only plays the hum and has no other function. When power is cut, I delete the logic which instantly stops the sound. This allows for a longer loop. When power is restored I add the logic back again and replay the sound. For the sound of the breaker closing and the hum starting again, I have the original logic play/say that sound so they overlap. Edited May 25, 2010 by Loyalguard Share this post Link to post Share on other sites
TRexian 0 Posted May 25, 2010 Awesomosity! So... it's going to be released soon? ;) Oh... and maybe have the hum "wind down" when the circuit is tripped. (Maybe you already do this, but my speakers are messed up on this PC all of a sudden.) Share this post Link to post Share on other sites
loyalguard 15 Posted May 25, 2010 I will have a beta of the script version out by Thursday...I have to because I will be without a computer for a couple of weeks as I am moving so I need to get it out by then because that is when the movers are packing it! I hope to also have a beta of the addon as well at the same time. Documentation may not be complete, but the demo give more than enough information to explain the grid , test it, and use it. I used to have a power off transition sound but removed it for the time being for simplicity. I need to do some more research to see what happens when a large transformer like that shuts down. Share this post Link to post Share on other sites
TRexian 0 Posted May 25, 2010 I need to do some more research to see what happens when a large transformer like that shuts down. Dude. The lights go out. :doh: ;) Good luck with the move! Share this post Link to post Share on other sites
loyalguard 15 Posted May 27, 2010 So bad news and good news. Bad news is I found a major bug that breaks JIP compatibility that is going to delay beta release for a few days (that's what I get for pre-announcing a release date :p. Good news is that I convinced my wife to not pack my computer when the movers come so I will have it for another week or so to get things stable...stay tuned! Share this post Link to post Share on other sites