Jump to content

Recommended Posts

Hi all,

 

I am currently making a map which requires a Curator Editing Area to follow the player around the map. I would like it so that if an enemy of the player enters the Curator Editing Area, the Curator Editing Area is disabled (to stop him spawning stuff on top of the enemy).

 

I have managed to write a script which has the Curator Editing Area follow the player...

//init.sqf

[] spawn {
  while { alive t1 } do { myCurator addCuratorEditingArea [ 0, position t1, 50 ]; sleep 0.05; };
};

How this works is by creating a Curator Editing Area at the position of the player every 0.05 seconds. The interesting part is that you keep the ID of the Curator Editing Area, this means that it deletes the old Curator Editing Area when the new one is created. (Curator Editing Area ID being 0 in this case).

 

The problem I have is temporarily disabling the creation of "new" Curator Editing Area 's while an enemy is within range. So I need to be able to temporarily disable the script (which I do not know how to do).

Share this post


Link to post
Share on other sites

Solved it myself...

 

Script below for anyone who wants to recreate.

//init.sqf

[] spawn {
	while { alive t1 } do { 
		if ( { _x distance2D t1 < 50 and side _x == east }  count allunits != 0 ) then {
			myCurator removeCuratorEditingArea 0;
				} else {
					myCurator addCuratorEditingArea [ 0, position t1, 50 ]; sleep 0.05;
				};
	};
};

 

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

×