rekrul 7 Posted September 3, 2009 Disclaimer: I'm completely clueless when it comes to mission editing. I've been studying the Armed-Assault Editing-Guide Deluxe Edition, these forums and the wiki, but there's an overlaying logic here that isn't really explained anywhere so it's kinda hard to know what I should search/look for so bear with me. Also, there's nothing logic about the syntaxes even though they're listed in wiki, and I often struggle to figure out where I should place these commands. Usually when I'm completely clueless to something I always try something so advanced it would make the designers themselves cringe. This might be one of those situations. :) I tried putting all the questions at the bottom so it's easier to read as I suspect this post will be pretty unorganized. What I'm trying to do is to have the players playing as civilians and when they enter a "forbidden" area with a weapon other than a pistol, the player (or players) are shot by OPFOR. If they don't have a weapon (or only a pistol) they will be shot as long as they are in the area, but safe once they're out. This will only be a 4-player mission so nothing big. At this point I have made a BLUFOR colonel with 0% presence and I've grouped my character and my playable AI (both civilians) with this non-existent colonel, and I've set both player as captives (1). I placed 3 OPFOR AIs in the forbidden area and I made a trigger defining the area. The trigger is as follows: Activation: Any group member, repeatedly, detected by OPFOR, Type Switch (2), On Act I've put a titleText just as a debug tool, and setCaptive false on myself and my AI (3). On Dea I have another titleText and I set us to captives again.(4) 1) I tried setting the group as captive but this doesn't seem possible? 2) What does "type" do? All explanations just list the various choices with no real info about what they do. I sat for hours with type "Guarded by OPFOR" and didn't understand why On Act was never executed. Setting it to None made it work. But later I found out that On Dea didn't work, and I had to set it to Switch which was less of a logical leap after the None-incident. 3) What I want is the person who was in the trigger-zone to be setcaptive false (as opposed to all of us), so I think I have to use a command to make the AI dump the player(s) name(s) he detected into another variable, then use that variable with the setCaptive false statement but this has several complications (5) I think. And I have no idea how to do it. :) 4) I noticed that if I, in the On Dea-field, set the setcaptive to true again and then put a titletext, it would take a while for the text to appear and sometimes not at all. If I had titletext first it would come much faster, why is this? 5) The complications I see is that for the trigger to trigger again, it has to be deactivated, right? So that means if a player is detected in the zone, then other players can enter and still have setCaptive true as the trigger for the 1st guy detected is still running (given that he is still in the trigger-zone). Is this correct? Do I have to make one trigger per player/AI in my group for this? 6) Is the deactivation also based on detection or immediately when I'm outside the trigger-zone? 7) I figured for the weapon-check I can use the hasWeapon command under condition, but do I really have to list all the weapons I have in the mission to check this? Or are there "groups" of weapons like "rifle", "pistol", etc? 8) If the player has a weapon other than pistol in the triggerzone, how do I avoid the On Dea-field to kick in? I want him to have setCaptive false even when he leaves the zone, making him permanently a target for OPFOR. 9) If a player only has a pistol is there a way for him to holster it, e.g. carry it but not in his hand? 10) Is there a way to make the civilians speak english? Share this post Link to post Share on other sites
Tonmeister 14 Posted September 3, 2009 mmmm... that was long. For those that have a very short attention spans, like me, maybe uploading an example of your mission to possibly test out to see whats going on. when it comes to mission editing I imagine your doing most of your changes in the ingame editor without any other suppotrting scripts? cheers Eb Share this post Link to post Share on other sites
rekrul 7 Posted September 3, 2009 For now, yes. I'm learning as I go along, so I'm sure there will be some external script-files eventually. Anyways, to focus on the most pressing issue now - when a player and/or AI enters the trigger zone and is detected by OPFOR, how do I know who he has detected? Is there a command/function where I can retrieve the name of the person that was detected? My goal here is that the player or AI that enters the triggerzone gets setCaptive set to false (as opposed to everyone in the group). Share this post Link to post Share on other sites
shuko 59 Posted September 3, 2009 {_x setcaptive false} foreach thislist Then just set the trigger options so it lists whoever are in the area and shouldnt be captives anymore. Share this post Link to post Share on other sites
ProfTournesol 956 Posted September 3, 2009 Anyways, to focus on the most pressing issue now - when a player and/or AI enters the trigger zone and is detected by OPFOR, how do I know who he has detected? Is there a command/function where I can retrieve the name of the person that was detected? Are you looking for the name of the person who has or who was detected ? As i guess it is who was, it's easy : thislist is the command that allows to get an array (= a list) of all the units that activate a trigger, the units forming that array can be accessed with the select command. So the first unit that was detected can be accessed with thislist select 0. So if you put a trigger, repeatable, activated by one side, detected by another side, and if you wanna the first unit that is spotted to be "setcaptive false), then write the following in the on act line : (thislist select 0) setcaptive false or for every units spotted as stated in the previous post : {_x setcaptive false} foreach thislist Only one thing to know with the "detected by" triggers : the detection is only temporary, once a unit isn't spotted anymore, after some times it is removed from the "thislist" array. Which is nice also. Share this post Link to post Share on other sites
rekrul 7 Posted September 3, 2009 (edited) Great! So if e.g. 2 persons run into the zone at the same time, I should use "{_x setcaptive false} foreach thislist"? Also, what happens if person 1 is detected, the trigger fires and then another person is detected. Will the trigger still fire for #2 or does the trigger have to be deactivated first? Edit: Ok I just tested and the trigger will not fire for person 2 entering triggerzone. Do I have to make one trigger per player or what? Edit2: To elaborate a bit. I locked the OPFOR in position, I send the AI into the triggerzone, out of line of fire. The trigger kicks in. I run in, and my setcaptive is still true. I send AI to OPFOR and after 30 secs or so, they shoot him (why so long?). I'm still in the zone and no trigger on me. I run out of the zone and the trigger deactives. Now I could set a condition with "{_x != alive} foreach thislist" (is that correct?) I guess, but I really would like the trigger to fire when #2 enters as well. Edited September 3, 2009 by Rekrul Share this post Link to post Share on other sites
ProfTournesol 956 Posted September 3, 2009 Edit: Ok I just tested and the trigger will not fire for person 2 entering triggerzone. Do I have to make one trigger per player or what? Nope because "thislist" is updated with all units spotted or not spotted anymore. What you can do is : name the trigger "spotting_trigger" for example, and make a script with a loop that constantly setcaptive the units in the array (such as in sqs - it could be better done with sqf) : #loopy {_x setcaptive false} foreach list spotting_trigger ~5 goto "loopy" Edit2: To elaborate a bit. I locked the OPFOR in position, I send the AI into the triggerzone, out of line of fire. The trigger kicks in. I run in, and my setcaptive is still true. I send AI to OPFOR and after 30 secs or so, they shoot him (why so long?). I'm still in the zone and no trigger on me. I run out of the zone and the trigger deactives. Now I could set a condition with "{_x != alive} foreach thislist" (is that correct?) I guess, but I really would like the trigger to fire when #2 enters as well. If you really wanna use only triggers, there a simple way : you can use a variable that is set to false each time the trigger is activated, and set to true each time it is deactivated, so that as long as units are spotted, the triggers fires constantly. Let's name the variable "lets_go". You set this variable to true at the beginning (such as in the init line of the player : lets_go = true). Then in the condition line of the "detected by" trigger, you write this : this and lets_go In the on activation line : {_x setcaptive false} foreach thislist;lets_go=false and in the deactivation line : lets_go=true This way, each time the trigger fires, it's deactivated and can be fired again each time a unit is spotted. Share this post Link to post Share on other sites
rekrul 7 Posted September 3, 2009 Thanks Tournesol, that did the trick! I do see some strange behavior though. Like I send the AI in and then me after. I have some text so I see that the trigger is going off and on all the time, and I see that the AI goes from invincible on the map (since he has setcaptive true) to green, but it's like 50/50 whether they shoot him or not when he's standing there. I'll move on to more absurd things ;), but is there a way to make "my" civilians speak english (instead of russian or whatever it is)? Share this post Link to post Share on other sites
ProfTournesol 956 Posted September 3, 2009 I do see some strange behavior though. Like I send the AI in and then me after. I have some text so I see that the trigger is going off and on all the time, and I see that the AI goes from invincible on the map (since he has setcaptive true) to green, but it's like 50/50 whether they shoot him or not when he's standing there. Yes, that's the fact since OFP : if units have been told to shoot a target, it takes some times before they "realize" that he is in fact captive. And sometimes they don't shoot him but they stay stupidly aiming at the target and then cannot do anything else anymore. I'll move on to more absurd things ;), but is there a way to make "my" civilians speak english (instead of russian or whatever it is)? I don't know either. Share this post Link to post Share on other sites
rekrul 7 Posted September 3, 2009 Hmm, another issue I experience is that I went in to the zone and killed all OPFOR, but the trigger keeps firing with no OPFOR to detect me, even when I'm outside the zone. Bug? Share this post Link to post Share on other sites
rekrul 7 Posted September 4, 2009 (edited) Ok, I might have done this too complex. I noticed two things. I put an USMC rifle squad out, me as civilian with a gun. If I kill 2 marines, they all open up on me. Now this is what I want, only I want it to happen after I kill 1 (or even injure someone). How do I do that? The other civilians in my group are not touched. I also noticed that if I had the first aid modules sync'ed to squad leader I can kill all of them without any of them reacting. Bug? Edit: Make that 3 things I've noticed. I can slaughter an entire russian rifle squad with no repercussions, but for USMC two is enough (if the first aid moduled isn't present and synced). Edited September 4, 2009 by Rekrul Share this post Link to post Share on other sites