Home   Help Search Login Register  

Author Topic: Spoter script  (Read 3142 times)

0 Members and 1 Guest are viewing this topic.

Teryan

  • Guest
Re:Spoter script
« Reply #15 on: 12 Aug 2003, 20:10:00 »
Here is why when the guy calls out the range of the units it is bogus:

Teryan

  • Guest
Re:Spoter script
« Reply #16 on: 12 Aug 2003, 23:12:31 »
Ok, I think i know how this is going to work.

Creat a trigger,
Condition: spotter knowsAbout target1 > 3
On Activation: Call script spotter

Creat a trigger,
Condition: spotter knowsAbout target2 > 3
On Activation: Call script spotter

Creat a trigger,
Condition: spotter knowsAbout target3 > 3
On Activation: Call script spotter

Script spotter:
Quote
spotter sidechat format ["Distance = %1",sniper distance target1]

_dis=sniper distance _target1
_dis=_dis + _dis*(((random 20)/100) -.1)
spotter sidechat format ["Distance = %1",_dis]

target1 addEventHandler ["killed",{_this exec "targetKilled.sqs"}]


;target2

spotter sidechat format ["Distance = %1",sniper distance target2]

_dis=sniper distance _target2
_dis=_dis + _dis*(((random 20)/100) -.1)
spotter sidechat format ["Distance = %1",_dis]

target2 addEventHandler ["killed",{_this exec "targetKilled.sqs"}]


;target3

spotter sidechat format ["Distance = %1",sniper distance target3]

_dis=sniper distance _target3
_dis=_dis + _dis*(((random 20)/100) -.1)
spotter sidechat format ["Distance = %1",_dis]

target3 addEventHandler ["killed",{_this exec "targetKilled.sqs"}]



;so on for however many targets there are...

Quote
;and targetkilled.sqs contains this:

_killer=_this select 1

?_killer==sniper:hint "Hit!"

I can't get it to work (Suprise!) so if someone could give it a go.  There is probley something stupid i am missing.

So what do you think of it?  I know there would be alot of work, but it seem like it would work.
« Last Edit: 13 Aug 2003, 04:42:21 by Teryan »

SheepOnMintSauce

  • Guest
Re:Spoter script
« Reply #17 on: 13 Aug 2003, 01:14:05 »
Why don't you make it a loop for however many targets there are and repeat the script that many times? It'd save you a lot of work typing it all out over and over.

Also, I remember seeing a tutorial by snYpir in the editing depot on how to use the laser designator in scripts http://www.ofpec.com/editors/resource_view.php?id=438 and to quote him.

Quote
The laser designator is the only way that the player can pass a position selected in the 3D world to a script (as opposed as selecting a position via clicking on the map, for example).

So, maybe that is worth checking out. It might come in handy for you somehow.  :)

Teryan

  • Guest
Re:Spoter script
« Reply #18 on: 13 Aug 2003, 02:09:38 »
Quote
Also, I remember seeing a tutorial by snYpir in the editing depot on how to use the laser designator in scripts http://www.ofpec.com/editors/resource_view.php?id=438 and to quote him.

Ok thanks, but that is not what i am looking for....
I think we have found a way without the lazerrnagefinder thow.

Is there a way to add a number to the name of a string?  If so that would make life easy (as you sead).


target1 = name of solidger
target2 = name of solidger
targetx = name of varable

targetx == 0

loop
{
 
  if targetx != triggername(or what have you)
  then targetx + 1
}

Something like that possible?

SheepOnMintSauce

  • Guest
Re:Spoter script
« Reply #19 on: 13 Aug 2003, 05:30:11 »
You should try to get yourself a copy of the command reference that is floating around somewhere. If you can't find one I'll host it for you, but that has all the commands you can use while scripting in OFP. Very helpful stuff.

http://www.w00tsofevil.co.uk/commandguide.zip There you go.  ;D

I think there may be a newer version of it about, unless that is it. It's the one I have, and I've always used it for reference just fine anyway.

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Spoter script
« Reply #20 on: 13 Aug 2003, 12:11:03 »
To answer SheepOnMintSauce's point, there are several versions of the command reference here at OFPEC.

There is an Online version (with helpful comments).  
Downloadable, Unofficial (which is essential reading) and other handy lists - like switchmove animations - are in the Ed Depot under Tutorials - References - Command References.
Plenty of reviewed ArmA missions for you to play

Teryan

  • Guest
Re:Spoter script
« Reply #21 on: 14 Aug 2003, 04:39:30 »
Thank you both.

Does anyone plan on giving it a try?

SheepOnMintSauce

  • Guest
Re:Spoter script
« Reply #22 on: 14 Aug 2003, 17:02:54 »
Why don't you have a play about with it yourself? You can always get help with it on the forum if you get stuck, and there are plenty of tutorials on various things, telling you how to do certain parts of your script on here. It's always handy reading other people's scripts too, to give you ideas on how things work.  :)

SheepOnMintSauce

  • Guest
Re:Spoter script
« Reply #23 on: 17 Aug 2003, 09:05:26 »
Had any luck with this script yet?