Home   Help Search Login Register  

Author Topic: Cover Script  (Read 763 times)

0 Members and 1 Guest are viewing this topic.

Yahoo

  • Guest
Cover Script
« on: 04 May 2003, 20:46:26 »
Is any one working on a script that makes units once they start takeing fire they run to the nearset object eg Truck,Car etc and crouch/Lay down behined or near it for a few seconds then contunie to the next object until they reachg there waypoint


Thanks for your time
« Last Edit: 04 May 2003, 21:50:22 by Yahoo »

Offline @cero

  • Members
  • *
  • Yeah! Get some!!
Re:Cover Script
« Reply #1 on: 05 Jun 2003, 03:44:00 »
I don't like to fetch old posts back to the light, but this is what I wanted too. I been looking in this forums for a whille and I can't find nothing.
The other scripts to improve the AI are really good, but don't cover this part of it.
I don't got a clue about scripting, so if someone could help us would help alot more people than two.
Thanks.
« Last Edit: 05 Jun 2003, 03:44:41 by @cero »
SCREWBY!!!

Offline @cero

  • Members
  • *
  • Yeah! Get some!!
Re:Cover Script
« Reply #2 on: 06 Jun 2003, 00:52:50 »
I don't want to be a pain in the rear, but I would like to know if that is posible, and if so, anybody can hellp or create an script for the comunity? Please. ;D
SCREWBY!!!

Offline @cero

  • Members
  • *
  • Yeah! Get some!!
Re:Cover Script
« Reply #3 on: 09 Jun 2003, 18:33:27 »
Oh c'mon guys, it must be someone that can at list work out something at list a bit close to a script like that.
What is needed?

The AI won't go and find cover when they are under fire, so if you are in advantage(Fyghing a chopper and firing at them, or ambushing them, etc) its just too easy, and we don't want to put 600 units in a map just for the seek of making it more challenging for the player.
There is some good scripts around, but nothing that covers this part of the AI, take cover while under fire and run like hell to somewhere safe before it opens fire.
I'm sure is a "neares ovject" comand, so it must be a way to get the AI to use it through a script or something.
Some imput would be nice.
please...
SCREWBY!!!

Offline General Barron

  • Former Staff
  • ****
  • Semper Fi!
Re:Cover Script
« Reply #4 on: 12 Jun 2003, 04:48:04 »
I've thought about this too. I really hope they put this into the AI in OFP2. Anyway, it could be done in OFP1, although with some difficulty.
There is a "nearestobject" command, so it would seem pretty easy to do. However, there is a problem: you can only get the nearest object of one specific type with this command. That means, you can only get the nearest jeep, or the nearest ammo crate, or the nearest building of one specific type.

I have an idea for a solution to this, but I haven't gotten around to doing it yet. The thing to do would be to make a function that loops through a large number of "nearestobject" commands, finding everything that you can think to enter (such as bushes, vehicles, fences, et. al.). It then returns the closest object out of all of these. I did something similar to this my manMG script, which makes the closest unit run to man a MG after its gunner dies.

The main thing stopping me from doing this is (a) I don't have Resistance (I'll cough up the $10 bucks for it eventually), and (b) I don't know the names for terrain objects, such as bushes, trees, etc. If anyone knows these names, or how to find them, it would be great.

After making that function, it would be fairly easy to make a script like the one you are talking about. I was thinking about this for other reasons, such as flanking, retreating, etc. Maybe all of these functions could be put together into one big AI script.

Barron out.
HANDSIGNALS COMMAND SYSTEM-- A realistic squad-control modification for OFP
kexp.org-- The best radio station in the world, right here at home! Listen to John Richards!

Bremmer

  • Guest
Re:Cover Script
« Reply #5 on: 12 Jun 2003, 13:53:44 »
Try switching to stealth mode when under fire - Units are supposed to seek cover when in stealth mode.

As previously mentioned it probably is possible to create a really in depth cover script, but the logistics of finding the positions of all the enemy a unit knows about and deciding which direction to take cover from, gathering all the nearest objects which could provide shelter and deciding which one is best, getting the unit behind that object and facing the right direction is a real headache. I started writing some routines for my AI script but the effect I managed to produce was inferior to just setting the units on stealth.

I agree its far from a perfect solution, and hope BIS will improve the AI in OPF2 to cover this.

Cheers

Yahoo

  • Guest
Re:Cover Script
« Reply #6 on: 12 Jun 2003, 18:23:24 »
Alright then Bremmer Your AI Scripts are the best!

Offline @cero

  • Members
  • *
  • Yeah! Get some!!
Re:Cover Script
« Reply #7 on: 13 Jun 2003, 07:33:19 »
That is all good to set the units in steallth if they are in your squad and you are the team leader, but remember that even using sweetch triggers and waypoints the AI still taking a few shots to realice that its something going on, never mind telling them to find cover, they'll allready waysted.
The ones I'm worrying about are the enemy AI and the ones I'm not controlling.
I think that by what you are saying it can be done even easyer, by creating a script that makes the AI to go on stealth mode after a shot is bin fired. that way the AI would look like if they are actuall taking cover.
Can this be done? Is anyway to change the combat mode of the AI by just firing a weapon from the first shot?
I know they supose to react to this, but I have the impression that this only gos on if the weapon is bin fired from short to medium range, if someone is sniping from far awy the AI don't seams to react, they only react when you kill one of the members of theyr own group, but if you miss the shot is not guarantied they are going to react by just hearing the shot and the bullet hiting the ground.
Do I make any sense?
Sorry about my english, I know is hard to understand sometimes. ;D
SCREWBY!!!

Offline XCess

  • Former Staff
  • ****
Re:Cover Script
« Reply #8 on: 13 Jun 2003, 14:46:44 »
Hey @Cero! I haven't read all the posts so I might be repeating somebody else. When unit's come under fire they behaviour is always set to COMBAt uness it has been set to CARELESS before hand. So for each uniots you could make a script cheking if tehir behaviour is COMBAT and then type this:

_obj = NearestObject _unit
_unit doMove (getPos _obj)

I'm guessing that will work. Also you couldn add a loop checking if the unit is close enough to it then make them get down. The full script is below, should work but you may need to make adjustments as I haven't done any scripting for a while.

_unit = _this select 0
#begin
@_unit getBehavioure = "COMBAT"

_obj = NearestObject _unit
_unit doMove (getPos _obj)


#loop
?(_unit distance _obj < 2): _unit setUnitPos "down"; goto "begin"
~0.1
goto"loop"

Offline DrStrangelove

  • Members
  • *
  • Mr.Creative
Re:Cover Script
« Reply #9 on: 14 Jun 2003, 11:43:49 »
Won't work. Unit would go to nearest object and then stay there forever (because there is only 1 nearest object).

Even IF this would work, this script would need to run by all ai units in game. A game with 50 units that have 50 scripts running & looping would surely lag as hell, wouldn't it ?

Offline XCess

  • Former Staff
  • ****
Re:Cover Script
« Reply #10 on: 14 Jun 2003, 17:25:51 »
I'm sure I have scripts running for each unit without slowdown beofre, and the purpose of the script would be fore defending forces anyway,; the fact that they saty by the object will be good, meaning they hide for longer. It would seem like they are trying to ambush you in the steets.