Home   Help Search Login Register  

Author Topic: take cover  (Read 978 times)

0 Members and 1 Guest are viewing this topic.

Offline 456820

  • Contributing Member
  • **
take cover
« on: 01 Jun 2005, 18:16:26 »
im looking for an easy script wich will make all units left alive or ones that i tell find cover and still engage the enemy like General Barrons take cover script or atleast i think its general barons i would use that but it always seems to cause CTD's for people so its best not to use it, so im jsut thinking where they will find the nearest bush watch east, and enage at will. how would i go about doing this ?

Offline sharkyjoe

  • Members
  • *
  • Have you taken a BMP out at 500 meters??
Re:take cover
« Reply #1 on: 02 Jun 2005, 04:34:08 »
Ok I'm not the best at this, but this is to get you thinking about it.
Find the code that is in the Game, inwhich you(leader), direct your men to Find Cover( under move command playing in game).
Use the countside/friendlies command for the when ever the number drops below your ideal number of guys.
Use the combat(Red)or (yellow)
Put it into a script.
Maybe others can help ya better than I. ???
Sorry it wasn't the magic answer but hopefully this gets ya thinking and looking.
« Last Edit: 02 Jun 2005, 04:35:40 by sharkyjoe »
Remember the 7 Ps??--- Proper Previous Planning Prevents Pathetically Poor Performance

Offline 456820

  • Contributing Member
  • **
Re:take cover
« Reply #2 on: 02 Jun 2005, 08:00:32 »
thats the code im looking for but i dont think an acual code 'take cover' exists so i thought a script isin order

Offline sharkyjoe

  • Members
  • *
  • Have you taken a BMP out at 500 meters??
Re:take cover
« Reply #3 on: 03 Jun 2005, 19:30:48 »
Well not to let post flounder, I found this.

http://www.ofpec.com/editors/funcref.php?filter_cat=5#nearestObj

nearestObj  by General Barron

Category: Objects and Groups

Syntax: [Object,Array] call nearestObj

Returns: Object

Example: [player, ["grenade","grenadehand"]] call nearestobj, result is the "grenade" or "grenadehand" that is closest to player

Description:

This function works almost exactly like the in-game command nearestObject, only it can find the closest object out of an array of object types, instead of just one object type. It is similar to what a "nearestObject <class>" command would be like.

  For example, you could find the nearest object out of an array of tank types, or the nearest castle wall (there are many types), or the nearest bullet, or whatever else you can think of. All you have to do is specify each object that can be returned in an array.

  The type array can also be placed in a variable, and the variable placed where the array would be when calling the function. An example:
Quote:cover = ["FenceWood","wire","UralWreck"]
unit1 domove getpos ([unit1,cover] call nearestobject)


  This function is limited in the same way as the nearestObject command. First off, you have to specify a unit, not a position to find the nearest object to (what it says in the command reference is wrong). Also, the max range is 50 meters!

  Have fun!

I think if ya have anymore in depth Questions on this myabe ask The General B. directly. This is starting to get over my head.
Again hope this helps a little more  :P
Remember the 7 Ps??--- Proper Previous Planning Prevents Pathetically Poor Performance

Offline 456820

  • Contributing Member
  • **
Re:take cover
« Reply #4 on: 03 Jun 2005, 20:04:29 »
well i understand that but how can i check wich is the nearest bush/shrub to the unit

Offline sharkyjoe

  • Members
  • *
  • Have you taken a BMP out at 500 meters??
Re:take cover
« Reply #5 on: 03 Jun 2005, 21:06:40 »
Well according to this:
 
nearestObject pos

Operand types:
pos: Array
Type of returned value:
Object
Description:
Nearest building of given type to given position or object. pos may be [x,y,z, "type"] or [object, "type"].

Example:
nearestObject [player, "StreetLamp"]

comment »

General Barron  September 27, 2003, 08:48  
Two notes here. First, although it says you can give it coordinates; you have to pass it an object or unit to search from. Second, this command can only find objects up to 50 meters away.

EDIT:

You can also use the command: nearestobject [x,y,z] to find the closest object of ANY type near that point.
 
 
Fragorl  May 09, 2005, 09:59  
And we really mean ANY type. As well as ammunition, units and vehicles, nearestobject is liable to pick up: craters, footprints, marks and other decals.

It seems that they have dealt with this before and have greater knowledge than I. :-[

 
 

 
 
Remember the 7 Ps??--- Proper Previous Planning Prevents Pathetically Poor Performance