Home   Help Search Login Register  

Author Topic: Hostages not getting shot at night? (SOLVED)  (Read 2173 times)

0 Members and 1 Guest are viewing this topic.

Offline Goos

  • Members
  • *
Hostages not getting shot at night? (SOLVED)
« on: 28 Aug 2008, 21:56:29 »
Hey guys got a weird problam on my hands on a mission I'm in the middle of creating. I'm new to editing on arma (tinkered a bit in the past with flashpoint but that was a long time ago) and this site has been invaluable to my learning process but the situation goes kind of like this...

Overview of things:
On the island of Rahmadi part of the mission is to save some civilian hostages in a night mission. I have the RACS set friendly to east (hate how the enemy infantry looks so opted for using RACS with east weapons as the bad guys) as such the civilians are also friendly to east/RACS so to get past that problem I grouped them with a west unit with probability 0% and "this setCaptive true; this disableAI "MOVE" to set them as hostages who won't run off.

Now what I want to happen is if the RACS detect the west they'll shoot the hostages so a trigger is laid down activated by BLUFOR detected by resistance with On Act. "setCaptive false"  for each of the hostages resulting in the hostages no longer captives and the RACS feel free to hose them down. This all works great apart from one problem. It only seems to work during the day! :blink:  at night no joy at all and this is a night mission! :weeping:

I tested the same situation adding a west unit as an extra hostage under the same perameters and even at night the RACS happily gun him down but leave the civilian hostages in tact. I'm utterly confused as to what is going on so any help here would be great guys.

Many thanks in advance.

**Edit** I also tried giving RACS night vision goggles still no joy.
« Last Edit: 29 Aug 2008, 22:46:09 by Goos »
Same $#!t different day.

Offline johnnyboy

  • OFPEC Patron
  • ****
  • Matan los Pantalones!!!
Re: Hostages not getting shot at night?
« Reply #1 on: 28 Aug 2008, 23:39:43 »
I believe you can force the RACS to shoot them via:

Code: [Select]
racs_dude1 reveal civ1;
racs_dude1 dotarget civ1;
racs_dude1 dofire civ1;

You could also try forcing the civilians to be "renegade", so all sides will shoot them:

Code: [Select]
civ1 addRating -2000;
By giving a unit a negative rating, he will be hated by all and shot on sight.  This would work for a cutscene where only RACS are present, but your West units will also shoot renegades, so this may not be what you want.

Good luck.
El Cojon: "Do you like to Tango?"
You: "Only in Bagango."
Download Last Tango in Bagango and discover how El Cojon earned his name...

Offline Goos

  • Members
  • *
Re: Hostages not getting shot at night?
« Reply #2 on: 29 Aug 2008, 01:11:50 »
Good call. Thanks a lot for the help.

strange things happening though (starting to wonder if the game can keep up) the situation is 4 hostages and 3 guards. Sometimes the guards seem to react really slow or only kill some of the hostages and not all. It's as if the AI can't cope with everything that's going on and can't keep up with all the commands. even tried giving each guard 1 kill each and still they either react really slow or don't all kill their targets (or both). Starting to wonder if I should give up on the scenario lol.
Same $#!t different day.

Offline JasonO

  • OFPEC Patron
  • ****
  • Oh no...
    • The New Life RPG
Re: Hostages not getting shot at night?
« Reply #3 on: 29 Aug 2008, 04:17:07 »
How far away are the guards from the civilians, and are they originally facing them?

I find AI can be blind to stuff even if its really close to them at night - until it moves or makes a noise.

Offline Goos

  • Members
  • *
Re: Hostages not getting shot at night?
« Reply #4 on: 29 Aug 2008, 06:35:06 »
Guards are facing them and only a few paces away. I've resorted to having 1 hostage per guard, 3 triggers basically repeating the same thing but with different timers 1 instant 2 1 second 3 2 seconds and the 3 hostages are standing close together in the hopes that even if 1 or 2 guards fire the others might get caught in the crossfire. 8 out of 10 times though there tends to be 1 hostage left alive at the end of it all. what I don't get is if I set west soldiers up in this scenario and just use the setCaptive true/false idea it works perfectly all be it the guards still tend to be slow to catch on and shoot even if it's day. All very quirky indeed. I might have to go totally crazy and set up some kind of system that tracks hostage health and if even one hostage dies have the computer just kill the others off regardless of being shot or not (if I can set up such a thing. still learning here) I just wish the guards would react faster I want to make it hard to save the hostages not have player clear the barn they are in of hostiles with the 5-10 second window it takes the AI to react. Anyway I appreciate the help guys.
Same $#!t different day.

Offline johnnyboy

  • OFPEC Patron
  • ****
  • Matan los Pantalones!!!
Re: Hostages not getting shot at night?
« Reply #5 on: 29 Aug 2008, 07:00:10 »
Is this a cutscene?

I had a similar problem in the outro of Last Tango In Bagango, when I wanted a gunner to shoot at a movie camera object.  I had to setpos an enemy in front of the movie camera object (but the cutscene camera was focused on the shooter, so this was not visible to player), and then did the reveal/dotarget/dofire commands to get shooter to shoot.  I found that time elapsed before the shooter would shoot varied from seconds to a minute.  This time inconsistency was crazy, and ruined the cutscene.

My solution was before the reveal/dotarget/dofire commands I accelerated time, and I put a Fired eventhandler on the shooter that set accelerated time back to normal.  So if the engine took a long time to get the shooter to shoot, that occurred on accelerated time, and player did not notice it.

Maybe a similar solution will work for you.

An entirely different approach that should work, is to have shooters target the civilians, then use the UseWeapon command to force them to fire their primary weapon.   The shooters will fire every time exactly when you want them to.   This works without fail.  This is how ROMM_AI works on getting units to fire suppressing fire, even if they no longer can see the unit being targeted.  Check it out.

It's sad we have to work this hard to make it work for you though...
El Cojon: "Do you like to Tango?"
You: "Only in Bagango."
Download Last Tango in Bagango and discover how El Cojon earned his name...

Offline Goos

  • Members
  • *
Re: Hostages not getting shot at night?
« Reply #6 on: 29 Aug 2008, 17:17:38 »
I should have mentioned earlier this is an in mission scenario not a cutscene (I aint got to cutscenes yet hehe)

after trying the useWeapon command in the trigger the guard in question seems to just do the animation like he is picking up equipment so I must have messed up somewhere (did I mention I was a noob? lol). On the plus side he reacts perfectly and on time so this looks like the way to go. I'm no scripter by any stretch of the imagination as I say I'm literally just starting to use the editor and only have a grasp of the basics so if anyone could tell me how I should type this command out you would have my undying gratitude :D I'll keep looking in the meantime to try and figure it out.

3 guards: guard1 guard2 guard3
must shoot
3 hostages: civ1 civ2 civ3

I would prefer more hostages but I'll keep it simple for now. Thanks again guys.
« Last Edit: 29 Aug 2008, 17:42:16 by Goos »
Same $#!t different day.

Offline johnnyboy

  • OFPEC Patron
  • ****
  • Matan los Pantalones!!!
Re: Hostages not getting shot at night?
« Reply #7 on: 29 Aug 2008, 19:05:36 »
I had that same problem with the useWeapon command until I learned it works if a gamelogic executes the command.

So place a gamelogic on the map, name it logic1, and then do these commands:

Code: [Select]
guard1 dowatch civ1;
guard1 dotarget civ1;
~.5;
logic1 action ["useWeapon",vehicle guard1, guard1,0];

Note I put a "sleep 1/2 second" command in there to give the guard time face the civ1.  You might have to adjust that.  Having the game logic execute the action will make guard1 shoot.
El Cojon: "Do you like to Tango?"
You: "Only in Bagango."
Download Last Tango in Bagango and discover how El Cojon earned his name...

Offline Goos

  • Members
  • *
Re: Hostages not getting shot at night?
« Reply #8 on: 29 Aug 2008, 21:32:17 »
Just to clarify here. do these commands go in the trigger On Act. line? because that seems to have a problem with ~.5; and although he seems to target the hostage he does not fire. or am I being totally dense and it should be in an external sqf or something? (not something I have tinkered with yet)

Incidently the logic is in place on the map and named accordingly.
« Last Edit: 29 Aug 2008, 21:36:02 by Goos »
Same $#!t different day.

Offline johnnyboy

  • OFPEC Patron
  • ****
  • Matan los Pantalones!!!
Re: Hostages not getting shot at night?
« Reply #9 on: 29 Aug 2008, 22:10:48 »
Sry, you can't use sleep commands (~) in triggers or waypoint code.  That code would work in a .sqs script.

However, you can do it without scripting using Talk waypoints.

See the attached small sample mission.  In it there is a radio activated trigger to start the demo.  The trigger unlocks the waypoints, and the waypoints execute the dowatch, dotarget, and useweapon commands.

I like talk waypoints for performing scripts or specific code.  You can put in time delays between each talk waypoint by setting the min/max/mid timeout values.  Take a look at it to see how it works.

Drag the folder from zip file into your arma editor missions directory.
El Cojon: "Do you like to Tango?"
You: "Only in Bagango."
Download Last Tango in Bagango and discover how El Cojon earned his name...

Offline Goos

  • Members
  • *
Re: Hostages not getting shot at night?
« Reply #10 on: 29 Aug 2008, 22:43:49 »
That sir is just plain perfect! Your a star mate thanks so much for your help.

Also the talk waypoints tactic is very useful. I can see myself using it for other stuff as well.

Thank you so much for your help it's much appreciated!

**EDIT** Here is a real quirk. I actually got it working with just the AI working on it's own after all by doing the following...
(As before I'm using the RACS/Independant as my enemy so they are friendly to OPFOR)

Independant guard with this in his initialisation
Code: [Select]
guard1 doTarget civ1
Trigger with settings BLUFOR detected by resistance (RACS/Independant) with On Act.
Code: [Select]
guard1 doWatch civ1; guard1 doTarget civ1; guard1 doFire civ1
lo and behold it works a treat! As soon as any BLUFOR is detected by Independant the guard nails his hostage with next to no delay! :blink: same deal with 3 guards and 3 hostages.

after all that hassle I stumble on this! I haven't checked to see what sorted it all out but it's as if the "guard1 doTarget civ1" in the guards initialisation wakes him up to what he has to do. Go figure.

Anyway thanks again for your help johnnyboy the Talk waypoints tactic is something I never realised about before so at the very least my eyes were opened up to that one :D cheers!
« Last Edit: 30 Aug 2008, 03:15:00 by Goos »
Same $#!t different day.