Forum Jump :

Author Message


Posts: 30
Rank:


Level: Member

Country: us
Location: The Battlefield
Occupation:
Age: 76
In-game name:

 
#1 Posted at 2017-09-24 04:38        
     
Hi,
I am trying to remove some random patrols in an area that will no longer see any action.

Six groups of three men each were formed by placing this code in their inits:
Rand_Patrol2_0 = group this;
(2_1, 2_2, etc.)

A trigger was placed after their patrol area calling a script. The script simply contained the code:
deleteGroup Rand_Patrol2_0;
and the succeeding numbered groups.
Set the effect to verify the trigger is firing, which it is.

But walking back through the area, the patrols are still there. Did I miss something??

Any assistance will be greatly appreciated....


Author Message


Posts: 1473
Rank:


Level: Member

Country: uk
Location:
Occupation:
Age:
In-game name:

 
#2 Posted at 2017-09-24 10:34        
     
to delete the units in the group use

{deletevehicle  _x} foreach units Rand_Patrol2_0;
or
{deletevehicle  _x} foreach units Rand_Patrol2_0+units Rand_Patrol2_1
for multiple groups


to delete the groups name you can then use
 deleteGroup Rand_Patrol2_0;
to release the group name instantly

or if you place this after you created the group
Rand_Patrol2_0 = group this;
Rand_Patrol2_0 deleteGroupWhenEmpty true;

it will delete automatically after you emptied the group using deletevehicle ect, it takes a minute to work.


Advertisement


Author Message


Posts: 30
Rank:


Level: Member

Country: us
Location: The Battlefield
Occupation:
Age: 76
In-game name:

 
#3 Posted at 2017-09-24 20:17        
     
@ F2kSel,

Thank you for the informative response.

It seems I missed the part where the group must be empty. But they never even mentioned how to remove the units.

I tried to resolve the problem by using the long method of removing each unit with the deleteVehicle command with the player walking thru the trigger. Even this failed to remove any of the units.

This revealed the underlying cause of the problem. It seems that placing the center of the trigger to rest at a high point in mountainous terrain leaves gaps underneath the trigger in low points.

So the player walks under the trigger without even tripping it. This explains why a second trigger BluFor detected by Opfor - 300x200 would only trip sporadically.

Tried setting the position, Z axis, to a negative elevation to compensate, but for some reason the game resets the entry to zero.

Hopefully, you can clear this up also....


Author Message


Posts: 1473
Rank:


Level: Member

Country: uk
Location:
Occupation:
Age:
In-game name:

 
#4 Posted at 2017-09-24 20:40        
     
I don't think I've ever had to change the height of a trigger so I don't think that's the issue.

Are you sure BluFor detected by Opfor is working correctly ie Blufor must be in the trigger area and seen by Opfor who can be anywhere ( I think)


Author Message


Posts: 30
Rank:


Level: Member

Country: us
Location: The Battlefield
Occupation:
Age: 76
In-game name:

 
#5 Posted at 2017-09-24 22:23        
     
Yes it is.

The trigger area is for failing the mission.

Walking the player thru the area, you can get in a firefight and not trip the trigger. Other times, while sneaking thru the area, up pops the failed mission notification. I use a sound effect to verify trigger activation.

I encountered this in another area a month or so ago. That was resolved by re-orienting the trigger & placing it on flat ground.

Will experiment some more & let you know the outcome.

Thanks again.........


Author Message


Posts: 1473
Rank:


Level: Member

Country: uk
Location:
Occupation:
Age:
In-game name:

 
#6 Posted at 2017-09-25 00:21        
     
I tried raising the trigger height and placing it on a mountain but it always works for me.
I set it at a thousand meters and it still works.


Author Message


Posts: 30
Rank:


Level: Member

Country: us
Location: The Battlefield
Occupation:
Age: 76
In-game name:

 
#7 Posted at 2017-09-25 07:53        
     
Trigger problem Solved. It was me. :-[

In trying to keep the 3d editor uncluttered, I change the trigger height to 3 to five meters for patrols. Changing it back to minus one solved the problem. Any other negative value was returned to zero.

Your code to remove the units was a gem. It removed approx. 45 patrolling units in 11 groups. It will save a ton of typing in the future.

I did run into one problem with it. A second set of patrol units in another area alongside the first set, with a different naming setup.

It threw out an error saying it was a group, but was looking for an object. There weren't any typos to cause this. The first two groups were fine (Patrol0 & 1). It was the last three that were causing the error (Patrol6, 7 & 8).

When I rearranged the group numbers sequentially, the error disappeared along with the units. It appears that the plus sign requires this. Am I correct in this assumption??

Cheers & Thank You......


Author Message


Posts: 1473
Rank:


Level: Member

Country: uk
Location:
Occupation:
Age:
In-game name:

 
#8 Posted at 2017-09-25 13:56        
     
I wouldn't think it was the numbers as it works for none numbered groups as well.
The names are strings and as such have no actual value so numbers are irrelevant.

Try swapping one around again and see if it throws an error again.


Author Message


Posts: 30
Rank:


Level: Member

Country: us
Location: The Battlefield
Occupation:
Age: 76
In-game name:

 
#9 Posted at 2017-09-26 09:27        
     
OK,

I'll give it another go later today....

Added 10 hours 3 minutes later:

I tried it again,

This time with an extra stationary patrol & skipping some sequential numbers.

The error could not be reproduced. More than likely, it was a typo somewhere on my part.

Usually I only saw multiple units grouped with the && operator. Hence the question on my part.

Thanks for taking the time to explain the mechanics of the programming....

This post was edited by OleGreyGhost (2017-09-26 19:31, 26 days ago)