Jump to content
Sign in to follow this  
QuiteFranklyMyMaN

Creating Fully Loot Uniforms with faction switch modifiers

Recommended Posts

Thats right, I want to make Hitman style uniforms that can be looted from the enemy on missions to give players the edge. I want to know how I'd script it so A. Anyone can loot anything and wear anything and B. if the player wears Uniform X that they'd be shown as belonging to that faction. or the other team, etc. And I want to see how I'd create a script where if you kill the enemy team with the uniform then the script is switched off and your set back to the opposing team so they attack you. And the only way to get back on is to get a new uniform or hide out of sight or something.

Well, baby steps, I suppose. Later on I can figure out more complex things. If they are even possible.

Man I wish BIS wouldnt throw away some awesome possibilities simply for some geneva convention garbage.

It's a damn game.

Share this post


Link to post
Share on other sites

Man I wish BIS wouldnt throw away some awesome possibilities simply for some geneva convention garbage.

What are you on about? Maybe I am imagining things but I stole a dead guys uniform earlier.

Edit: Nevermind, I might have found one spawned instead of off a dead guy. But anyway, I think the geneva convention remark in the interview (I just read it) is a joke. The technical reasons make sense.

With all that said, I would love this sort of thing. Would make special forces missions interesting, especially if you appeared to the AI as being on their side.

Edited by Jsmuk

Share this post


Link to post
Share on other sites
Man I wish BIS wouldnt throw away some awesome possibilities simply for some geneva convention garbage.

It's a damn game.

Wasn't mentioning the Geneva convention just a finishing note to a message otherwise discussing specifically gameplay concerns? Always allowing it in the way you describe (with the faction adjust) sounds like a balance concern to me, but eh.

You can easily create a script to take uniforms from a dead enemies (though I couldn't find a way to get which uniform the enemy is wearing, and had to specify that individually. Someone made a thread about the same problem earlier. Passing it as a parameter when the enemy was still alive didn't work for me either). In case that's all you want to do (maybe coupled with SetCaptive), here are some clunky scripts. And if there's an easier way to do this, please share it, folks, I'm new to this.

In the initialization of enemy units you want to be able to loot:

nul = [this] execVm "uniform_init.sqf";

Create a file called uniform_init.sqf in the mission folder and throw this in it

_unit = _this select 0;
waitUntil { !alive _unit };

_handle = _unit addAction ["Take uniform", "take_uniform.sqf"];

take_uniform.sqf

_enemy   = _this select 0;
_playerc = _this select 1;
_id      = _this select 2;

_player_uniform  = uniform _playerc;

removeUniform _enemy;
_enemy addUniform _player_uniform;

removeUniform _playerc;
_playerc addUniform "U_OI_CombatUniform_ocamo"; // enemy uniform classname

_enemy removeAction _id;

But the faction switch is the annoying endeavour. I did (or tried to do, at least) a mission where the enemy units switched to friendly-to-all Independent when players took enemy uniforms, after which detection was based on distance to players, and an alarm switched the enemy side back to OPFOR. It works in the context of this mission, but I wouldn't know or want to try to implement it in any kind of a universal way.

Share this post


Link to post
Share on other sites

I'm going to spend time reading that, and then test it, and then I'll report back based on my own results or modifications. Thank you for your help!

---------- Post added at 18:00 ---------- Previous post was at 17:59 ----------

What are you on about? Maybe I am imagining things but I stole a dead guys uniform earlier.

Edit: Nevermind, I might have found one spawned instead of off a dead guy. But anyway, I think the geneva convention remark in the interview (I just read it) is a joke. The technical reasons make sense.

With all that said, I would love this sort of thing. Would make special forces missions interesting, especially if you appeared to the AI as being on their side.

Nothing, I read the original post too and yes it seems to be in jest and added only later. I'm sure they would have added it if it wasn't so technically challenging VS a simple Side VS Side mission set. Which they've pretty much always had it as. In all Arma games.

---------- Post added at 18:03 ---------- Previous post was at 18:00 ----------

Oh and Magirot I'm hoping you have plans on releasing your stealth mission hehe :D

A lot of us would love to test it out!

Share this post


Link to post
Share on other sites

Okay I did like you said, it works! Great! Even with a new menu pop up action! I need to learn this scripting stuff makes life more entertaining!

But now I have a problem, how do I add a "Switch team to Uniform owner team" script? If I can figure out that I can create spy missions!!

Also, is there a way to keep my custom scripts in a general missions folder so I can call them in all my custom scenarios or missions or is it a mission by mission basis and I need to copy and paste it to each folder if I want to do that?

Thanks

Share this post


Link to post
Share on other sites
Okay I did like you said, it works! Great! Even with a new menu pop up action! I need to learn this scripting stuff makes life more entertaining!

But now I have a problem, how do I add a "Switch team to Uniform owner team" script? If I can figure out that I can create spy missions!!

Also, is there a way to keep my custom scripts in a general missions folder so I can call them in all my custom scenarios or missions or is it a mission by mission basis and I need to copy and paste it to each folder if I want to do that?

Thanks

I know this is an old post but was relevant to something I'm working on myself. Why don't you just use the setCaptive status with that faction?

playername setCaptive true;

Once you have the uniform on, setCaptive would allow the units to disregard you. You could then set up other triggers to revert that status like if you shoot someone, setCaptive back to false and then they know you're a "spy" or something like that?

Share this post


Link to post
Share on other sites

Because the way they have things setup you cannot even put on the uniform from another faction unless you script it on, so no 'grabbing this guy's shirt' instead of you have script it to "steal uniform" or something silly via addAction, delete commands and addUniform workarounds. It would be so much easier if we could just wear any piece of clothing. Then we'd just have to setup a 'uniform player == "whatever"' and use that to control setCaptive status.

Share this post


Link to post
Share on other sites

AFAIK this won't work in MP. Atleast i've experienced that when equipping OpFor soldiers with Civilian clothing.

you might need to create an east group and let the player join that group.

Share this post


Link to post
Share on other sites

This is great. I had this on my long (ever growing) list of things to explore.

I play all covert-ops, sneaking around style missions. Would love to steal

an enemy uniform and then 'blend' in without being noticed unless someone

got to within X meters away. Maybe even do a percentage check to see

if they notice anyway at any distance? Hope you get this ironed out...

Subscribed.

Share this post


Link to post
Share on other sites

To add to my months old reply (#3), for MP compatibility you need to make sure the script is executed by all players, not just the player who used the action. I think I did that by storing stuff with public variables in the action script, and then running the script that used them with an event handler, but there might be a better way.

Then we'd just have to setup a 'uniform player == "whatever"' and use that to control setCaptive status.

I thought "uniform" doesn't return the classname of the uniform, but rather gets it as an object, or something like that? At least I remember that it didn't work like I thought back then.

Edit: Scratch that, I was confusing it with how the game handled dead objects. The issue was that you couldn't use "uniform" to get the name of the enemy uniform when he dies, because that information isn't there anymore. removeUniform still works, though.

Edited by Magirot

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  

×