5133p39 16 Posted October 11, 2005 EDIT: problem solved, i found a workaround. I need to raise alarm after one of the East soldiers finds a dead body. I know i can write a huuuge, complicated, and super-clever script, but i tried to make it as simple as it is possible (which is the way i prefer). When any unit dies its side changes to CIVILIAN. So if you have no regular civilians in your mission you can simply make a trigger of the type "CIVILIANS detected by EAST" and that's it! Everything works ok, until the dead unit was not on the East side - then its body is detected by any East soldier in range of 50 meters! No matter if the body is behind a house, wall, or anything which should hide it from the eyes of others. I made a simple tests (My version of OFP is 1.96 final). 1. Two EAST soldiers, not grouped. When the first one (S1) behind a house gets silently killed, the second one (S2) is forced to move to the S1 position, and alarm is raised when the trigger detects CIV unit by any EAST unit. RESULT: the alarm is raised when S2 is 53 meters from S1, regardless if S2 could actually see the body of S1 2. Two WEST soldiers, not grouped. When the first one (S1) behind a house gets silently killed, the second one (S2) is forced to move to the S1 position, and alarm is raised when the trigger detects CIV unit by any WEST unit. RESULT: same as in test#1 3. One WEST soldier (W1) and one EAST soldier (E1). When W1 behind a house gets silently killed, E1 is forced to move to the W1 position, and alarm is raised when the trigger detects CIV unit by any EAST unit. RESULT: SUCCESS! The alarm is raised only when E1 really see the body of W1 4. One WEST soldier (W1) and one EAST soldier (E1). When E1 behind a house gets silently killed, W1 is forced to move to the E1 position, and alarm is raised when the trigger detects CIV unit by any WEST unit. RESULT: SUCCESS! The alarm is raised only when W1 really see the body of E1 Pretty strange, isn't it? As long as the dead unit was the same side as the detecting unit, the alarm is raised allways when the detecting unit gets at least 50meters from the detected (dead) unit. I would consider this as a glitch in the OFP "logic engine" - anyone got an idea on how to solve this thing? Share this post Link to post Share on other sites
Trapper 0 Posted October 11, 2005 Maybe even if not grouped, the "damn, one is down!" infos are shared on each side, and the 50m distance is only by chance in your experiment? www.mapfact.net offers an AI addon/script, which detects dead bodies, perhaps it'll help: http://www.mapfact.net/include....tid=433 Share this post Link to post Share on other sites
5133p39 16 Posted October 11, 2005 Maybe even if not grouped, the "damn, one is down!" infos are shared on each side, and the 50m distance is only by chance in your experiment?www.mapfact.net offers an AI addon/script, which detects dead bodies, perhaps it'll help: http://www.mapfact.net/include....tid=433 But WHO could share the info? there are only 2 soldiers - one of them dead, and the other one is 500 meters away and facing opposite direction and there are many obstacles between the two soldiers. And the event is triggered allways after the soldier is about 50m from the body, not when he is 500m away, and ONLY if the dead unit was on the same side as the one who is alive. thanks for the link, but - no ofense - if i wanted to use a script, i would write one, and this thread would never existed Share this post Link to post Share on other sites
Trapper 0 Posted October 11, 2005 Well, it's a computergame. The "electronic mastermind" knows everything, all the time. It's only programmed to play fair, and why shouldn't be there bugs? *Knowing that a unit is dead, seems to be influenced by the knowsabout value. Right clicking a dead squad member will "reveal" his dead sooner than waiting. *"Detected by" will be based on knowsabout, too. *If you count alive units in groups or arrays, they stay at status "alive" until the moment they are detected as dead. *This will also be the moment they count as civilians. (AI officers say "clear" after they are sure that all enemys are dead.) It's possible there's a 50m knowsabout bonus for units on the same side. Simulating situtations like "if he doesn't report in and doesn't show up, he's dead." I don't think there will be an easy way to to get rid off it. Share this post Link to post Share on other sites
5133p39 16 Posted October 11, 2005 Well, it's a computergame. The "electronic mastermind" knows everything, all the time. It's only programmed to play fair, and why shouldn't be there bugs? *Knowing that a unit is dead, seems to be influenced by the knowsabout value. Right clicking a dead squad member will "reveal" his dead sooner than waiting. *"Detected by" will be based on knowsabout, too. *If you count alive units in groups or arrays, they stay at status "alive" until the moment they are detected as dead. *This will also be the moment they count as civilians. (AI officers say "clear" after they are sure that all enemys are dead.) It's possible there's a 50m knowsabout bonus for units on the same side. Simulating situtations like "if he doesn't report in and doesn't show up, he's dead." I don't think there will be an easy way to to get rid off it. Well, that's pretty stupid. I don't see a point in this behaviour - when there is the knowsabout think, why to have this 50m instant knowledge That must be a bug - i am trying hard, but i really cannot see why it should behave like this. Share this post Link to post Share on other sites
NaveReyem 0 Posted October 11, 2005 maybe you should make the thing Resistance instead of civilian, i dont know if itll make any difference but Civilians are usually messed up when it comes to sides.(at least i think) Share this post Link to post Share on other sites
Doolittle 0 Posted October 12, 2005 As far as I know, triggers do not list/detect dead objects. Doolittle Share this post Link to post Share on other sites
csj 0 Posted October 12, 2005 can't you just put a 3 meter trigger around the body triggered by 'S2' 'present' Share this post Link to post Share on other sites
5133p39 16 Posted October 12, 2005 maybe you should make the thing Resistance instead of civilian, i dont know if itll make any difference but Civilians are usually messed up when it comes to sides.(at least i think) I don't have any civilians on my map, just two East units - when one of them dies, then his side changes to CIVILIAN. You cannot change this. Share this post Link to post Share on other sites
5133p39 16 Posted October 12, 2005 As far as I know, triggers do not list/detect dead objects.Doolittle As far as YOU know? No ofense, but what possibly could you know? You don't even read the posts in this topic you are replying into! Because if you did, then you would know that you CAN detect dead units by a trigger. Share this post Link to post Share on other sites
UNN 0 Posted October 12, 2005 Quote[/b] ]As far as YOU know? No ofense, but what possibly could you know? You don't even read the posts in this topic you are replying into!Because if you did, then you would know that you CAN detect dead units by a trigger. It's not common knowledge. This appears to be a unique feature for the detected by trigger, all the others ignore dead bodies. But there is no secret option in the editor to override this, so without scripting your own conditions or work around. I'm afraid your stuck with it. Quote[/b] ]I know i can write a huuuge, complicated, and super-clever script, but i tried to make it as simple as it is possible (which is the way i prefer). I don't see why you would want to, for what is a simple task? CSJ had a good suggestion, just setpos a detect trigger with a user defined radius, onto the dead body. So you can use that to activate the alarm? Share this post Link to post Share on other sites
5133p39 16 Posted October 12, 2005 Quote[/b] ]I know i can write a huuuge, complicated, and super-clever script, but i tried to make it as simple as it is possible (which is the way i prefer). I don't see why you would want to, for what is a simple task? CSJ had a good suggestion, just setpos a detect trigger with a user defined radius, onto the dead body. So you can use that to activate the alarm? it's not as simple as that, there are many East units which could die and then could be detected - including 16 of West playable units. I am working on a complex mission where the AI behaviour should be very believable - for example, the alarm will not be raised when a body is just seen, the unit which seen the body must either fire some "alarm" shots (depends on the unit skill), or run to nearest alarm switch, and even if there are "alarm shots" fired then the alarm will be rised only when there is some unit near the alarm switch and if noone is there then the nearest unit will be picked and sent there, and many many more things. There is much scripting inolved even now, so i am searching for the simplest way to do things. I can't have 50 triggers for each unit in case any of them dies. I can simplify that by using only 1 trigger, and moving it constantly from one body to the another, but i wanted to use the "natural" ofp algorithm - for example, when you shot dead some unit which will fall to ground behind some obstacle or behind a bush where other unit can't see him, the trigger you are talking about, will raise the alarm anyway, even if the unit can't see the body because it is behind a bush! and that is wrong. Share this post Link to post Share on other sites
UNN 0 Posted October 12, 2005 Quote[/b] ]I can simplify that by using only 1 trigger, and moving it constantly from one body to the another, but i wanted to use the "natural" ofp algorithm - for example As you have already stated, you cant use OFP's detect triggers. The next best thing is KnowsAbout. <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> #Loop ~1 _Alarmed=ObjNull {If (IsNull _Alarmed) Then {_Dead=_x; {If ((_x KnowsAbout _Dead)>3.5) Then {_Alarmed=_x}} ForEach EastUnitsArray}} ForEach DeadUnitsArray If (IsNull _Alarmed) Then {goto "Loop"} Without knowing what else you have running, checking this on a regular basis is about as simple as it gets. KnowsAbout is pretty good at detecting Lines Of Sight, but also has it's limits, get with 10m (can't remember exactly) and it will return the maximum of 4. Share this post Link to post Share on other sites
5133p39 16 Posted October 12, 2005 Quote[/b] ]I can simplify that by using only 1 trigger, and moving it constantly from one body to the another, but i wanted to use the "natural" ofp algorithm - for example As you have already stated, you cant use OFP's detect triggers. The next best thing is KnowsAbout. <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> #Loop ~1 _Alarmed=ObjNull {If (IsNull _Alarmed) Then {_Dead=_x; {If ((_x KnowsAbout _Dead)>3.5) Then {_Alarmed=_x}} ForEach EastUnitsArray}} ForEach DeadUnitsArray If (IsNull _Alarmed) Then {goto "Loop"} Without knowing what else you have running, checking this on a regular basis is about as simple as it gets. KnowsAbout is pretty good at detecting Lines Of Sight, but also has it's limits, get with 10m (can't remember exactly) and it will return the maximum of 4. As I have stated ?? I have stated that one CAN use OFP's detect triggers! (am i totally stupid and my english totally sucks, or is it that noone is really reading my posts?) ...maybe next time when i need some help, i will save myself a lot of nerves and won't ask in these forums. Fortunately, i was able to solve the '50m' problem. For those of you (ooops, wait, that's ALL OF YOU) who told me its not possible to detect dead bodies by a trigger: 1. put some player unit on the map (preferably a SpecOp unit armed with a HK) 2. make a trigger "Civilians detected by East" and put the following into its 'on activation' field: s2 switchCamera "INTERNAL"; HintC "DETECTED" 3. inside the trigger put two East units and place them so they do not see each other - and do not group them together. Name them 's1' and 's2'. Also, set ammount of their ammo to zero, so they cant kill the player (that could ruin our little test). 4. make a trigger with condition "not Alive s1" and on activation "[s1] Join Player; s2 Move getPos s1" ...try it, and then you can come back here telling me it does not work, and that it is not possible to detect dead bodies by a triger. Share this post Link to post Share on other sites
5133p39 16 Posted October 12, 2005 sorry, the last example is not complete. This is the complete version: 1. put some player unit on the map (preferably a SpecOp unit armed with a HK) 2. make a trigger "Civilians detected by East" and put the following into its 'on activation' field: s2 switchCamera "INTERNAL"; HintC "DETECTED" 3. inside the trigger put two East units and place them so they do not see each other - and do not group them together. Name them 's1' and 's2'. Also, set ammount of their ammo to zero, so they cant kill the player (that could ruin our little test). 4. make a trigger with condition "not Alive s1" and on activation "[s1] Join Player; s2 Move getPos s1" 5. run the mission and go and kill the 's1' soldier, then wait what happens - s2 should go to the s1 position, and when he sees the body, a 'DETECTED' message will show and you will see through his eyes what exactly he sees. Share this post Link to post Share on other sites
Trapper 0 Posted October 12, 2005 4. make a trigger with condition "not Alive s1" and on activation "[s1] Join Player; s2 Move getPos s1" Is this the workaround for the 50m's? Won't you end up again with a bunch of !alive triggers for every unit? However, with this behaviour you're better off to solve your problems on your own. Share this post Link to post Share on other sites
UNN 0 Posted October 12, 2005 Quote[/b] ]I have stated that one CAN use OFP's detect triggers! Lol..I wish you would make up your mind. First off, you said Triggers wouldn’t work because of the 50m radius problem. Thats why I offered a trigger free alternative. Isn't that why you started the thread in the first place? It was never debated by me, that detect triggers would not detect dead bodies. I am just trying to keep up with your ever evolving requirements Well glad to see you figured it out for yourself, it's amazing what a little perseverance will achieve. Share this post Link to post Share on other sites
5133p39 16 Posted October 12, 2005 4. make a trigger with condition "not Alive s1" and on activation "[s1] Join Player; s2 Move getPos s1" Is this the workaround for the 50m's? Won't you end up again with a bunch of !alive triggers for every unit? However, with this behaviour you're better off to solve your problems on your own. no, all this is just a example - how it works - what you need to do for it to work correctly. This trigger (condition "not Alive s1" and on activation "[s1] Join Player; s2 Move getPos s1") is there just as a simple example. In the real mission, you wouldn't have this trigger, you would make a trigger which would give you an array of all units on the mission start. You will then add eventhandler "killed" for each of these units, which will execute a simple script which will group the dead unit with a some dummy west unit <= that is the important thing and that is the workaround, i thought it was clear: The workaround is, to JOIN the dead unit with a unit which side is enemy to the original side of the dead unit. For example, when some EAST unit gets shot, you need to join it with some WEST unit (or Resistance, in case the resistance is enemy to the east), and if some WEST unit gets shot, you DO NOT need to join it with any east unit because the west is enemy to the east. The 50m glitch appears ONLY when the dead unit is (originaly was) on the same side as the unit which guards the area and which 'detected' the dead body. Here we go again: If you have EAST base with EAST guards, which is attacked by a WEST SpecOps, and you want to sound the alarm when a dead body (ANY dead body) is discovered by any of the EAST guards, you don't need any script, you just need a trigger "CIVILIANS detected by EAST" which covers the whole base area, and you need also to set the killed EH of all of the EAST units to execute script which will JOIN the dead unit with some unit from the opposing side (the WEST) - THIS will neutralize the "50m glitch", and the dead body detection will work correctly (the dead body is detected ONLY when some unit REALLY see the body) If you have WEST base with WEST guards, which is attacked by a EAST Specnaz, and you want to sound the alarm when a dead body (ANY dead body) is discovered by any of the WEST guards, you don't need any script, you just need a trigger "CIVILIANS detected by WEST" which covers the whole base area, and you need also to set the killed EH of all of the WEST units to execute script which will JOIN the dead unit with some unit from the opposing side (the EAST) - THIS will neutralize the "50m glitch", and the dead body detection will work correctly (the dead body is detected ONLY when some unit REALLY see the body) got it? :-) Share this post Link to post Share on other sites
5133p39 16 Posted October 12, 2005 Quote[/b] ]I have stated that one CAN use OFP's detect triggers! Lol..I wish you would make up your mind. First off, you said Triggers wouldn’t work because of the 50m radius problem. Thats why I offered a trigger free alternative. Isn't that why you started the thread in the first place? It was never debated by me, that detect triggers would not detect dead bodies. I am just trying to keep up with your ever evolving requirements Well glad to see you figured it out for yourself, it's amazing what a little perseverance will achieve. well, ok, i didn't said "it is not possible", or "it does not work", i have only said that "there is a glitch - how do i get rid of it?" ...but thanks for trying to help me, although i was misunderstood - no hard feelings Share this post Link to post Share on other sites
Doolittle 0 Posted October 12, 2005 As far as YOU know? No ofense, but what possibly could you know? You don't even read the posts in this topic you are replying into!Because if you did, then you would know that you CAN detect dead units by a trigger. Actually I know just about everything there is about scripting. Â And when I READ your post, you mentioned using Detected By... In your solution you say: Quote[/b] ]2. make a trigger "Civilians detected by East" and put the following into its 'on activation' field: s2 switchCamera "INTERNAL"; HintC "DETECTED" ..and... Quote[/b] ]4. make a trigger with condition "not Alive s1" and on activation "[s1] Join Player; s2 Move getPos s1" Without having the Condition be "this and not alive s1", you are completely ignoring the Detected By setting. Â YES a trigger can detect when someone is dead if you set the Condition to be "not alive s1". Â However, as I said, you cannot use a trigger's thislist (list) feature or Detected By feature on dead units. I am only replying because you were saying "scripting is bad". Â Scripting is LIFE! Doolittle Share this post Link to post Share on other sites
5133p39 16 Posted October 12, 2005 As far as YOU know? No ofense, but what possibly could you know? You don't even read the posts in this topic you are replying into!Because if you did, then you would know that you CAN detect dead units by a trigger. Actually I know just about everything there is about scripting. And when I READ your post, you mentioned using Detected By... In your solution you say: Quote[/b] ]2. make a trigger "Civilians detected by East" and put the following into its 'on activation' field: s2 switchCamera "INTERNAL"; HintC "DETECTED" ..and... Quote[/b] ]4. make a trigger with condition "not Alive s1" and on activation "[s1] Join Player; s2 Move getPos s1" Without having the Condition be "this and not alive s1", you are completely ignoring the Detected By setting. YES a trigger can detect when someone is dead if you set the Condition to be "not alive s1". However, as I said, you cannot use a trigger's thislist (list) feature or Detected By feature on dead units. I am only replying because you were saying "scripting is bad". Scripting is LIFE! Doolittle :-))))))) then you should read my post again, and then again, and then again, and repeat this process until you get it right ...maybe then you will notice, that there was TWO triggers: 1. put some player unit on the map (preferably a SpecOp unit armed with a HK) 2. make a trigger "Civilians detected by East" and put the following into its 'on activation' field: s2 switchCamera "INTERNAL"; HintC "DETECTED" 3. inside the trigger put two East units and place them so they do not see each other - and do not group them together. Name them 's1' and 's2'. Also, set ammount of their ammo to zero, so they cant kill the player (that could ruin our little test). 4. make a trigger with condition "not Alive s1" and on activation "[s1] Join Player; s2 Move getPos s1" ...do you see the bold text? do you think i am talking about creating ONLY ONE trigger there? If you are so clever scripter, then you should know the purpose of each of these TWO triggers, and then you would never write what you did. AND AGAIN - you really don't bother to read other's posts, i didn't wrote that "scripting is bad". But when we are talking about scripting, i'll tell you a secret: To write scripts for something which does not need a script, that is bad. Share this post Link to post Share on other sites
UNN 0 Posted October 13, 2005 Detect tirggers will display dead units of the same side, and include them as Civilians in ThisList, as 5133p39 said. I tested it when I first read the thread. Quote[/b] ]...do you see the bold text? do you think i am talking about creating ONLY ONE trigger there? If you are so clever scripter, then you should know the purpose of each of these TWO triggers, and then you would never write what you did. New things are still being discovered on a daily basis with OFP. But there can also be a equal amount of bad information circulating. So don't be surprised if some new ideas are met with initial scepticism. I've seen veteran addon makers, get fooled by the simplest of things. The Turn Out Action for tanks, being one. Someone swore blind, they could remove the Turn Out option with RemoveAction, in a vehicles init field. What they did not realise (because of the nature of their addon) was, when you put a script command in a vehicles init field. It forces the vehicle into safe mode, and the crew turn out automatically. So the Turn Out option was never there to remove, in the first place Quote[/b] ]But when we are talking about scripting, i'll tell you a secret: To write scripts for something which does not need a script, that is bad. To be fair, you still had to resort to scripting in the end. It's still scripting even if it isn't in an *.sqs file, although it turned out to be far from complex. You may still have to add some extra Join commands, to make sure you don't end up trying to add to many dead bodies to a single group? Share this post Link to post Share on other sites
Doolittle 0 Posted October 13, 2005 Well I dunno what to say then except: Share this post Link to post Share on other sites
victimchild 0 Posted October 14, 2005 As far as YOU know? No ofense, but what possibly could you know? You don't even read the posts in this topic you are replying into!Because if you did, then you would know that you CAN detect dead units by a trigger. Actually I know just about everything there is about scripting.  And when I READ your post, you mentioned using Detected By... In your solution you say: Quote[/b] ]2. make a trigger "Civilians detected by East" and put the following into its 'on activation' field: s2 switchCamera "INTERNAL"; HintC "DETECTED" ..and... Quote[/b] ]4. make a trigger with condition "not Alive s1" and on activation "[s1] Join Player; s2 Move getPos s1" Without having the Condition be "this and not alive s1", you are completely ignoring the Detected By setting.  YES a trigger can detect when someone is dead if you set the Condition to be "not alive s1".  However, as I said, you cannot use a trigger's thislist (list) feature or Detected By feature on dead units. I am only replying because you were saying "scripting is bad".  Scripting is LIFE! As doolittle said  Quote[/b] ]( giving him credit for all the scripting he has done for the OFP community )said before, SCRIPTING IS LIFE and almost no fun OFP missions can be made without SCRIPTING. By the way. Nice screenshot! Share this post Link to post Share on other sites
BoA 0 Posted December 28, 2005 Oh my god! 5133p39, you know what you've achieved right in the words you've just typed? ... I think I'm gonna be crazy!!! Cheers!!!!@$@%$&(^&*()*&()&)(*++_()&*)*(^*&(%^&$&*&^*& Share this post Link to post Share on other sites