Jump to content
Sign in to follow this  
loyalguard

CEG - Chernarus Electrical Grid (Script Pack and Addon)

Recommended Posts

@Loyalguard: Of course. I feel stupid for not checking in daylight. All the static had me fooled, as I could see that it seemed to work. I think the amount of static is fairly high, but it makes the right impression. In other words, I like it as it is. NV would surely be an option. I dont see that as a problem realism wise.

Looking forward to the password implementation.

Once again. Great job!

Share this post


Link to post
Share on other sites

Wow this opens up so much it boggles the mind. Thanks for awesomeness!

Share this post


Link to post
Share on other sites

I have fixed the smokestacks so they no longer smoke when destroyed. I have also reduced the size of the sounds so that there will be a dramatic decrease in the overall kilobytes. I still have a few sound tweaks to do but I project a 33-50% overall reduction without loss of quality/effect. There should be a new beta (hopefully a release candidate!) in a few days.

Returning to the smokestacks for a moment, as of the current version, destroying a smokestack does NOT stop the plant from generating power. My rationale is that the stack is just a vent for the smoke caused by the burning coal. I consider the actual furnace burning the coal/heating water/generating steam/turning the turbine/etc. to be inside the building and safe. But, I want the community's opinion: Should smokestack destruction kill power or NOT kill power?

Share this post


Link to post
Share on other sites

What dose that mean:

only total destruction of the plant, cuts power.......?

well, how would it be irl?

Dose a broken (destroyed) smokestack limit powerproduction? Anybody work in a power plant and care to elaborate?

Graet Mod so far, Thanx for your work.

Share this post


Link to post
Share on other sites

I have done some more research on the smokestack issue. I have no expertise on this matter, but on quick review, it does NOT appear that destroying a smokestack would by itself stop the plant from generating power (at least in the short term). It would definitely cause pollution and a big mess in the plant, but, it would seem that most stacks are far enough away from the furnace to not interfere with steam generation. So for now, I will not change the simulation:

Destroying a stack will NOT by default cut power, so, the only way to cut off all power from a power plant will be to destroy it completely, turn it off via the grid control dialog, or turn off power from each transformer outside the plant.

However, I will include instructions how a mission maker can make stack destruction cut power if they want to in their mission.

Share this post


Link to post
Share on other sites

Updated version: 0.9.6 Beta/Release Candidate. See first post.

Changelog

----------

16 Jun 2010 - v. 0.9.6 (Beta / Release Candidate)

-----------------------------------------

-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

CEG itself is only 575K (down from over 700K). The download is 1.43MB only because it has the addon, script, and demo mission versions included. I forgot to delete one obsolete sound file so it will be at least 87K smaller on final release. I still have some tweaks to make but if there are no major problems with this version it will be the release candidate.

I added some notes in missionmaker.txt regarding smokestacks as mentioned above. I also corrected some mistakes in the variables and logics information so make sure you look at this (and future versions) of missionmaker.txt if you plan to include/customize CEG in your missions.

Thanks again for all of the support, kind remarks, and testing!

Share this post


Link to post
Share on other sites

nice addon, i think i will let it run on our server

that should make missions more interesting

thank u for sharing ur work

Share this post


Link to post
Share on other sites

Exellent work, if civs came running out the houses when they realise they have no power that would be funny or terriost realise they dont have power to operatae missiles and weapons etc..

Share this post


Link to post
Share on other sites

I am preparing the final build. I am making the radius to trip or close substation circuit breakers a little bigger so it is easier to find (right now you have to be in a very small area). I am also adding a world check to make sure that CEG is only initialized for Chernarus missions There could be errors, bugs, or at a minimum wasted system resources if CEG was activated on other islands.

I am also adding one feature that I originally planned on adding after the 1.0 release, but, I had a few spare hours so I was able to get it working: mission maker option to require a password to access grid control software. By default it is not required, but very easily to implement. This way you could have one task to go find the password, and then another to find the computer to logon with the password.

And just a final note to server admins that want to run CEG on their servers, as I explain in the documentation, If a server has CEG installed and a client does not, that client will not experience CEG features such as sounds, particles, actions, and correct street lamp states. If you run CEG on your server, I strongly recommend you require all clients to have it installed as well.

Thanks agaim to everyone for your testing, feedback, and encouragement!

Share this post


Link to post
Share on other sites

Have you considered using true triggers with sound effect to play the sound via cfgSFX? I tried the plant.wss and it loops perfectly when done this way (other than a small problem with the sample itself). There might be other reasons not to go this path though. The description.ext config I used:

class CfgSFX
{
sounds[] = {};
class fx_plant
{
	name = "fx_plant";
	sounds[]={sound1};
	sound1[]={"CEG\sounds\plant.wss",1,1,50,1,0,0,0};
	empty[]= {"",0,0,0,0,0,0,0};
};
};

Oh, and what's with the disabling og GPS, Compass, and Watch in description.ext? With new items controlling those, the disabling just make things appear broke, or "trying to hide something" :p

Edited by CarlGustaffa

Share this post


Link to post
Share on other sites

I will look at the cfgSFX option...although I am not sure if that will work with an addon version (looks like it does) and I am trying to keep parity between the two. Thanks for highlighting it. I used an old description.ext as a template and did not realize I disabled those items. I will fix in the next release. Thanks!

Edit:

Now I remember why I disabled them..I was taking screenshots from the map screen and didn't want them in the way. I meant to put them back!

I started looking through this old thread of your at OFPEC to see how I might be able to use class SFX. Were you ever able to get it to work with something other than a trigger? My only hesitation is creating the 18 or so triggers I would need to play the sounds.

Edited by Loyalguard

Share this post


Link to post
Share on other sites

Oh, that's an oldie - the memories :) The problem isn't so much anymore, except as you say, having to create the triggers. Now you just use attachTo to keep it moving. Perfect loops (if within the sample itself) are made possible with the empty[]=... thingy. I still have absolutely no idea what it does, but all other examples I've seen have used {"",,,, ...} something which makes the loop fail.

However!!!

I am experiencing some extremely weird behavior with this; getting rid of the trigger, or rather, it's sound effect. Running nearestObject [player,"EmptyDetector"] in the debug console may indicate there is no triggers around (I've successfully deleted them). But the sound not only persist, it also changes character from being spatial (you can point in the direction from where the sound is coming from, volume defined by distance to source) to being anonymous (constant volume within a certain distance from trigger with no direction). Also, alt-tabbing out and back into Arma again, causes the sound to be played at full volume. Very disturbing.

So, in order to successfully "delete" the sound, you have to move the trigger "somewhere safe". I tried deleteVehicle _trigger, _trigger setSoundEffect ["", "", "", ""]; but nothing worked. Only thing that seems to work is

_trigger setPos [0,0,1000];

sleep 0.345;

deleteVehicle _trigger;

Sound is away, and won't bother you if it persists after trigger deletion. That's what I meant with "There might be other reasons not to go this path though."

Edit: Disregard the overstrike above. It does not seem to work properly either. There is something odd going on with the "sound object attached to the trigger", and when it fails it will ruin the sound and not be moved with the trigger. Ref new ticket about the problem, for detailed description.

Just so you are aware of the problem :)

Not sure if the sleep is needed, I just tend to do it as always when I don't, I get reminded that I should have :p

Edit2: I was going to bug report on this odd sound behavior on A2 CIT. But now, naturally I might add, I'm not able to reproduce it. Ref setSoundEffect: SoundDet (only for triggers) creates a dynamic sound object attached to a trigger defined in CfgSFX. I suspected that it was this mysterious object that got smothered in the destruction somehow, but when destroyed left a problematic sound behind. But no matter what I bomb it with during tests (shells, satchels, GBUs), it survives and gets properly deleted with the trigger. So, it never fails when I'm trying to get it to fail. But when I do it in my mission, it always fails. Could be a performance thing, I don't know anymore.

Edited by CarlGustaffa

Share this post


Link to post
Share on other sites

1.0 is out! See first post for link and details:

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: Mission maker option to allow CCTV system to use nightvision during non-daylight hours (time customizable).

-UPDATED: readme.txt and missionmaker.txt

Please note there is a new server key. The previous version will only work for the beta. For 1.0 (and subsequent releases), please use the new included key: CEG.bikey. CEG itself is only 500KB. Download is 1.2 MB because it has script, addon, and demo mission in one package.

I am not working on any new features until after A2OA to check compatibility issues and review any new possible functionality. Enjoy!

Share this post


Link to post
Share on other sites

Great update man!

Really nice with the password option. And I still love the windows UI.

Nice that you have implemented optional NV for CCTV also.

This update brought all the improvement I could think of. Good work.

Share this post


Link to post
Share on other sites

I have been working on an arc flash explosion that can be added by mission makers. By default the chance of arc flash is zero. Mission makers can add whatever percent change of occurrence as desired (every time, 1 in 4, 1 in 10,000, etc.)

An arc flash can occur when manually flipping circuit breaker switches in-game. If an arc flash occurs there is an explosion, a visible arc of electricity, and several seconds of sparks.

I plan on releasing this in the next version. Here is a short preview video of what the current explosion and effects look like (notice I send an AI in to flip the breaker!):

7OoB_U6DXVk

Share this post


Link to post
Share on other sites

Now thats just plain cool.

this addon is part of a mission I am working on and that new effect would be nice . I like the ai triping the breaker and dieing.

Hope you going to do one for oa .

Share this post


Link to post
Share on other sites

Thanks! I have added a little fire to the sparks to complete the effect. I am waiting to see if there are any bugs and then release this new feature with the fix. If no apparent bugs in a couple of weeks I will just release it. It will have to be a few weeks in any case because if am going on vacation/holiday and won't have time to get it out before then...hope you can wait!

Yes, I plan on doing a version for OA (if there is grid infrastructure on the island(s).

The arc flash is very lethal if you are close, about the same lethality (and shrapnel damage) as a grenade. The damage model was inspired from this passage in the wiki link above:

"The massive energy released in the fault rapidly vaporizes the metal conductors involved, blasting molten metal and expanding plasma outward with extreme force."

Share this post


Link to post
Share on other sites

a oa version would be super cool .

side note I love sending AI on a suicide mission. Have a few of thouse in the mission I am currently working on .

Share this post


Link to post
Share on other sites

An OA version will be in the works, as I mentioned, assuming there is electrical infrastructure on the included islands. I will not be able to get OA for a few weeks to do any analysis.

The good news is that I designed the CEG code to be as "universal" as possible. Of the 30 or so scripts, functions, and config files that make it all work, only four would need to be modified to make them work with OA (or any other island). The work to do that would probably take about 10-20 man hours (since CEG took about 100 man hours to develop and those four files took about 20-30% of total development time).

On the bug related front, I tested CEG extensively in the editor, SP, MP dedicated server/clients, and as a MP host. But, you need two copies of A2 to test as a MP host and MP client, so, I was unable to test as a client connected to a MP host. While reviewing some code, I think I may have seen some potential incompatibility as a client connected to a MP host. Has anyone tested CEG as a client connected to a MP host? If so I would like your feedback. It may be that such a client will not experience all of the same effects as the host when power is cut off (street lamp switching, sounds, etc.). I can hot fix this very quickly if needed. I will ensure there is no potential incompatibility in the next release but I need to know if I need to publish a hot fix. Thanks!

Share this post


Link to post
Share on other sites
An OA version will be in the works, as I mentioned, assuming there is electrical infrastructure on the included islands. I will not be able to get OA for a few weeks to do any analysis.

The good news is that I designed the CEG code to be as "universal" as possible. Of the 30 or so scripts, functions, and config files that make it all work, only four would need to be modified to make them work with OA (or any other island). The work to do that would probably take about 10-20 man hours (since CEG took about 100 man hours to develop and those four files took about 20-30% of total development time).

On the bug related front, I tested CEG extensively in the editor, SP, MP dedicated server/clients, and as a MP host. But, you need two copies of A2 to test as a MP host and MP client, so, I was unable to test as a client connected to a MP host. While reviewing some code, I think I may have seen some potential incompatibility as a client connected to a MP host. Has anyone tested CEG as a client connected to a MP host? If so I would like your feedback. It may be that such a client will not experience all of the same effects as the host when power is cut off (street lamp switching, sounds, etc.). I can hot fix this very quickly if needed. I will ensure there is no potential incompatibility in the next release but I need to know if I need to publish a hot fix. Thanks!

Loyalguard - I don't have ArmA1 but thanks to your super cool electrical grid I want to experience it as well. I have ArmaA2 and OA... so I have a few questions about ArmA1/Sahrani/CEG.

#1 - Do I need to buy ArmA1 or does CAA for ArmA2 add everything that's needed?

#2 - If CAA does it, does your CEG work within ArmA2 OK?

#3 - Do you have a few favorite missions people designed that uses CEG for both ArmA1 and ArmA2?

#4 - I have an idea for electrical usage in Takistan... When the electrical grid is on, have the Muslim loudspeaker/prayer thing at the top of the hour (or all the time in softer tone) within the radii of the town. When you cut the electrical it can no longer play :) ex.

The problem with Takistan and Zargabad is it lacks the great lighting and infrastructure of Chernarus/Utes. When electrical is off you'd hardly even notice because there are so few street-lights/shop-lights to begin with. You could have a trigger radius zone for each one of these towers:

arma2oa%202010-07-11%2000-19-24-11.jpg

But it'd probably be good if you could integrate it from the beginning with your mod as opposed to having it be a latter add-on.

Share this post


Link to post
Share on other sites

I am sorry for the delayed response, it has been quite busy lately and I have not had much free time.

Regarding SEG and Sahrani for A2 (Ques 1 and 2)...I have not tried it, but assuming there are no major positional differences associated with the port from A1 to A2, SEG should work with Sahrani in A2 via CAA1.

There are a couple of caveats however...

1) Sounds and effects between SEG and CEG are different (improved in CEG).

2) CEG is much more system resource efficient than SEG.

3) As a note, the individual city grids on Sahrani are not connected to each other, they are independent (the main motivation for this was that there is no power plant on Sahrani).

3) SEG was never made into an addon, only a script version so the mission maker has to include it to make it work.

Regarding Ques 3, Unfortunately I took a leave of absence after SEG was released for A1 so I do not know how many missions included it. CEG is still very early in its lifecycle and I am not sure it has been included in any A2 missions yet.

Ques 4) I will definitely look at that as a feature for A Takistan version, I have not yet been able to load OA so there is still a lot of exploring to do.

Share this post


Link to post
Share on other sites

New version released! See first post for updated link and information!

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

There are a couple of very important changes in this version for mission makers.

In 1.0, if a player had the addon version installed AND the script version was present in the mission, the game would use the addon version and abort the script version. The problem is that if the addon version was 1.0 and the script version was 1.1 then there could be potential incompatibility. So, from here forward, the script version will always take precedence over the addon version to ensure compaibility with the mission maker's intentions. To do this, the mission maker must now initialize CEG via a unit init line in the editor (full instructions in missionmaker.txt and in the demo mission) to ensure it runs before the addon version (PostInit XEH).

The other important change is that if a mission maker wanted to use the addon version to avoid adding CEG components to the description.ext and keeping tbe script version up to date within the mission folder no action was required, but, there was no way to require that CEG be installed because there were no new vehicle classes introduced. Now in 1.1, the mission maker has the option to place a custom "CEG Logic" in the editor to require CEG for that mission. This is optional since CEG will initialize if it is installed regardless of whether or not there is a CEG Logic is on the map, but highly recommended if mission makers want to use the addon version. Again, full instructions included.

And of course...please review the new arc flash explosion feature to determine if it is right for your mission.

This will probably be the last version of CEG. That does not mean development has stopped. I will most likely be migrating this project into a different version to be able to "intergrate" electrical grids from several different islands (to include A2OA and user made worlds). As it stands, CEG can only work with Chernarus and to make it work with other islands would break backwards compatibility. My goal for the new project will be for it to be easily compatible with any island with the proper electrical infrastructure. I figured a single addon/script pack that worked with several islands would be easier for players, mission makers, and server admins than separate addons/scripts for each island. I will strive to maintain backwards compatibility with A2-only content as well as offer both script pack and addon versions. Chernarus may remain separate, be incorporated into the new version, or be available in both depending on how the roadmap evolves. The next step is to analyze other islands (first priority are OA islands) and find the best way to go about making functional electrical grids for them...stay tuned...but in the meantime please let me know if you have any feedback on CEG v.1.1!

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×