Jump to content
  • 0

Laser designator? Useless so why not make a script? [Help Needed Last Post]


se7en

Question

CHECK LAST POST IF YOU WANT TO HELP ME :)

 

Hi there.

Not sure if this is good place to post ideas, but...

 

There is actually Laser Designator which is useless, because it works only like range finder ...

 

 

Is this possible to add new option to 'scroll menu' when u use laser designator, and when u press something like "Mark Target" all players in same group will see on map MARK with for example name of the spotted vehicle.

 

And something like chat to group i.e. "M1A1 spotted in 123123"

 

 

 

Classname: Laserdesignator

 

Is this possible? :)

Link to comment
Share on other sites

10 answers to this question

Recommended Posts

  • 0

Yes it is!

Almost everything is possible via scripting!

 

It will take you some time - but if you like scripting, you should like it :)

Here's a quick tip :)

 

1. use AddAction command

or

2. use maca's right click script, so that you can add a right click option when players have the item in their inventory!

xBowBii

Link to comment
Share on other sites

  • 0

Hi there.

Not sure if this is good place to post ideas, but...

 

There is actually Laser Designator which is useless, because it works only like range finder ...

 

 

Is this possible to add new option to 'scroll menu' when u use laser designator, and when u press something like "Mark Target" all players in same group will see on map MARK with for example name of the spotted vehicle.

 

And something like chat to group i.e. "M1A1 spotted in 123123"

 

 

 

Classname: Laserdesignator

 

Is this possible? :)

sounds interesting, i will work on it.

Link to comment
Share on other sites

  • 0

Yes it is!

Almost everything is possible via scripting!

 

It will take you some time - but if you like scripting, you should like it :)

Here's a quick tip :)

 

1. use AddAction command

or

2. use maca's right click script, so that you can add a right click option when players have the item in their inventory!

xBowBii

 

Im actually very very beginner but thats what i already know.

I dont think just addaction would do the job.

 

First of all i should got a function thats more like

"If Player got Laser Designator Equipped"

and

"What player aims on and get params of it like location and stuff"

 

Then i should just use the same script thats in any "Vehicle Locator" script to show this on map

And something like "Write to chat" function.

If any of you can help me with these functions i can try to write it myself. ;)

Link to comment
Share on other sites

  • 0

Ok ill try this topic to make some my thoughts.

If any of you will notice any my BIG mistake, please correct me.

 

laser_init.sqf:

_hasLaser = false;
 
while {true} do {
private ["_hasLaser","_inventory","_currentWeapon"];
 
_inventory = items player;
_currentWeapon = primaryWeapon player;
_hasLaser = false;
 
if ((_currentWeapon == "LaserDesignator") || ("LaserDesignator" in _inventory)) then {
_hasLaser=true; //
}; 
 
 
if (_hasLaser && _typeOfCursorTarget in MarkableTargets && s_marking < 0) then {
s_mark = player addaction [("<t color=""#0074E8"">" + ("Mark Target") +"</t>"),"custom\laser\mark.sqf","_cursorTarget",1,true,true,"",""]; 
} else {
player removeAction s_mark;
s_marking = -1;
};
sleep 5;
And my custom\laser\mark.sqf:
private["_targetPosition","_targetVehicle"];
 
VehicleToMark = _this select 1;
 

_targetPosition = getPosATL VehicleToMark;
_targetVehicle = VehicleToMark;
_vehicleName = gettext (configFile >> "CfgVehicles" >> (typeof _targetVehicle) >> "displayName");
 
_Marker = "vehicleMarker" + (str _i);

_vehicleMarker = createMarkerLocal [_Marker,[(_targetPosition select 0),(_targetPosition select 1)]];
_vehicleMarker setMarkerShapeLocal "ICON";
_vehicleMarker setMarkerTypeLocal "DOT";
_vehicleMarker setMarkerColorLocal ColorOrange;
_vehicleMarker setMarkerSizeLocal [1.0, 1.0];
_vehicleMarker setMarkerTextLocal format [" %1: %2 spotted!",name player,_vehicleName];


 
 
variables.sqf:
MarkableTargets = [
    "Kamaz"
    ];
 
So basically i know i made there MANY mistakes.
I hope you can help me with this as this is goin to be my first script, and/or if someone want to make it - feel free.
And the marker is displayed Locally - just for guy who marks, dont know how to make a mark on group channel...
Link to comment
Share on other sites

  • 0

CHECK LAST POST IF YOU WANT TO HELP ME :)

 

Hi there.

Not sure if this is good place to post ideas, but...

 

There is actually Laser Designator which is useless, because it works only like range finder ...

 

 

Is this possible to add new option to 'scroll menu' when u use laser designator, and when u press something like "Mark Target" all players in same group will see on map MARK with for example name of the spotted vehicle.

 

And something like chat to group i.e. "M1A1 spotted in 123123"

 

 

 

Classname: Laserdesignator

 

Is this possible? :)

not to take away from what you're trying to do but the laser designator isn't useless on a militarized server. You use it to designate targets for laser guided bombs, such as the F35 has.

Link to comment
Share on other sites

  • 0

uh this looks awesome! Very nice work :)

 

I didn't see any big mistakes yet, will review the code a bit later, got some work to do atm.

 

wish that was true but i SEE my mistakes and i know there are mistakes.

For example propably the custom\laser\mark.sqf is more like fcked up for real. 

While laser_init.sqf can be good actually because i dont see mistakes in there.

 

@DangerRuss: Ok, but nope, still need what im doing ;D

And i believe that would be useful for some other players as well.

Imagine group of players (5-6) where 1 is sniper with laser designator and there are for example some rocketmans so sniper can mark positions of the marked targets to others.

Obviously that would be nice if there will be mark like "shift clicking" is making mark.

Link to comment
Share on other sites

  • 0

wish that was true but i SEE my mistakes and i know there are mistakes.

For example propably the custom\laser\mark.sqf is more like fcked up for real. 

While laser_init.sqf can be good actually because i dont see mistakes in there.

 

@DangerRuss: Ok, but nope, still need what im doing ;D

And i believe that would be useful for some other players as well.

Imagine group of players (5-6) where 1 is sniper with laser designator and there are for example some rocketmans so sniper can mark positions of the marked targets to others.

Obviously that would be nice if there will be mark like "shift clicking" is making mark.

That sounds pretty cool, my only concern would be a conflict with the antihacks. Good luck!

Link to comment
Share on other sites

  • 0

I noticed an error in the code shown by se7en. Where the code checks that _hasLaser is true and that the type of cursor target is in MarkableTargets:

 

if (_hasLaser && _typeOfCursorTarget in MarkableTargets && s_marking < 0) then {

"_typeOfCursorTarget" is defined as a local variable but not defined in the private array? 

I just wanted to know if that was an error or not because it seems to be a prevalent on in my rpt.

 

Thanks :D I'm just really interested in using this script but it doesn't like me 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...