Home   Help Search Login Register  

Author Topic: Boomerang  (Read 7459 times)

0 Members and 1 Guest are viewing this topic.

Offline Barbolani

  • Members
  • *
Re: Boomerang
« Reply #15 on: 17 Jul 2008, 19:26:54 »
I apologyse. I didn't seen the link.

True. In fact, the distance is perfectly predictable with maths, playing with doppler effect...

The angle (except about the wind speed / direction) can be detected.

BUT (of course, theres a but) I think a sniper will have enough time to move and hide... but (also) maybe not to make another shot...

Useful, useful xD

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re: Boomerang
« Reply #16 on: 17 Jul 2008, 20:46:28 »
But why do this so insanely complex when you can get the position of the sniper with 'fired' event and one line of code..  :dunno:
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline Spooner

  • Members
  • *
  • Mostly useless
    • Community Base Addons
Re: Boomerang
« Reply #17 on: 17 Jul 2008, 22:23:54 »
Yeah, you need to use the format command to get variable's into a string for outputting.

I'm with h- about the fired handler though. Would make life 100x easier.
[Arma 2] CBA: Community Base Addons
[Arma 1] SPON Core (including links to my other scripts)

Offline Luke

  • Members
  • *
  • Thank God! The OFPEC Staff are here!
Re: Boomerang
« Reply #18 on: 17 Jul 2008, 23:09:47 »
Alright guys,
I'll bite.

What's this single line of code?
The only way I see that done is going through each unit's init and adding an EH.
That sure doesn't seem 10000% easier to me.

@ Spooner; How would I put them in a string?
I tried hint"format ["blab 1%, blab 2%", item1, item2]
but all i got was the hint "format [".

Thanx for the replies, as always.

Luke
« Last Edit: 08 Oct 2008, 23:20:26 by bedges »
Pesky Human!!
Wort Wort Wort.

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Boomerang
« Reply #19 on: 17 Jul 2008, 23:15:01 »
Might be using the correct syntax, as it is quite obvious your command has an extra "
Code: [Select]
hint format ["blab 1%, blab 2%", item1, item2]

Offline Luke

  • Members
  • *
  • Thank God! The OFPEC Staff are here!
Re: Boomerang
« Reply #20 on: 17 Jul 2008, 23:21:30 »
Sorry,

I meant hint"format ["blab 1%, blab 2%", item1, item2]"

Then how do you define where the hint ends?

Thanx for the replies, as always.

Luke

Pesky Human!!
Wort Wort Wort.

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re: Boomerang
« Reply #21 on: 17 Jul 2008, 23:28:46 »
~Now your line has 2 extra ".

You don't need to enclose the format line in quotes.


Planck
I know a little about a lot, and a lot about a little.

Offline Luke

  • Members
  • *
  • Thank God! The OFPEC Staff are here!
Re: Boomerang
« Reply #22 on: 17 Jul 2008, 23:30:18 »
Planck,

Doesn't that define what's in the hint?

Thanx for the replies, as always.

Luke
Pesky Human!!
Wort Wort Wort.

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Boomerang
« Reply #23 on: 17 Jul 2008, 23:32:07 »
Then how do you define where the hint ends?

 :blink: :blink: :blink:
hint (<- ENDS HERE)
hint -> (HAS A STRING HERE)
And what returns format command is a string.
hint "2"
or
hint format ["%1", 2]
format ["%1", 2] is equal to "2" which is a text string.

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re: Boomerang
« Reply #24 on: 17 Jul 2008, 23:32:42 »
In this case your hint is "blah %1, blah %2"

Which are already enclosed.

Planck
« Last Edit: 17 Jul 2008, 23:38:10 by Planck »
I know a little about a lot, and a lot about a little.

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Boomerang
« Reply #25 on: 17 Jul 2008, 23:35:24 »

Offline Luke

  • Members
  • *
  • Thank God! The OFPEC Staff are here!
Re: Boomerang
« Reply #26 on: 17 Jul 2008, 23:36:55 »
Guys,

So I would want
Code: [Select]
hint Direction: _nudir \nRelative Direction: _reldir \nRange: _dist \nElevation: _elev;

or

Code: [Select]
hint format["Direction: %1,\nRelative Direction: %2, \nRange: %3, \nElevation: %3",_nudir,_reldir,_dist,_elev]

???
 :dunno:

Thanx for the replies, as always.

Luke
Pesky Human!!
Wort Wort Wort.

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Boomerang
« Reply #27 on: 17 Jul 2008, 23:51:52 »
Try both and see what happens, while I would go with the second one ;)

Offline Luke

  • Members
  • *
  • Thank God! The OFPEC Staff are here!
Re: Boomerang
« Reply #28 on: 18 Jul 2008, 00:04:38 »
Mando,

My biggest concern is the phrase:

Code: [Select]
_bullet=nearestObjects [_boomerang, ["BulletBase"], _boomerange];
waitUntil ! _bullet isNull;
_bpos=getpos _bullet;
? Side _bullet== Side _boomerang: exit;
_bdir = getdir _bullet;

and wheter it will catch anything.

Thanx for the replies, as always.

Luke

EDIT: I'm getting an error

'[ # ]sleep 5;'
Error generic error in expression.

and a scalar bool string blab blah 000000000xefjsdfksjkgf (not verbatum) message in each field...
except elevation: that's a random number.

???
:dunno:
« Last Edit: 18 Jul 2008, 00:17:51 by Luke »
Pesky Human!!
Wort Wort Wort.

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Boomerang
« Reply #29 on: 18 Jul 2008, 00:15:46 »
Code: [Select]
waitUntil{_bulletS=nearestObjects [_boomerang, ["BulletBase"], _boomerange];count _bulletS > 0};
And now lets say _bulletS array has 300 bullets inside, what now?