Jump to content
Sign in to follow this  
coolfact

"Homemade" eventhandler

Recommended Posts

I need a eventhandler there can the same things as "CuratorGroupPlaced" and "CuratorObjectPlaced" but for groups and objects which is also placed with scripts and not only curator. Have been trying to use a while loop with foreach, but having a foreach loop with allgroups and vehicles seems to be a bad idea resources wise. If anyone have an idea, it would be much appreciated.

Share this post


Link to post
Share on other sites

cant you just execute a command in the same script that is placing the objects and groups? I could give you an example later if you like?

Share this post


Link to post
Share on other sites

This kinda destroys the purpose of having a 3rd party script, which is adding stuff to zeus

Seems like a while loop is the best(?) way of adding stuff, can the following code be optimized, noticing FPS drop when having 20+ vehicles and/or groups.

while {true} do {
	sleep 0.5;
	{
   		if (_x iskindof "LandVehicle" OR _x iskindof "Air") then
   		{
    	   		_curator addCuratorEditableObjects [[_x],true];
  			};
	} foreach vehicles;
	{
		_curator addCuratorEditableObjects [(units _x),true]
	}foreach allgroups;
};

Share this post


Link to post
Share on other sites

The best way of adding stuff is most certainly in the script creating it and not in another loop. You want to avoid as many loops as possible.

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  

×