Home   Help Search Login Register  

Author Topic: Tank targets  (Read 1884 times)

0 Members and 1 Guest are viewing this topic.

simoneldridge

  • Guest
Tank targets
« on: 02 Jun 2004, 23:38:49 »
Hi Guys

can some one please tell me if its possible to have a group of Tanks (3x T72)
firing randamly at a set target like a town or maybe just an area lets say 100m square???....any help would be much appreciated!!

Many thanks :)

Wedge

Offline Tomb

  • Contributing Member
  • **
  • in2 Metal? Go 2 my sig
Re:Tank targets
« Reply #1 on: 02 Jun 2004, 23:59:43 »
you can doTarget some object and then use the "fire" spell :

tank1 fire [a, b, c]

where abc are muzzle, weapon, ammo (as fasr as I recall, its been a while)  :P ::) ;D

Dubieman

  • Guest
Re:Tank targets
« Reply #2 on: 03 Jun 2004, 00:57:04 »
Or invisible targets of some sort and after a knowsabout command is returned a timer goes off in a script which then deletes these targets so that the t72s don't just go crazy on these tarets but make an opening barrage.

Just an idea...
« Last Edit: 03 Jun 2004, 00:57:41 by GuiltyRoachKilla »

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Tank targets
« Reply #3 on: 03 Jun 2004, 11:00:32 »
There is an invisible target addon somewhere ... you could get the tanks to target it repeatedly while moving it around randomly.
Plenty of reviewed ArmA missions for you to play

simoneldridge

  • Guest
Re:Tank targets
« Reply #4 on: 03 Jun 2004, 11:27:23 »
Thanks for all the help guys

the only problem is im not too good at scripting.. so therfeore i dont really know about the knowsabout command.

Without being cheeky i really need someone's help pretending im a complete idiot who has never done any real scripting
(acually theres no need to pretend  ;D)

i like what Macguba said but have no idea how to go about it :'(

Wedge

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Tank targets
« Reply #5 on: 03 Jun 2004, 14:04:54 »
First of all, find the invisible target addon.  It's not hosted at ofpec though somebody did once put a link on the forum.    

Right, now insert said target into the mission.   I'd have one target for each tank.    Place it somewhere in the area you want the tanks to suppress.    Right next to each target insert a gamelogic.   Name everything.

Now read snYpir's Friendly Intro to Code Snippets and Johnd Gustafsson's Scripting Guide.   They will give you the basics of how to create a script file (easy peasy) and make it work (ditto).

Now you need a script.   I'm no scripter - this is just a sketch and in particular the syntax is not guaranteed.   Somebody nice might write you a proper script but this will get you started if they don't.

; this script makes the tanks fire into the village

tankStop=false
_maxDist1=100
_maxDist2=150
_maxDist3=200

#loop
? tankStop: exit
~3

tank1 doTarget target1
tank2 doTarget target2
tank3 etc  (I won't put in all the extra tanks here )

tank1 doFire target1
tank2 etc etc

_rand1A = (random 40) - 40
_rand1B = (random 40) - 40
target1 setPos getPos [(getpos target1 select 0) + _rand1A, (getpos target1 select 1) + _rand1B, 0]
? target1 distance gameLogic1 > _maxDist1: target1 setPos getPos gameLogic1

_rand2A = (random 40) - 40
_rand2B = (random 40) - 40
target2 setPos etc

goto "loop"


Plenty of reviewed ArmA missions for you to play

simoneldridge

  • Guest
Re:Tank targets
« Reply #6 on: 10 Jun 2004, 00:55:41 »
hey mac

sorry about the late reply

firstly thanks for all your help
but im afraid its not working

it tells me that there is an error getpos:type array

but its so long i cant read the whole error message

this is what i got so far...

tankStop=false
_maxDist1=100
_maxDist2=150
_maxDist3=200

#loop
? tankStop: exit
~3

tank1 doTarget target1
tank2 doTarget target2


tank1 doFire target1
tank2 doFire target2

_rand1A = (random 40) - 40
_rand1B = (random 40) - 40
target1 setPos getPos [(getpos target1 select 0) + _rand1A, (getpos target1 select 1) + _rand1B, 0]
? target1 distance gameLogic1 > _maxDist1: target1 setPos getPos gameLogic1

_rand2A = (random 40) - 40
_rand2B = (random 40) - 40
target2 setPos getPos [(getpos target2 select 0) + _rand2A, (getpos target2 select 1) + _rand2B, 0]
? target2 distance gameLogic2 > _maxDist1: target2 setPos getPos gameLogic2

goto "loop"

sorry to be a pain

Wedge ;D

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Tank targets
« Reply #7 on: 10 Jun 2004, 11:41:33 »
I'm afraid we need more of that error message.     Make it happen several times and write down more of it each time.    In particular we need to know where the # occurs.

Syntax is not my strong point so use the comrefs to check all the getpos commands in the script.

The random 40 - 40 should of course be random 40 - 20, to give you a random number between -20 and +20. OR of course you can change it to whatever you want.   Similarly the maxdists, the actual number is entirely up to you.
« Last Edit: 10 Jun 2004, 11:42:37 by macguba »
Plenty of reviewed ArmA missions for you to play

simoneldridge

  • Guest
Re:Tank targets
« Reply #8 on: 10 Jun 2004, 13:39:09 »
Hi

Well as i said...the error message is so long i cant read it all unless there is a way that you can??

all i can see is this

target2 setPos getPos [(getpos target2 select 0) + _rand2A, (getpos target2 select 1) + _rand2B, 0]|#|':Error Getpos: Type Array, expected

I cant see any more than that ???

Sorry




Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Tank targets
« Reply #9 on: 10 Jun 2004, 15:14:05 »
No, that's fine - you sometimes can't see the end but it's always true that the more you can quote the better, if only so that we can be sure of which line is causing the problem.   ALWAYS quote as much of an error message as you can.     In this case it's given me enough of a clue.    There's an extra getpos in there, which is the sort of thing that happens to me ALL the time.   Try

target1 setPos [(getpos target1 select 0) + _rand1A, (getpos target1 select 1) + _rand1B, 0]

and similarly for target2: both have the error but the target2 one occurs last, which is why it appears as the error message.
« Last Edit: 10 Jun 2004, 15:15:31 by macguba »
Plenty of reviewed ArmA missions for you to play

simoneldridge

  • Guest
Re:Tank targets
« Reply #10 on: 10 Jun 2004, 19:17:44 »
Hey mac thanks for that

there is no error meassage any more

but i have been a bit of a plum.... i cant find the invisible targets anywhere

has anyone got any ideas??

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Tank targets
« Reply #11 on: 10 Jun 2004, 20:23:22 »
I can tell you that they are not at ofpec, but they are somewhere vaguely sensible.   Somebody has posted the location on this board, so the forum search function might do the trick.  

But if somebody knows where they are, post it here.
Plenty of reviewed ArmA missions for you to play

Offline ACF

  • Members
  • *
  • Llama?? Ain't that French for tanks?
Re:Tank targets
« Reply #12 on: 10 Jun 2004, 20:27:03 »
I've been shamed into action and have something close to what you [might] want now sitting on the Addons Beta Forum.

It seems odd that OFPEC hasn't got its 'own' solution to a common problem.  Time to put something back into the pot, I think . . .

Offline Wadmann

  • OFPEC Patron
  • ****
  • I'm the next evolutionary step after a llama!
Re:Tank targets
« Reply #13 on: 10 Jun 2004, 21:50:11 »
Hey all!

Here is a link with the invis targets included in Keycats cool MG supression script. Both are worth having.

http://keycat.no-ip.com/files/ManMG_001.zip


                                                       Wadmann
Check out my Camouflage Collection! New items added 31 July 2005.

simoneldridge

  • Guest
Re:Tank targets
« Reply #14 on: 10 Jun 2004, 23:34:31 »
thanks wadmann.

il try it now with targets

 ;D