Jump to content
prototype1479

AI iimprovement script (v1.3) AI take cover and swimming script

Recommended Posts

Take cover script

 

 

Features of TC (Take Cover) script :

 

1) AI can dynamically take cover behind 3 different types of sandbags and 2 wreck jeeps

 

2) Not only that they can take cover inside houses too

 

3) The nearby enemy position is calculated and defenders will take cover on positions that fits right for them (For example if AI is taking cover in a house then they will take cover behind the nearest window to the enemy position)

 

4) There is also the assaulters they behave differently. They either push/flank or take cover using bushes by setting them on "RED" combat mode (Depending on the situation)

 

5) AI can be suppressed - just shoot somewhere near AI and they will go prone (If they are taking cover)

 

Instructions are inside TC_Init.sqs there is also more in-depth info there

 

Features of SW (Swimming script) and how it works :

 

The main feature of SW is that you literally swim but there is few conditions - the unit must be in prone and must be slightly above sea level

 

You will swim up if you fell into the water

 

The way the script works is that a pallet spawns under you and that keeps you from falling

 

The file : https://bit.ly/2FZJwps

 

Oh also there is 1 more feature on take cover script that AI sends info about enemy positions time to time

 

There is something on OFP that bothers me when there is a nearby group that is getting killed the other nearby group doesn't notice that but that feature fixed that

 

NEW UPDATE! 

 

-Script is slightly more optimized

 

-When the AI died and spawned again the AI didn't had the effects of the script but now it does

 

-I think I might have fixed a bug where the game freezes completely it doesn't even crash if you see it happen then post here so we can fix it I'm still not sure if this is the fix though

 

-I improved revive script too now when a unit dies the body bag spawns right at their location and also they automatically follow their leader after they revived (I'm not taking credit for the work though I already credited them inside the missions briefing)

 

-The test mission had some bugs itself like to some players in MP , the objective didn't progress to them

 

Now in future updates I might improve the system of take cover script right now the script controls the units per script but in future I might do it groups per script it increases the optimization and fixes some things that I wanted to fix

 

And also  after all of these I'm going to make a mod for this so people who want to play with this wouldn't waste their time trying execute the script for each soldier

 

It's the same link as previous one but I thought I should still put one in this post too

 

Cya

  • Like 2

Share this post


Link to post
Share on other sites

NEW UPDATE! (Again)

 

-Script is even more optimized than before - one of the scripts checks your FPS and if your FPS is doing bad it will increase the delays depending on how well/bad your FPS did

 

-The bug where the game completely freezes is now completely gone (Probably. Well I at least fix the one that caused it)

 

-The AI didn't send info's correctly to the other groups but that's fixed now

 

-Delay for suppressing the AI is now decreased a little now they react quicker to it

 

-And some other minor fixes

 

Next Time I will probably make a mod out of this so others don't have to manually execute the script for each soldier

 

So here is the file : https://bit.ly/2FZJwps

 

It's the same link as previous one but I thought I should still put one in this post too

 

(It's Swim and Cover v2.01 now btw)

Share this post


Link to post
Share on other sites

Very nice! If you're still working on this, I'd be definitely interested in a mod version as well. :)

  • Like 1

Share this post


Link to post
Share on other sites

I'm working on the mod it will come with my own campaign and with AI take cover v1.4 and with some of my own scripts

 

Here's the feaures:

 

1) AI can only take cover in houses (behind windows , on top of towers and ect.) jeepwrecks and sandbags (100% done)

2) AI sends info to other groups they know about locations of the enemy positions (100% done)

3) AI will hold fire and seek cover first if they see an unknown target and if the unknown target hasn't seen them (50% done)

4) AI can be supressed by other AI and by the player too and it will make them go prone (Redoing this 10% done)

5) AI won't take cover if the AI isn't following the leader or the player is their leader (Almost done)

6) AI groups can get pressured/pinned down if they are outnumbered and they will take cover more often rather than moving to their next waypoint (0% done)

7) AI won't be affected by the script in cutscenes and this will ensure that cutscenes are in the way they are meant to be (100% done)

 

In the future I might add AI taking cover on hedges/hills/ground

 

Now i use optimized structure for finding cover and the script will automatically optimize itself by increasing the delays depending on how any AI is on the mission

 

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites
Quote

4) AI can be supressed by other AI and by the player too and it will make them go prone (Redoing this 10% done)

 

I remember in SLX being suppressed by enemy fire made missions unplayable as you were constantly forced to the ground.

  • Like 1

Share this post


Link to post
Share on other sites

Well mine is going to be completely different

 

PS: I didn't liked that part of SLX especially the part where you drop the gun on your hand randomly

Share this post


Link to post
Share on other sites
On 13. 1. 2019 at 8:17 AM, prototype1479 said:

I'm working on the mod it will come with my own campaign and with AI take cover v1.4 and with some of my own scripts

 

Here's the feaures:

 

1) AI can only take cover in houses (behind windows , on top of towers and ect.) jeepwrecks and sandbags (100% done)

2) AI sends info to other groups they know about locations of the enemy positions (100% done)

3) AI will hold fire and seek cover first if they see an unknown target and if the unknown target hasn't seen them (50% done)

4) AI can be supressed by other AI and by the player too and it will make them go prone (Redoing this 10% done)

5) AI won't take cover if the AI isn't following the leader or the player is their leader (Almost done)

6) AI groups can get pressured/pinned down if they are outnumbered and they will take cover more often rather than moving to their next waypoint (0% done)

7) AI won't be affected by the script in cutscenes and this will ensure that cutscenes are in the way they are meant to be (100% done)

 

In the future I might add AI taking cover on hedges/hills/ground

 

Now i use optimized structure for finding cover and the script will automatically optimize itself by increasing the delays depending on how any AI is on the mission

 

 

Sounds stellar. Cannot wait.

 

How compatible will it be with other mods? Say, if I wanted to use Extended Effects alongside your mod, will it work from get go or will it need some kind of compatibility/merged config.cpp?

Share this post


Link to post
Share on other sites

Well yeah the only way to give AI a script you need to use config so you have to merge them

Share this post


Link to post
Share on other sites
On 1/13/2019 at 10:17 AM, prototype1479 said:

Here's the feaures:

 

Nice but I remember there were similar features in SLX mod.

 

About AI taking cover in buildings I'd suggest replacing "lying" animation with crouching so that would look natural

 

 

 

Share this post


Link to post
Share on other sites

Lying? does it lie all the time? And yeah they should be crouching most of the time

 

This is an outdated version anyways in 1.4 there will be drastic changes (I'm also having issues with life so it will come out later than I plan all the time)

Share this post


Link to post
Share on other sites

Vanilla AI mechanic is that soldiers hit the ground all the time. It's realistic but not fun.

Share this post


Link to post
Share on other sites

If you want vanilla AI to not hit the ground all the time then put this on units INIT field : this setunitpos "UP"

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

×