Jump to content

Attach a laser sight to sharks?


Havoc302

Recommended Posts

I can make this happen for "1 milllion dollars!"

 

  -Dr. Evil

Lies, you'll just give me Mutated Sea Bass!

 

Dr. Evil: You know, I have one simple request. And that is to have sharks with frickin' laser beams attached to their heads! Now evidently, my cycloptic colleague informs me that that can't be done. Can you remind me what I pay you people for? Honestly, throw me a bone here. What do we have? Number Two: Sea bass. Dr. Evil: Right. Number Two: They are mutated sea bass. Dr. Evil: Really? Are they ill-tempered? Number Two: Absolutely. Dr. Evil: That's a start.
Link to comment
Share on other sites

attachto command ;) .

 

You can supply an offset to central point or a predefined attach point (if you know them). 

 

setVectorDir and setVectorUp (or setVectorDirAndUp) should allow for correct facing of the object.

 

Have fun :D .

My god man you are a genius! Now, the next question, run this client side and just do something like this?

 

if ((TypeOf unit) "GreatWhite_F") then {

    "acc_pointer_IR" attachTo "GreatWhite_F"

};

 

?

 

Then play with the vectors if I need to..

Link to comment
Share on other sites

Really depends on what you want the end result to be....

 

With attachto you need to work out the offset from the model.  I am presuming that the default attach point is the model center.  You therefore need to work out the offset that would put the attachment on the sharks head.

 

I have not touched A3Epoch but ...

 

Something like

 "acc_pointer_IR" attachTo ["GreatWhite_F", [0.3,0,0.2]];

You will then need to play with the figures to get the position just right.

 

You can then use vectors to change the direction the attached item is pointed. 

_allSharks = (position (vehicle player)) nearEntities ["GreatWhite_F", _mapsize]; 
{
    "acc_pointer_IR" attachTo ["GreatWhite_F", [0.3,0,0.2]];
}count _allSharks;

If you wish to attach to everything then you could try...You would have to give _mapsize a value and it is not the most efficent way of doing it but it should work. It could also potentially be paired with my Ring Of Protection script but instead of killing player in range, the shark could be made to dotarget or you could get even funkier and play with vectors to make the lazers point at the nearest player if they were in range.

 

Oh and client side or server side depends on how they are spawned and what is controlling them.  If they are client spawned then run the script on the client in a loop every 5 seconds or something (spawn the script and get it to uisleep after each scan).  Make _mapsize something outside of player swimming visual range that is further away than the distance the shark and player combined can cover during the sleep period and the lazers should spawn on the sharks in time for the player to see the shark.  Again, you can use the "Ring of Protection" script as a basic framework with some changes to get you going. 

 

Further update: 

You may find the sharks are setup as agents.  There are a number of agent control commands available as well which may be better at getting all the sharks.  Have a play. 

Link to comment
Share on other sites

  • 2 weeks later...

Hmm, gave that a shot, getting some errors, but I can't see why it'd be erroring.

 

22:58:29 Error in expression <it = "GreatWhite_F";
 
if ((TypeOf unit) _unit) then {
"acc_pointer_IR" attachTo >
22:58:29   Error position: <_unit) then {
"acc_pointer_IR" attachTo >
22:58:29   Error Missing )
22:58:29 File mpmissions\__cur_mp.Altis\custom\sharks_with_freaking_lasers.sqf, line 5
 
 
This is what it looks like atm:
 
 

private ["_allSharks","_mapsize"];

_mapsize = 2000;

_allSharks = (position (vehicle player)) nearEntities ["GreatWhite_F", _mapsize]; 
{
    "acc_pointer_IR" attachTo ["GreatWhite_F", [5,5,5]];
enableIRLasers true;
}count _allSharks;
Link to comment
Share on other sites

Yeah, Vampire is spot on.  The GreatWhite_F is a class (type) of object rather than an actual in game object.  It is like saying attachto truck rather than attachto this truck.

 

for your code posted Havoc, you have not put the current array element in to the attachto command.

 

Change 

"acc_pointer_IR" attachTo ["GreatWhite_F", [5,5,5]];

To

"acc_pointer_IR" attachTo [_x, [5,5,5]];

Give that a go.

Link to comment
Share on other sites

Have a look at the object list for A3 and see if there is anything that will do.  You can add a light source but it is a spherical light source rather than a beam unless they have enhanced it in A3.

 

You could put a road cone with a flashing light on its head like it had been on a Uni night out. 

 

There is a portable head lamp (PortableHelipadLight_01_red_F).

 

You could have a sheep riding the shark wearing a red headlamp if you wanted,

 

There is also LaserTargetC and LaserTargetCbase.  Would have to have a play around and see if any fit.

 

Have a dig around on the list of objects here (objects not items).

Link to comment
Share on other sites

Have a look at the object list for A3 and see if there is anything that will do.  You can add a light source but it is a spherical light source rather than a beam unless they have enhanced it in A3.

 

You could put a road cone with a flashing light on its head like it had been on a Uni night out. 

 

There is a portable head lamp (PortableHelipadLight_01_red_F).

 

You could have a sheep riding the shark wearing a red headlamp if you wanted,

 

There is also LaserTargetC and LaserTargetCbase.  Would have to have a play around and see if any fit.

 

Have a dig around on the list of objects here (objects not items).

You know what the next step is if I get the sharks to have lasers is right.... Laser eyed cultists.

Link to comment
Share on other sites

  • 1 month later...

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...