Home   Help Search Login Register  

Author Topic: Locking a unit in place for the duration of a cutscene  (Read 1480 times)

0 Members and 1 Guest are viewing this topic.

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
I have a strange problem and need a work around.  Disable AI is not a feasible solution in this particular situation.

The problem is this:
I order all my squad to a location (location A).  If they reach there then there is no subsequent problem.  

If they are still moving when my script kicks in there is a problem.  The script gives each of them a setPos to location B, then a doMove to location C, then a doStop and then a setPos to location C.  Each member of the squad have their own B and C.  After all this one (and only one) of the squad continues to move to location A!  All the rest of the squad does what they are told, but there does seem to be some variability in exactly where they end up.  

I even put a _x doMove getPos _x after the setpos to location B but that did not help.

I can keep giving the errant unit a setPos to its location C during the scene, but the unit just ignores any doStops and turns round and heads back towards A.  

At the end of the scene the errant unit responds correctly to my orders.

The only thing that distinguishes this unit from the others is that is has no weapons.

Without using disableAI is there anyway I can freeze a unit in place for the duration of the scene.

I am now about to try a fast setPos loop, but I would much prefer something else if anyone has any ideas.

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:Locking a unit in place for the duration of a cutscene
« Reply #1 on: 21 May 2005, 18:39:41 »
Give him a weapon.........StrokeFist for example  ;D ;D


Planck
I know a little about a lot, and a lot about a little.

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:Locking a unit in place for the duration of a cutscene
« Reply #2 on: 21 May 2005, 19:01:09 »
An m16 doesn't help and I certainly feel like punching her face in.

This is one of the problems of trying to have scene in an unpredicable situation.  It is quite unlikely that this unit will be moving when the scene kicks in, but in those rare instances it will look stupid.

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:Locking a unit in place for the duration of a cutscene
« Reply #3 on: 21 May 2005, 19:10:04 »
Ohhhh......it's a woman.

Ahhh well, they have a tendency, even in real life, to do the opposite to what you expect them to do.

They are after all the 'opposite' sex.

Not trying to be sexist or anything, just an observation.

Is it not possible to delay your scene for a little longer to avoid the possibility?


Planck
I know a little about a lot, and a lot about a little.

Offline 456820

  • Contributing Member
  • **
Re:Locking a unit in place for the duration of a cutscene
« Reply #4 on: 21 May 2005, 19:17:46 »
how about a script wich does what you said above but in a loop works for me know and they stay standing when combat kicks in and they start firing in that exact same posistion i think thats what you need i didnt read the whole fist post only first half of it so sorry if its wrong.

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Locking a unit in place for the duration of a cutscene
« Reply #5 on: 21 May 2005, 19:28:07 »
Delete the unit.   Copy and paste one of the working units.

See if it works now.

If it does, edit the unit to give it right attributes.

Whatever command you gave to make her move to A, give the same command but to C.
Plenty of reviewed ArmA missions for you to play

Offline Raptorsaurus

  • Editors Depot Staff
  • *****
Re:Locking a unit in place for the duration of a cutscene
« Reply #6 on: 21 May 2005, 23:00:21 »
Attach a  copy of your script so we can look at it and see what can be modified to get around the problem.

I recently had similar problems with unit movements and I overcame those using playmoves to force them to go exactly where I wanted them to go (within a playmove of the desired postition).  Anyway, this experience made me very good at using playmove to get units to do/go where I want, so maybe I could help you by applying this to your script.

Also, I have a general script I made that uses playmoves to move an array of units through a series of positions using playmoves you determine.  I am attaching that script.  Keep in mind, however, that while a unit is moving via a playmove loop, that unit will be unable to do other things (like defend himself if he is shot at).
« Last Edit: 21 May 2005, 23:01:32 by Raptorsaurus »

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:Locking a unit in place for the duration of a cutscene
« Reply #7 on: 21 May 2005, 23:30:41 »
Quote
Delete the unit.  Copy and paste one of the working units.
Does not solve the problem I'm afraid.

Quote
Whatever command you gave to make her move to A, give the same command but to C
There's the rub.  To get the unit to go to C I have a scripted doMove command.  But this is a script for a scene that happens in the mission - this unit has been a member of the player's squad for sometime and so could be anywhere doing anything.  If it happens to be moving somewhere (by the player telling it to move) then this problem will result.  It is pretty unlikely

Planck - you are  a sexist :)

456820 & Raptorsaurus:  Thanks, but I don't think the answer is in a script, I just wondered if it was a feature of OFP that there was a known way around.

Here is an extract from the script.  As you can see all units are given pretty much the same instructions, but Irena seems to be so fixated in going to where I told her before the script started that she ignors the doStops and doMoves - I suspect she would ignore the setPos also if she could.

Code: [Select]
{if ((alive _x) and (_x == vehicle _x)) then {_x setPos [5584 + random 6,7919 + random 4,0]} else {unassignVehicle _x}} forEach ((units group Alexi) - [Alexi])

Karl doMove [5558.57,7891.74,0]
Ruslan doMove [5571.75,7895.87,0]
Erik doMove [5565.88,7892.44,0]
Irena doMove [5563.39,7891.99,0]
Irena ignors the previous instruction if she was previously on her way somewhere else
.
.
.
.
Code: [Select]
Alexi setPos [5563.27,7888.55,0]
Alexi setDir 180
{_x playMove "EffectStand"} forEach (units group Alexi) + [Yuri]
{doStop _x} forEach (units group Alexi) + [Yuri]
{_x setMimic "Angry"} forEach (units group Alexi) + [Yuri]
if (alive Karl) then {Karl setPos [5558.57,7891.74,0];Karl setDir 140}
if (alive Ruslan) then {Ruslan setPos [5571.75,7895.87,0];Ruslan setDir 180}
if (alive Erik) then {Erik setPos [5567.88,7895.44,0];Erik setDir 206}
if (alive Irena) then {Irena setPos [5562.39,7891.99,0];Irena setDir 170}

After the above instruction all except Irena stay where they are.  She runs off to the location I told her to go to prior to the script starting.
« Last Edit: 21 May 2005, 23:32:01 by THobson »

Offline Gogs

  • Contributing Member
  • **
  • WWIIEC - Gracefully retired boss
Re:Locking a unit in place for the duration of a cutscene
« Reply #8 on: 22 May 2005, 01:03:13 »
Hmmm....

I got a tatic I like to use with AI being silly in cutscenes. Simply put a marker (or use the co-ordinates) of somewhere out of site, use the setface command on your unit, so it always looks the same, and then have a LOOKALIKE unit, which you simply setpos into place in exchange for your friend for the cutscene. Guarenteed on its best behaviour. If you like, you can save the positions of your units by a script before you make them all vanish, so you can setpos them back to where you moved them from. Hope it works dude!

Uldics

  • Guest
Re:Locking a unit in place for the duration of a cutscene
« Reply #9 on: 22 May 2005, 09:59:43 »
I got a same kind of problem, when those waypoints were too long distance from the unit. Just ordinary waypoints. But domove kinda creates a wp, right? Then I just placed some closer waypoints. It helped. Maybe some kind of terrainpathfinding stops when too long distance.

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:Locking a unit in place for the duration of a cutscene
« Reply #10 on: 22 May 2005, 10:21:12 »
Gogs:  Good idea.  What puzzles me is that it is only this unit, and if I delete the init in the editor and make a new one the same thing happens.

Ronin: There are no waypoints involved for these units in the entire mission

Offline Gogs

  • Contributing Member
  • **
  • WWIIEC - Gracefully retired boss
Re:Locking a unit in place for the duration of a cutscene
« Reply #11 on: 22 May 2005, 16:13:14 »
Must be

a) because shes a woman
b) because shes a woman
or
c) because shes a woman.

Its just the realism inherant in the OFP engine. Women don't do what they are told. ;)

Seriously though, it is pretty odd, I can't think of anything.... Haven't got a public variable called Irena or something like that?

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:Locking a unit in place for the duration of a cutscene
« Reply #12 on: 23 May 2005, 07:46:28 »
Really you guys are so sexist.  

I have fixed this in a pretty ugly way.  At the appropriate time I run a script that has a fast loop, if she moves the script puts her back.

I will investigate this more when I have more time