Jump to content
Sign in to follow this  
carlostex

Spawn protection (shield)

Recommended Posts

Ok guys i had a look on Sector Control mission in zargabad that comes with arrowhead expansion and i loved the spawn protection. It creates a barrier which will stop bullets and kill you if you try to infiltrate an enemy respawn point. It is really awesome.

I wonder if there is a way to separate it from that mission and implement it on user made missions.

I really need a spawn protection for my 3 team PvP, and please don't mention PvPscript pack i already took a look at it. I just need a separate spawn protection and implement it for every team.

Less important i wanted a backpack script via the action menu like in Xeno's domination. it's pretty straight forward. You just trade the weapons via the action menu.

Edited by CarlosTex

Share this post


Link to post
Share on other sites

It's pretty easy to set up, here is a scripted example with tent being the name of the object it is centered around:

_shield = "ProtectionZone_Ep1" createVehicleLocal (position tent);

_shield setObjectTexture [0,"#(argb,8,8,3)color(0,0,0,0,ca)"];

Alternatively you could just plop something down in the editor and change the class name to ProtectionZone_Ep1 in the editor, just make sure you also do the setobjecttexture or it will show up as red.

Share this post


Link to post
Share on other sites

Ok i think i understood. I'll try it. Thanks a lot man really apreciated it.

---------- Post added at 04:36 PM ---------- Previous post was at 04:22 PM ----------

does it have to be on an object? a marker would be better otherwise i can't define the size of the shield.

Again thanks a lot dude!!!

Share this post


Link to post
Share on other sites

setObjectTexture is local. So make sure to execute it on all clients.

The objects is a cylinder and has 25m radius.

Not sure about the height - might be more.

Share this post


Link to post
Share on other sites

what does setobjecttexture do? will it change the color of what? the shield? the object? I'm using flags for the objects.

Share this post


Link to post
Share on other sites

Yep of the cylinder object.

Just try it in the editor and you will see.

Share this post


Link to post
Share on other sites

It's always RED. I'm running trhough a script. I have this:

_shield = "ProtectionZone_Ep1" createvehiclelocal (position blulogic);

_shield setObjectTexture [1,"#(argb,8,8,3)color(0,0,0,0,ca)"];

What value should i change? I already tried to change the numbers after the word color because i thought it was red green and blue but to no effect. It's always red.

BTW the object is a location "owner" logic. I gave the name of blulogic.

Share this post


Link to post
Share on other sites

Why did you change the texture reference to 1?

It must be:

_shield = "ProtectionZone_Ep1" createVehicleLocal (_position);
_shield setObjectTexture [0,"#(argb,8,8,3)color(0,0,0,0,ca)"];

Share this post


Link to post
Share on other sites
Why did you change the texture reference to 1?

Because if i didn't do it it would appear an invisible barrier. When i set it to 1 i could see the red cilinder. With 0 cilinder was invisible.

Share this post


Link to post
Share on other sites

So what is your goal?

People normally want the object to be invisible.

The punishment for entering a zone is done by scripts.

Share this post


Link to post
Share on other sites

My goal is Blue color for the BLUFOR cilinder, red for OPFOR cilinder and green color for independent. I also want as soon as you enter enemy cilinder you die and respawn.

Share this post


Link to post
Share on other sites

red:

_shield setObjectTexture [0,"#(argb,8,8,3)color(1,0,0,1,ca)"];

blue:

_shield setObjectTexture [0,"#(argb,8,8,3)color(0,0,1,1,ca)"];

The last float value is transparency.

Share this post


Link to post
Share on other sites

Thanks man!!! It works! I would like just to get some transparecy so we could see through the color because it's solid! I tried to set different values to the last value but didn't change the transparency.

Share this post


Link to post
Share on other sites

BTW, i don't want to be a pain in the ass but i would like to include code that would kill enemy players who get inside the cilinders. Right now i have the shield.sqf like this:

//WEST

_shield = "ProtectionZone_Ep1" createvehiclelocal (position blulogic);

_shield setObjectTexture [0,"#(argb,8,8,3)color(0,0,1,1,ca)"];

//EAST

_shield = "ProtectionZone_Ep1" createvehiclelocal (position redlogic);

_shield setObjectTexture [0,"#(argb,8,8,3)color(1,0,0,1,ca)"];

//PMC

_shield = "ProtectionZone_Ep1" createvehiclelocal (position greenlogic);

_shield setObjectTexture [0,"#(argb,8,8,3)color(0,1,0,1,ca)"];

Share this post


Link to post
Share on other sites

What did you use the for the last value - the range is from 0 to 1.

The is my dynamic zone protection code:

http://pastebin.jonasscholz.de/1306

It adds/removes the blocking object as needed and punishes the player when

he enters a non contested zone. I guess you get the idea from reading the code.

Needs to be run on each client.

Share this post


Link to post
Share on other sites
What did you use the for the last value - the range is from 0 to 1.

The is my dynamic zone protection code:

http://pastebin.jonasscholz.de/1306

It adds/removes the blocking object as needed and punishes the player when

he enters a non contested zone. I guess you get the idea from reading the code.

Needs to be run on each client.

I use 1 value for transparency. If i set it to 0 the cilinder becomes invisible. But this is a minor problem. As long as shield does its job i am ok with it.

As for your script seems to much to me. If i can't use the cilinder area to kill enemy players maybe use a marker on the editor that as soon as enemy player enters marker area he/she gets killed.

For instance i could create a marker with a defined area called bluarea. If side enemy east or resistance unit enter bluarea then this unit setdamage 1. The problem is i have no idea how to write code for this. Never understood Arma 2 syntax.

I have to thank you for your patience BTW. Thanks man.

Share this post


Link to post
Share on other sites

0 to 1, means you can use 0.1 or 0.5 etc.

Share this post


Link to post
Share on other sites
0 to 1, means you can use 0.1 or 0.5 etc.

LOL!!!! OK I'll try that! Thanks dude!!

---------- Post added at 09:29 AM ---------- Previous post was at 08:24 AM ----------

Works like a charm thanks. I can now see the transparency. Now final step for this mission is to kill enemy players on respawn areas. I already implemented the backpack script by Xeno myself.

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  

×