Jump to content
Sign in to follow this  
Nemorz

Local Host and Targets over 700m

Recommended Posts

Hey I have a question (and trust me I searched for hours finding nothing on the subject).

Well, I have a Sniper Target Range setup, which I tend to host Locally, the problem is people who join can't see targets at 700m or over dropping whereas I can.

I have viewdistance set to 3.5km server default (and in the maps init.sqs).

I tested the clients moving up to the targets, and they drop fine under 700m.

Just wondering if anyone came across this or knows the reason for this happening? It's a bit of a killer when people are trying to learn long-distance sniping.

Regards, Nemor.

Share this post


Link to post
Share on other sites

I personally have mine set on High, I had 3 people testing the map, 1 with it on Very High, 1 with High and 1 with Low, neither could see the targets drop.

If you mean whats the server set to, I assume it will be based on my settings as I'm locally hosting.

Unless I'm missing the point altogether? :P

Share this post


Link to post
Share on other sites

Did you check that you are actually getting a view distance of 3.5KM? Go somewhere high, press spacebar and see the what it says the distance is between you and the "end of the world" (point right at where you don't see any more terrain). 3.5KM view distance should show people to at least 1KM and probably more.

On a side note, when hosting a server the view distance (if unchanged by scripting) is the game's default view distance which is afaik 1600m (or was it 1200?).

Share this post


Link to post
Share on other sites

Please rephrase "drop targets":

> can't see targets at 700m or over dropping

Share this post


Link to post
Share on other sites

In my init.sqs I have setViewDistance 3500 and although its not showing 3.5km I can see my targets which are up to 1.4km away.

As for "drop targets" I mean when you hit it, you see it go down. The Dummy Targets I mean.

Share this post


Link to post
Share on other sites

Ack it gets worse, on a Dedicated server you can hit targets up to 900m. But 700,800 and 900m targets stay down :O

Share this post


Link to post
Share on other sites

Maybe you could try a scripting around the problem.

Open up mission.sqm in a text editor. Get all the coordinates for the targets and the classname.

In init.sqf:

Target1 = "PopTargetClass" createVehicleLocal [1000,1000,0];

Target1 addEventHandler ["Hit", {(_this select 0) setDamage 1; TargetHit = (_this select 0); publicVariable "TargetHit";}];

Target2 = "PopTargetClass" createVehicleLocal [1000,1000,0];

Target2 addEventHandler ["Hit", {(_this select 0) setDamage 1; TargetHit = (_this select 0); publicVariable "TargetHit";}];

"TargetHit" addPublicVariableEventHandler {(_this select 1) setDamage 1;};

Share this post


Link to post
Share on other sites

"TargetHit" addPublicVariableEventHandler {(_this select 1) setDamage 1;}; 

One = "TargetPopUpTarget" createVehicleLocal [4224.5923,339,10778.191];
One addEventHandler ["Hit", {(_this select 0) setDamage 1; TargetHit = (_this select 0); publicVariable "TargetHit";}];

Two = "TargetPopUpTarget" createVehicleLocal [4276.1729,339,10692.745];
Two addEventHandler ["Hit", {(_this select 0) setDamage 1; TargetHit = (_this select 0); publicVariable "TargetHit";}];

Three = "TargetPopUpTarget" createVehicleLocal [4328.2852,339,10606.874];
Three addEventHandler ["Hit", {(_this select 0) setDamage 1; TargetHit = (_this select 0); publicVariable "TargetHit";}];

Four = "TargetPopUpTarget" createVehicleLocal [4379.5269,339,10521.958];
Four addEventHandler ["Hit", {(_this select 0) setDamage 1; TargetHit = (_this select 0); publicVariable "TargetHit";}];

Five = "TargetPopUpTarget" createVehicleLocal [4430.8252,339,10436.975];
Five addEventHandler ["Hit", {(_this select 0) setDamage 1; TargetHit = (_this select 0); publicVariable "TargetHit";}];

Six = "TargetPopUpTarget" createVehicleLocal [4482.4575,339,10351.16];
Six addEventHandler ["Hit", {(_this select 0) setDamage 1; TargetHit = (_this select 0); publicVariable "TargetHit";}];

Seven = "TargetPopUpTarget" createVehicleLocal [4534.0742,339,10265.364];
Seven addEventHandler ["Hit", {(_this select 0) setDamage 1; TargetHit = (_this select 0); publicVariable "TargetHit";}];

Eight = "TargetPopUpTarget" createVehicleLocal [4585.6982,339,10179.458];
Eight addEventHandler ["Hit", {(_this select 0) setDamage 1; TargetHit = (_this select 0); publicVariable "TargetHit";}];

Nine = "TargetPopUpTarget" createVehicleLocal [4637.0703,339,10094.114];
Nine addEventHandler ["Hit", {(_this select 0) setDamage 1; TargetHit = (_this select 0); publicVariable "TargetHit";}];

Ten = "TargetPopUpTarget" createVehicleLocal [4688.8188,339,10007.999];
Ten addEventHandler ["Hit", {(_this select 0) setDamage 1; TargetHit = (_this select 0); publicVariable "TargetHit";}];

Eleven = "TargetPopUpTarget" createVehicleLocal [4740.6343,339,9922.6123];
Eleven addEventHandler ["Hit", {(_this select 0) setDamage 1; TargetHit = (_this select 0); publicVariable "TargetHit";}];

Twelve = "TargetPopUpTarget" createVehicleLocal [4792.27,339,9837.7158];
Twelve addEventHandler ["Hit", {(_this select 0) setDamage 1; TargetHit = (_this select 0); publicVariable "TargetHit";}];

Thirteen = "TargetPopUpTarget" createVehicleLocal [4844.2544,339,9751.7559];
Thirteen addEventHandler ["Hit", {(_this select 0) setDamage 1; TargetHit = (_this select 0); publicVariable "TargetHit";}];

Fourteen = "TargetPopUpTarget" createVehicleLocal [4893.7275,339,9682.2324];
Fourteen addEventHandler ["Hit", {(_this select 0) setDamage 1; TargetHit = (_this select 0); publicVariable "TargetHit";}];

Having put the above into the init.sqf and uploaded the mission with nothing else on the map, but one player I see no targets.

I assume with createVehicleLocal theres no need for me to place a physical target in the editor unless I'm missing the point.

Anyway, I don't see those targets having done exactly what you said. It's possible I'm just missing something.

All the locations were copy/pasted from my original mission.sqm, with the same targets names also.

Oh, last but not least, assuming I do get this method to work.

How would my trigger to say the Targets been hit be called?

publicVariable = "TargetHit"?

"TargetHit" = true?

I ask because right now my trigger is set like this;

Condition: One animationPhase "terc" > 0.1;

Edited by Nemorz

Share this post


Link to post
Share on other sites

Did you try simply making your shooting range in single player? After all shooting ranges have little purpose in multiplayer, and if they don't work in multiplayer you're just giving yourself a hard time for little benefit.

Share this post


Link to post
Share on other sites

True galzohar, to an extent. I'm training Snipers and it's ideal to train on long distance static targets to begin with. Something I really need/want! :P

Share this post


Link to post
Share on other sites

I think maybe the positions in mission.sqm are in the wrong format. Looking into it now.

Yea in mission.sqm position is

{x,z,y}

You need

target1 setPosASL [x,y,z];

Also, put the addPublicVariableEventHandler at the end after you create everything.

No need for a hint trigger. Just put it in each "Hit" eventhandler. It should broadcast to all players. If not, also add it the the PVeventhandler as well.

You could also make the hint something like:

hint "Target hit at " + str((_this select 0) distance (_this select 1)) + "m.";

Edited by tcp

Share this post


Link to post
Share on other sites

Nice mate I'll give this a try shortly.

Works a treat, I didn't need to bother with the hit thing really though, my original triggers worked just fine.

Thanks very much :D

Edited by Nemorz

Share this post


Link to post
Share on other sites

do the other players see the hits now?

Share this post


Link to post
Share on other sites

Yes mate, no one can see anyone elses hits but the fact they see all messages on their own is a big boost (and lets face it, I can have x amount of people down-range at any given time without people complaining about hitting someone elses target!)

Much thanks once again!

Share this post


Link to post
Share on other sites

If you did want the target to go down for everyone, you could try:

"TargetHit" addPublicVariableEventHandler {(_this select 1) setHit ["terc",1]; (_this select 1) setDamage 1;};

Share this post


Link to post
Share on other sites

Alternatively I could just use "One setHit ["terc",1];" in the On Act of the triggers I already have in place and work to knock down the targets correct? As the event handler you provided I didn't feel the need to use.

Although without your other stuff (spawning them through init) I'd be nowhere right now!

Share this post


Link to post
Share on other sites

PVEventhandler is more efficient in this case.

Share this post


Link to post
Share on other sites

In all honesty I've no idea how to use that right now :D

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×