View Full Version : Question about setCaptive when unit armed/unarmed
Before I get aload of sarcastic remarks and annoyed mods locking this down, Search didn't come up with anything (Latley it seems fudged anyway, Only returning searches from ArmA sections of the forum)
I want to make it so that when a unit that is designated as captive picks up a guns he is setCaptive=False
Also a few more questions may be asked here as I go on creating this mission.
Well,I suppose that depends on the unit's side.
If he's east or west,you could use a trigger at
the right time to setcaptive=false.
If he's civilian though,I think that's a bit more
awkward,and might require editing the mission.sqm.
Or use a third party addon that looks like a civilian,but configured
as a "soldier".If ye see what I mean.
Is that of any use?
Or am i talkin rubbish?
Say your captive is named 'captive1'.
Make a trigger, in the condition field type:
<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">((count (weapons captive1)) > 0) AND ((count (magazines captive1)) > 0)[/QUOTE]
In the OnActivation:
<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">captive1 setcaptive false[/QUOTE]
I'll try it ASAP.
I know how to edit the SQM to make units on a different side, thats what I've done, basicly I just want to make sure that no one (This is a MP mission) can grab a gun while still in the prison area and shoot without getting shot at during the rescue/escape. This will also be usfull in a few of my other missions (IE. Im half way through making one where your "dressed as" a civilian scouting enemy controled city, and we dont want people picking up a gun and shooting without resistance now do we? http://forums.bistudio.com/oldsmileys/whistle.gif)
Well since W0lle's on the case,disregard what I said,
and good luck with what sounds like a very interestin'
"HasWeapon" might be another possibility.
<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">
?(Captive1 hasWeapon "Weapon"):Captive1 Setcaptive False
Although W0lle's idea might be more flexible.
I also need to know how to set a specific unit as non-captive (setCaptive false) when outside of a specific area, I tried putting a trigger around the area saying something like a notpresent, notpresent a, "a" notpresent, a (not present) ect. ect. but I don't get that bit. I'm searching for it right now on the internet but thought I might get a quicker response here.
Also how would I make that ((count (weapons captive1)) > 0) AND ((count (magazines captive1)) > 0) thing as a script insted of a trigger, as I have 6 captive units.
I haven't tested yet, but would:
<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">((count (weapons a)) < 1) AND ((count (magazines a)) < 1) else a setCaptive false
((count (weapons b)) < 1) AND ((count (magazines b)) < 1) else b setCaptive false[/QUOTE]
W0lle would be the man to ask about the scripting
question.But as for the trigger,you could try grouping
the unit/units to the relevant trigger.
Then you'll have a new set of options.Where before grouping,
your choices for activation would be "east","west" etc.Now
you'll have "vehicle","whole group","group leader","any group member".Then set "present","not present" as you wish.
Basicly if A goes out I dont want B, C, D, E and F, to get shot up
Would the trigger only be activated once all the group
is outside the trigger?
if so,set the it to "whole group".then they'll all have to be
outside for it to kick in.give it a go.
That's assuming you actually want a group.rather than a
collection of individuals.
I actually don't see the need for a script.
Name your captives from 'captive1' to 'captive6' and make a trigger as said above for each of them.
In this case, if 'captive1' picks up a weapon, captives2 to 6 are still captive - unless one of them also picks up a weapon.
Or have I misunderstood something completely now?
As for a group leaving the area, this shouldn't be too hard to do. All you need is a trigger and check if the unit is still present in it.
But before I post here something that's not true I need to check it on my own first.
I get back to you once I found a solution (if not someone is faster then me that is). http://forums.bistudio.com/oldsmileys/smile_o.gif
I think you are getting my two different questioned mixed. I no longer need info about turning your first answer into a script, I relised it would be easier just to use multipul triggers. Now what I really need is so that whatever units do not leave the prison area are not captive, and the ones that do leave arn't and are fired on.
Is it impossible if they are all in the same group?
If unit1 leaves triggerA then unit1 is setCaptive false
but unit2 (part of the same group) stays captive true untill he also leaves then unit2 is setCaptive false ect. ect.
I searched and searched, been on OFPEC, but can't find info on it.
I'll word it anouther way also: Insted of "if Resistance not presant" i want it as "if a not present" in a trigger
Or will I have to make each current group member not a member of a group and have them work seperatly (But they must still work together to escape, this should matter if its only human layers working)
I think Ill make them individual, just so if one person runs he's on his own :P
No sign of W0lle?
If you intend on all the captives being human,then group
or no group won't matter.If you've got just one prisoner per trigger then group him to that trigger,set it to "not present".Have it activated by "group leader".If he does a runner nobody else gets hurt as long as they stay inside their own areas.
This is a kind of "prison break" scenario,right?
Human guards against Human prisoners maybe?
Sounds like a great concept.Whatever way ye go about it.
No its humans vs. AI. thats why I need specific things. I will make them individual, I'm experimenting with groups but it aint working.
I'll send you the mission whe it's done, in a PM. It's really my first attempt at proper mission making... maybe we could have a game of it onlineWhen I finish it. I could local host or whatever you call it.
Basicly its two "civilian" spies, a pilot, and a resistance officer in the same camp, the spies have just arrived. You got to try to escape to a small base/camp (Haven't got that far yet http://forums.bistudio.com/oldsmileys/tounge2.gif )
I have one version using my clans custom units and FFUR, and anouther version made in FFUR but should be compatable with no-mods. Perhaps you would want to come and test as I make if I use the MP mission editor? If so, PM me I'll give y' my IP and you can join up and test as its made... It's only small and close to completion.
Patience with an old man please. http://forums.bistudio.com/oldsmileys/smile_o.gif
I'm pretty busy atm. Had an idea for a solution but that didn't worked.
I had a mission not long ago with something similiar, can't recall it though. There a trigger was placed with an unique name and it checked it a named unit is still within this trigger.
So the key might be the 'list' or 'thislist' command. Just how to implement it is the question. As soon as I've got something I surely will let you know.
Hopfully so far so good.
All I need is to figure out an end trigger.
There is only 4 playable units (So far) named A, B, C and D.
How do I make it end when all of those units are at a certain location? Basicly its a small Resistance base with a few vehicals, so that the ones who make it first if they didn't work as a team, can rescue the last couple...
But anyway, how would I make it so that it can tell when all out of A, B, C and D who are alive are at this base?
Edit: Also how would I make an end trigger that ends when A, B, C and D are all dead?
I'm searching the OFPEC and other sources right now, but I'm so close to completion (Well, beta completion) that I'm trying to find it as fast as possible.
Edit2: I'm so sorry if its not clear what I'm saying, English *IS* my primary language (Its the only language I speak) but I'm no good at wording things correctly.
Edit3: I'd just like to say thanks for all y'all help so far guys.
Your expressions are fine, I know what you're trying to achieve.
Now check if all are in a trigger or dead ain't a big problem. Maybe difficult to explain since my 1st lang. is not english.
Maybe drop me a PM with a download link to your mission and I deal with the 2 issues you brought up.
Looks like W0lle's gonna get ya on track.I've seen 'im do it
before.Yer mission's in safe hands. http://forums.bistudio.com/oldsmileys/wink_o.gif
I'd love to do a live playtest,especially since I like the
whole idea of the prison break.
Unfortunately, atm I've got issues with my Isp blockin ports
nescessary for online games,amongst other things http://forums.bistudio.com/oldsmileys/crazy_o.gif
Anyway,good luck with your project man.
I'm sure with W0lle's help you'll have it done in no time.
I wouldn't be that sure, as my time is limited often. You still can do the beta testing part. http://forums.bistudio.com/oldsmileys/biggrin_o.gif
Powered by vBulletin® Version 4.2.0 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.