Jump to content
Sign in to follow this  
mycatsaid

Invisible Shield (Spawn Protection) Help

Recommended Posts

I need some help! I run a domination map, I'm having issues with noobs destroying or shooting the helis and vehicles. I would like to know if anyone can get the spawn shield to appear in these areas I've marked in red on the map. I don't really want to extend the shield across the map or anything just kinda need it in them locations because the enemy attack the base and would make it impossible to fire back.

armamap.png

There is a spawn protect/shield script already in the new version of domination so if anyone knew how to do it with that would be great as it just stops people from firing when in range of that.

Many thanks to any response!

Share this post


Link to post
Share on other sites

Really not much of a script, its actually a vehicle ingame ;)

_position = anything here to get the position of where you want it (ie getPos vehicle, getMarkerPos shield, etc)
_shield = "ProtectionZone_Ep1" createVehicleLocal (_position);
_shield setObjectTexture [[color="Red"]0[/color],"#(argb,8,8,3)color(0,0,0,0,ca)"];

That is what you would put in an sqf file, or even just init. If you put it on a vehicle position it may act weird with respawn, so I suggest markers. Since you are using Domination specifically, I suggest putting that code at the bottom or near the bottom of the init then make a marker somewhere at base, and just test it all out. Also, the number in red in the code can range from 0 to 1, 0 being invisible and 1 being a pure red color.

Good luck!

Edit: After saying and reading Domination multiple times for whatever reason it just now fully clicked :P All of the above still applies, except instead of running it through init.sqf, find _shield at the beginning of x_client\x_setupplayer.sqf and x_server\x_setupserver.sqf and put your new code under the one already there. This makes sure it is executed on every client and on the server, and will not have any respawn problems.

Edited by Grimes [3rd ID]

Share this post


Link to post
Share on other sites

you could just make it easy with HandleDamage eventhandlers wich only allow damage from friendlys when so and so distance from base, now enemys can destroy as usual, but griefers cannot damage vvehicles in their base parking spot

edit: something like this:

this addEventHandler ["HandleDamage", {
_veh = _this select 0;
_sho = _this select 3;
_ret = 0;

if ((_veh distance (getPos helipad1)) < 100 AND (side _sho) == west) then {
	_ret = 0;
} else {
	_ret = _this select 2;
};
_ret
}];

now if vehicle is fired upon by a west unit and the vehicle is less than 100 from helipad1 it will get no damage.

if enemy or its more than 100 away from helipad it recieves normal damage.

Edited by Demonized
added untested eventhandler code.

Share this post


Link to post
Share on other sites
you could just make it easy with HandleDamage eventhandlers wich only allow damage from friendlys when so and so distance from base, now enemys can destroy as usual, but griefers cannot damage vvehicles in their base parking spot

edit: something like this:

this addEventHandler ["HandleDamage", {
_veh = _this select 0;
_sho = _this select 3;
_ret = 0;

if ((_veh distance (getPos helipad1)) < 100 AND (side _sho) == west) then {
	_ret = 0;
} else {
	_ret = _this select 2;
};
_ret
}];

now if vehicle is fired upon by a west unit and the vehicle is less than 100 from helipad1 it will get no damage.

if enemy or its more than 100 away from helipad it recieves normal damage.

Hey many thanks for the reply, where do I add this? Also can you add multiple helipads? Also about the A10 it's not on a helipad so how would you stop that getting damaged?

Also thanks for Grimes [3rd ID] response as well.

Share this post


Link to post
Share on other sites

that code would be placed directly in the init of the vehicle, you need ofc to reapply it when respawned.

main thing, this is the vehicle name.

vehiclename addEventHandler ["HandleDamage", {

you can use it differently on all vehicles.

for example all helis have distance from their helipad 1 -10

a10 have 500 distance from a base marker etc..

if ((_veh distance (getMarkerPos "base")) < 500 AND (side _sho) == west) then {

for where to place the code in the scripts of domination i dont know, Grimes [3rd ID] method would be far easier then if it works.

Edited by Demonized

Share this post


Link to post
Share on other sites
that code would be placed directly in the init of the vehicle, you need ofc to reapply it when respawned.

main thing, this is the vehicle name.

vehiclename addEventHandler ["HandleDamage", {

you can use it differently on all vehicles.

for example all helis have distance from their helipad 1 -10

a10 have 500 distance from a base marker etc..

if ((_veh distance (getMarkerPos "base")) < 500 AND (side _sho) == west) then {

for where to place the code in the scripts of domination i dont know, Grimes [3rd ID] method would be far easier then if it works.

Hmm actually, the shield thing Grimes talked about might be easier tbh, because with the method you gave the vehicle is hit still which ends up moving the vehicle sometimes if its a rocket, if I could get grimes shield version working it might be a better idea because that stops the round hitting the vehicle altogether.

Edited by mycatsaid

Share this post


Link to post
Share on other sites

what i meant was that you cutom specify what you want as distance from what position on each vehicle.

so if you use

(_veh distance (getMarkerPos "base")) < 500

for that vehicle only it will have to be 500 away from the marker position called "base".

the 1 - 10 i meant helipad1, heliapad2 ect to 10 for example only.

(_veh distance (getPos helipad1)) < 100

here it will only recive damage when 100 away from helipad1.

Share this post


Link to post
Share on other sites
;1998109']Really not much of a script' date=' its actually a vehicle ingame ;)

_position = anything here to get the position of where you want it (ie getPos vehicle, getMarkerPos shield, etc)
_shield = "ProtectionZone_Ep1" createVehicleLocal (_position);
_shield setObjectTexture [[color="Red"]0[/color],"#(argb,8,8,3)color(0,0,0,0,ca)"];

That is what you would put in an sqf file, or even just init. If you put it on a vehicle position it may act weird with respawn, so I suggest markers. Since you are using Domination specifically, I suggest putting that code at the bottom or near the bottom of the init then make a marker somewhere at base, and just test it all out. Also, the number in red in the code can range from 0 to 1, 0 being invisible and 1 being a pure red color.

Good luck!

Edit: After saying and reading Domination multiple times for whatever reason it just now fully clicked :P All of the above still applies, except instead of running it through init.sqf, find _shield at the beginning of x_client\x_setupplayer.sqf and x_server\x_setupserver.sqf and put your new code under the one already there. This makes sure it is executed on every client and on the server, and will not have any respawn problems.[/quote']

I got grimes script working I was wondering if it was possible to change the shape to make a rectangle and change the length because the one grimes gave is a circle.

I tried say adding something like the trigger has when you turn it from a circle to a rectangle and it gives you code like

a=40;

b=100;

angle=60;

rectangular=1;

Edited by mycatsaid

Share this post


Link to post
Share on other sites

Honestly I've never used this shield before and I have actually taken it out of my version of Domination :P Seeing as to how it is actually a vehicle, I do not believe you can change its size and shape. That is not known though, so keep lookin'.

What I do suggest though is changing that red number I pointed out to 0.75 or 1 and just place multiple of those shields, and use try and error to position them right. To make it even easier, just name each of the helipads for the helicopters hp1, hp2, etc and then make the position..

_position = getPos hp1;

and that will put the shield on the helipad itself. For the A10, just make a H Pad (Invisible) where the A10 spawns.

Demonized Event Handler method would work in Domination, just gotta get it into the init of the vehicle after respawn.

Share this post


Link to post
Share on other sites

As with every other "how do I stop stupid people from doing stupid things" question, the best way is to simply lock your server and save yourself the headache. :) heh

Share this post


Link to post
Share on other sites
;1998303']Honestly I've never used this shield before and I have actually taken it out of my version of Domination :P Seeing as to how it is actually a vehicle' date=' I do not believe you can change its size and shape. That is not known though, so keep lookin'.

What I do suggest though is changing that red number I pointed out to 0.75 or 1 and just place multiple of those shields, and use try and error to position them right. To make it even easier, just name each of the helipads for the helicopters hp1, hp2, etc and then make the position..

_position = getPos hp1;

and that will put the shield on the helipad itself. For the A10, just make a H Pad (Invisible) where the A10 spawns.

Demonized Event Handler method would work in Domination, just gotta get it into the init of the vehicle after respawn.[/quote']

Thanks just did that then, will give it a test run, no noobs should be able to destroy vehicles now hopefully ;)

Share this post


Link to post
Share on other sites

Actually, now that I think of it, you aren't able to fire on anything within the shield, but I'm pretty sure you can still crash into it. :P

Share this post


Link to post
Share on other sites

Or you could make everything allowDamage false or put event handlers on them until they are a certain distance from the flag pole/base marker.

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  

×