Author Topic: How to make these things to work out  (Read 763 times)

0 Members and 1 Guest are viewing this topic.

Offline Bontz07

  • Members
  • *
How to make these things to work out
« on: 14 Jun 2011, 12:28:07 »

I have some questions about "How to make these things to work out":

1. How can I make civilians to be enemies for east/west units? I don't get them shooting civilians at all whitout I have shotten eastern unit as civilian.

2. How can I make trigger be activated, when shots have been fired?

3. How can I make trigger be activated, when group member/enemy unit has been hitted/killed?

4. I also wan't to know, if unit gets inside the vehicle and he is seen by enemy, he isn't set captive, but if he isn't seen by enemy, he is set captive. Is that possible to do?

5. How can I hide radio before I have done certain action? (I mean, I have to kill one enemy, before I can call heli to come pick me up)

6. How can I "glue" trigger into unit? I mean, the trigger follows the unit and in fact, the unit is the trigger. (The trigger is around the unit.) Does anybody even understand this?  :)

Now I don't have anymore questions, BUT I will have more in future...  :D


  • Guest
Re: How to make these things to work out
« Reply #1 on: 14 Jun 2011, 14:03:03 »
   Create a high-ranking (eg. Colonel) Resistance Officer. Set his Probability of Presence to zero. Group the civilians under his command (press F2 to enter 'Group' mode and click-and-drag 'lines of command' from the civilians to the officer).
   The civilians are now effectively on the Resistance side.

2. & 3.
   It depends on what you're trying to achieve: what the trigger zone covers and what it does when activated.
   If there aren't too many units in the area you could use EventHandlers - these are a specialised type of trigger that are personal to each unit.
   In the first instance you'd use:
         this addEventHandler ["Fired", {shotsfired=true}]
      for individual units, or to apply it to each member of a group:
         {_x addEventHandler ["Fired", {shotsfired=true}]} forEach units this

   And similarly, in the second:
         this addEventHandler ["Hit", {bloodspilled=true}]
         {_x addEventHandler ["Hit", {bloodspilled=true}]} forEach units this

   Then your triggers merely need to have as a condition shotsfired or bloodspilled.

   Possible, but what is the point? If he isn't seen by the enemy it doesn't matter whether he is setCaptive or not.
   Have a large 'Detected by (enemy)' trigger. Press F2 to enter 'Group' mode. This time drag a line from the unit to the trigger. Now edit the trigger properties and ensure they are 'Vehicle Detected by (enemy)'.

   Create a file called Init.sqs in the mission folder - this is automatically run before the start of the mission. According to which radio channel you are using, use setRadioMsg to hide/unhide the broadcast option. For instance, if it was radio Alpha you use
         1 setRadioMsg "NULL"
   Have a trigger that activates once the action is done, and reveal the radio option:
         1 setRadioMsg "Call Heli"

   I can understand the words you've written but can't think of a circumstance in which I'd need to do things in the way you've described. Triggers can be moved using setPos (though their size can't be changed in OFP), but to move it with a unit would be best done via scripting.

   I expect it could be accomplished in a manner mentioned above: either an eventHandler or a trigger activated by a specific Vehicle.

Offline Bontz07

  • Members
  • *
Re: How to make these things to work out
« Reply #2 on: 17 Jun 2011, 20:49:11 »
Okey, thanks for the answers :)

Now I have only one question to ask

1. How can I make unit to take binoculars, and target whit them an object? Doing mission, where I'm as a sniper, and I have observer whit me. He needs to keep eye on the target. This can't be done whit dotarget command? Unit doesn't look trought the binoculars?


  • Guest
Re: How to make these things to work out
« Reply #3 on: 18 Jun 2011, 17:19:24 »
Unless this is for a cinematic (an Intro, Outro or cutscene) or important in some other way, I suggest you learn to live with it. The more you try to control an AI units actions the stupider they appear when things don't go perfectly to plan.

You can instruct him to drop his rifle (and pistol, if he has one), and watch the general area: Alt + Left click. Alternatives would be the doWatch and commandWatch commands. He will look through binoculars more often, but it's not really observing.

Offline Bontz07

  • Members
  • *
Re: How to make these things to work out
« Reply #4 on: 25 Jun 2011, 22:42:38 »
OK. So it isn't possible to do. But thank you for the answers.

Now I have still few questions more:

1. How can I deactivate command? (In this case DoTarget command. Command needs to be activated for twenty to thirdy seconds, and then it needs to be deactivated. I haven't got any working idea to solve this. ('Couse I'm so good? Or just so stupid? Don't know  :))

2. How can I pass the time? (This is for the intro)  I need the time go forward, so I can set cameras when heli takes off in one place and little bit later lands on other place.

I will have more questions in future, so HANG ON WHIT ME!!


  • Guest
Re: How to make these things to work out
« Reply #5 on: 26 Jun 2011, 01:16:42 »
1. Use objNull which is a non-existant object. Thus:
         numbertwo doTarget objNull
is the equivalent of Radio-2-1 (No Target). You'd have to script it after a delay, or use a timeOut trigger.

2. setAccTime accelerates time, like using the +/= button but it's probably not really the effect you're after.

Conversely, skipTime makes the rotation of the Earth jump ahead: the sun and stars change position and the tides move, however units remain where they were. This might be useful if you want a significant amount of time to have elapsed; eg. take off at night, land in the morning.

However, what I suspect you're really trying to do is make the journey much faster. In that case use setPos to teleport the chopper near its landing zone.