Jump to content
avibird 1

Patrol boats keep beaching itself when enemy units spotted. Is there any easy fix for this.

Recommended Posts

Yes I know I can set behavior careless but that defeats having patrol boat along the coast. When enemy units make contact the patrol boat usually beaches itself attempting to get into position to shoot at the enemy units. I know there are some random boat patrol scripts out there but I need specific route for the boats to take. Frustrating that Bohemian does not have a waterway point or a real helicopter patrol waypoint as well. I know loiter was supposed to be that kind of waypoint but the helicopters usually don't engage even with the AI skill levels jacked up it takes aggressive ground units shooting at the helicopter for it to return fire. Sorry for add in the helicopter issue but WTF Bohemia basic waypoints that work would be nice instead of alien shit🤪. Any suggestions would be grateful.

  • Like 1

Share this post


Link to post
Share on other sites

Would having the driver in a separate group help? You could then put the driver on CARELESS and leave the rest of the group free to engage their enemies. 

  • Like 1

Share this post


Link to post
Share on other sites

Well never really thought of that will give it a go. It's just frustrating half quarter of the time the boat destroyed itself 75% of the time it will get stuck on the shoreline for a significant time or just the crew gets gunned down while beached.

 

How to get a helicopter to engage foot mobiles while I think I need magic pixie dust for that. Thanks for the suggestion 👍

  • Like 2

Share this post


Link to post
Share on other sites
19 hours ago, avibird 1 said:

aggressive ground units shooting at the helicopter for it to return fire.

 

Here is what i like to use with helicopters and planes in order to be more active :

 

ex:

while {alive _Spawned_Helicopter} do{
	_Spawned_Helicopter flyInHeight (50 + (random 2000));
	_getPosATL = getPosATL _Spawned_Helicopter;
	_nearEntities = _getPosATL nearEntities 2000;
	{_Group_Crew reveal [_x,4];}count _nearEntities;
	uisleep 50;
	};

You could use also an eventhandler about it ( fired ) , but i can't give you an example on right now.

 

For the boat , you can add a script for the driver to check the sea depth.

@johnnyboy has create a patrol script.

Maybe he can help you about it.

  • Like 3
  • Thanks 1

Share this post


Link to post
Share on other sites

I have generally stayed away from AI boats due to terrible experiences I have had with them.

 

With that said, off the top of my head, there may be some things that (could) help? I'm at the office here, so I can't test anything.

 

On the init of the vehicle, you could try a limitspeed command

this limitspeed 10;

Sure it won't make the boat "zoom" around, but it may give them just enough "control" to not beach their boat?

 

You could try splitting the driver/gunners into two separate groups and give the driver careless behavior, or possibly settings the whole group to careless and looping a suppressivefire command once they detect the players.

 

Worst comes to worst, you can make the boat not take damage, and occasionally check if the boat is beached with issurfacewater, and then setvelocity back into the water or setpos it.

  • Like 2
  • Thanks 1

Share this post


Link to post
Share on other sites
9 hours ago, avibird 1 said:

how do I call in your code snippet? 

 

Do you want to apply the code to spawned units or placed in the editor ?

Share this post


Link to post
Share on other sites

Editor placed units.i am old school most of the time I use editor placed units. I like to see them on the map😊

  • Like 1

Share this post


Link to post
Share on other sites
20 hours ago, avibird 1 said:

editor placed units.

and no other unit is spawned right ?

Hold on to give you the best option in my opinion.

  • Like 2

Share this post


Link to post
Share on other sites

add this in your initserver.sqf and adjust this to your needs :

waituntil{time>0};

GF_reveal = {

	while{alive _this}do{
		//	_this flyInHeight (50 + (random 2000));	//	adjust flyInHeight
		_getPosATL = getPosATL _this;
		_nearEntities = _getPosATL nearEntities 2000;
		//	hint format ["%1",_nearEntities];	//	for test
		{group _this reveal [_x,4];}count _nearEntities;
		uisleep 50;
		};
};


[]spawn{
	{
		if((_x isKindOf "Air") or (_x isKindOf "Helicopter"))then{
			_x call GF_reveal};
	}forEach vehicles;
};

 

  • Thanks 1

Share this post


Link to post
Share on other sites

Here is a workaround about the ships (boat) , but i don't have time to check it further now :

waituntil{time>0};

GF_Boat_depth = {
	
	while{alive _this}do{
		_TerrainHeight = getTerrainHeightASL (position _this);
		systemchat format ["%1",_TerrainHeight];
		if(_TerrainHeight > -20)then{
			systemchat "depth > -20";
			
			//	code to move the ship to a different direction
			}else{
				systemchat "depth ok";
			};
		uisleep 3;
	};
};


[]spawn{
	{
		if(_x isKindOf "ship")then{
			_x call GF_Boat_depth};
	}forEach vehicles;
};

 

  • Thanks 1

Share this post


Link to post
Share on other sites

@GEORGE FLOROS GR Thank you as usual people like you make this community what it is. With that said. Don't LOL but how do I call the code in. I put the code in the  initserver.sqf place down two birds on the map within 1000 meters of the camp one on the ground and one in the air. Start the mission and the choppers don't move. Now I assumed that the code would be call for any air/Helicopter that was placed on the map from the editor but do I need to spawn the chopper from a sqf and not use the editor. I  mostly use editor placed units and use jebus script to spawn additional units if I needed them but I usually have 90% of the units on the map with only one life.  I am old school like that. How do I call the code for the editor placed choppers.

  • Thanks 1

Share this post


Link to post
Share on other sites
18 hours ago, avibird 1 said:

the code would be call for any air/Helicopter that was placed on the map from the editor

 

This code is for every flying type , that is placed in the editor , but not for spawned ones , because the current

code doesn't loop. ( this can change ofcourse).

So as said you just need to place your code in the initserver.

I don't know about the movement issue that you said , because this should not have any reaction to their waypoints and as far i have played i didn't notice anything about.

I'll be waiting for your news and in the meantime , i'm going to check for a code about the ship movement.

 

  • Thanks 1

Share this post


Link to post
Share on other sites

Here is some progress :

 

waituntil{time>0};



GF_Boat_depth = {
	
	_found = false;
	while{(alive _this) && (!_found)}do{
		_TerrainHeight = getTerrainHeightASL (position _this);
		systemchat format ["%1",_TerrainHeight];
		if(_TerrainHeight > -20)then{
			systemchat "depth > -20";
			
			//	code to move the ship to a different direction
			
			group _this setSpeedMode "LIMITED";
			
				while{!_found}do{
					private _pos =  [[[position _this, 100]],["ground"]] call BIS_fnc_randomPos;
					
					_depth = getTerrainHeightASL _pos;
					if(_depth < -20)then{

						if(count waypoints group _this > 0)then{
							{deleteWaypoint((waypoints group _this)select 0);}forEach waypoints group _this;
						};

						_Wp = group _this addWaypoint [_pos, 0];
						_Wp setWaypointType "MOVE";
						group _this setSpeedMode "NORMAL";
						systemchat "addWaypoint";
						_found = true;
					};
					uisleep 0.05;
					systemchat format ["_found : %1",_found];
				};
			
			}else{
				systemchat "depth ok";
			};
		uisleep 3;
	};
};


[]spawn{
	{
		if(_x isKindOf "ship")then{
			_x call GF_Boat_depth};
	}forEach vehicles;
};

 

  • Thanks 1

Share this post


Link to post
Share on other sites

@GEORGE FLOROS GR 

Just to be clear on my part not yours lol. The code does not add waypoints to the air units so if the units have no waypoints they will stay still. 

 

The script makes the units move in a bigger range and improves their awareness and knowledge of enemy units.  Is this right on my part to assume that. 

  • Like 1

Share this post


Link to post
Share on other sites
On 8/23/2019 at 5:31 AM, avibird 1 said:

improves their awareness and knowledge of enemy units

 

 

https://community.bistudio.com/wiki/reveal

 

and you can also uncomment ( // ) the line about the flight height

//	_this flyInHeight (50 + (random 2000));	//	adjust flyInHeight

 

so you can add your WP from the editor or with scripts.

Share this post


Link to post
Share on other sites

@GEORGE FLOROS GR 

 

I was probably doing something wrong as usual lol. I made a new mission without mod's and delete it my initserver.sqf and made a new one with only your code. What a difference those poor bastards don't have a chance now escaping from the POW camp as well as a lot of collateral damage to the prison guards 😊.

 

It's just a shame that Bohemia puts out this amazing game with all the possibilities but never quite finishes everything and leaves it up to the community to tweak and fix issues that the vanilla game should have. There is no way in an open field that a helicopter should fly by three or four squads of enemy soldiers and barely engage them in wide-open territory. 

 

I really should know now when having an issue start from scratch and work my way back up. There was probably something with a mod or something in the original initserver.sqf that was not allow your script to work. Thank you brother and if you ever see me on please stop by I host my own server avibirdpc I'm not into the whole big clan thing never have never will only like playing with a few people less BS.

  • Like 1

Share this post


Link to post
Share on other sites

@GEORGE FLOROS GR lol one more  issue your code works to good 😂 The air vehicles know where the units are all the time no hiding or escaping even if I transport the pow group across the map using a cheat code the air vehicles will move towards their location. This may not be what I need for this particular mission because you can't avoid and escape the helicopters without shooting them down. 

 

  • Like 1

Share this post


Link to post
Share on other sites

I will and let you know brother 👍

  • Like 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

×