Home   Help Search Login Register  

Author Topic: Boomerang  (Read 8692 times)

0 Members and 1 Guest are viewing this topic.

Offline Luke

  • Members
  • *
  • Thank God! The OFPEC Staff are here!
Re: Boomerang
« Reply #45 on: 23 Jul 2008, 18:55:42 »
So in the fired EH, would the script:

Code: [Select]
_unit=_this select 0 select 0;
_weapon=_this select 0 select 1;
_muzzle=_this select 0 select 2;
_mode=_this select 0 select 3;
_type=_this select 0 select 4;

hint format ["%1",_this select 0 select 4];
_ammo=format ["nearestObject [%1, %2]",_unit,_type];
?_unit in _unitlist;
_unitnum = count _unitlist
format ["_unit = _unit_%1",_unitnum]
_unitlist=[_unitlist]+[_unit];
_ammonum = count _ammolist
format ["_ammo = _ammo_%1",_ammonum]
_ammolist=[_ammo] + [_ammolist];
@_ammo = isnull;
_ammolist=[_ammolist]-[_ammo];
_unitlist=[_unitlist]-[_unit];
exit

Work?  ???

Luke

P.S.

Here's the boomerang script:

Code: [Select]
_Boomerang=_this select 0
_range = 10
#loop
?_boomerang distance _ammo < _range : goto "getguy"
goto "loop"
#getguy
_number= _ammolist find _ammo
_shooter = _unitlist select _number
_boomposx=getpos _boomerang select 0;
_boomposy=getpos _boomerang select 1;
_boomposz=getpos _boomerang select 2;
_spos= getpos _shooter;
_sposx= getpos _shooter select 0;
_sposy= getpos _shooter select 1;
_sposz= getpos _shooter select 2;
_boompos=getpos _boomerang;
_boomdir=getdir _boomerang;
_reldir = ((_boomposx)-(_sposX)) atan2 ((_boomposy)-(_sposY));
_elev=(_sposz) - (_boomposz);
While (_reldir>=360) do {_reldir=_reldir-360};
While (_reldir < 0) do {_reldir=_reldir+360};
_dist= sqrt(((_spos select 0) - (_boompos select 0))^2 + (((_spos select 1) - (_boompos select 1))^2));
hint format ["Bullet type: %1\nRelative Direction: %2\nRange: %3\n Elevation: %4",_ammo,_reldir,_dist,_elev];
exit

EDIT: * all code is .sqs *
« Last Edit: 23 Jul 2008, 19:34:55 by Luke »
Pesky Human!!
Wort Wort Wort.

Offline USM-CPT.Dyson

  • Members
  • *
Re: Boomerang
« Reply #46 on: 11 Sep 2008, 17:54:20 »
did it work, i want to implement it into a mission
CTI SectorLink
Version: Beta 7
http://hosted.filefront.com/Spyder001/

Offline Luke

  • Members
  • *
  • Thank God! The OFPEC Staff are here!
Re: Boomerang
« Reply #47 on: 12 Sep 2008, 05:48:19 »
Wish it had. :(

Be willing to give what I have to ya,
but you have to give if you get it to work.

By the way, the only thing that works is the nearestobject command,

so I have an attempt at a work-around, but cant get to it right now.

Post it tomorrow.

Luke

EDIT: Here it is!!
« Last Edit: 17 Sep 2008, 01:28:11 by Luke »
Pesky Human!!
Wort Wort Wort.

Offline USM-CPT.Dyson

  • Members
  • *
Re: Boomerang
« Reply #48 on: 02 Oct 2008, 03:10:39 »
Can anyone help luke get this working? This looks like a pretty awesome idea that I want to use (Saw it on Future Weapons). :)
« Last Edit: 03 Oct 2008, 18:40:52 by USM-CPT.Dyson »
CTI SectorLink
Version: Beta 7
http://hosted.filefront.com/Spyder001/