Home   Help Search Login Register  

Author Topic: Cutscene - Some people in it have been killed! How to resolve...?  (Read 1204 times)

0 Members and 1 Guest are viewing this topic.

TheOakster

  • Guest
Hello,

I have a cutscene that has some of the AI team members have 'parts' in, but I just realised that some of them may get killed before hand  :-[.

How do I go about checking if ,as an example, t1 is dead and if so make t2 play the part etc.

I know that I can check if t1 is dead

Code: [Select]
? (!Alive) t1 or something similar.

But how do I switch t1 for an alive player?

I can set a trigger to play a different cutscene if there is not enough players for my cutscene, but its just how to switch AI loons that are dead for alive ones.

Ben

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
to prevent AI from targetting each other, put

Code: [Select]
this setcaptive true
in their init lines.

if they're getting run over or blown up, then you should think of something else. switching live loons for loons who are getting killed should be a last resort.

TheOakster

  • Guest
Sorry, I didnt make myself clear  :-[

The situation would be:

The AI are on the players team and they approach some buildings, they are attacked, and then when the enemy are defeated, a cutscene is triggered.

In the cutscene I have person A saying a line, then person B and then the player etc.

But, what do i do if person A is killed before the cutscene, so when the cutscene starts it would have a  dead body saying his part!

How do i check if person A is dead and if so change person A to an alive person in the cutscene script?

Is that a bit clearer?  ???

Ben

*EDIT*

Spelling grrr

Offline Raptorsaurus

  • Editors Depot Staff
  • *****
Instead of looking for the unit's individual name (t1 in this case) look for the unit's order in the array of units in the group. When you make an array of units from the group, dead units will be ommited.

So, instead of:

Code: [Select]
_camtarget = t1Do this:
Code: [Select]
_camtarget = (units group t1) select 1This will be the unit right after the leader. If you want it to be the last memeber of the group than do this:
Code: [Select]
_camtarget = (units group t1) select ((count units group t1)-1)If you want it to be the current leader of the group then this:
Code: [Select]
_camtarget = leader group t1
This way even if t1 is dead, the second or last or leader (depending on which you want) will be the ones who will be the camera target and say the lines.  If all the guys are dead, or the group has less men alive than you require for the cutscene, then you will have a problem.
« Last Edit: 11 Jul 2006, 23:12:11 by Raptorsaurus »

TheOakster

  • Guest
aaah getting there....!!  ;D

So if I had (with a group name of grp1)

Code: [Select]
_camtarget = (leader group grp1) select ((count units group leader)-1)
Then would that be the 1 below the leader and then -2 for the next in line etc?

Ben

Offline Raptorsaurus

  • Editors Depot Staff
  • *****
If your group has the name grp1, then the one below the leader would be like this:

Code: [Select]
_camtarget = (units grp1) select 1
The leader would be

Code: [Select]
_camtarget = (units grp1) select 0or
Code: [Select]
_camtarget = leader grp1
the last man in the group would be

Code: [Select]
_camtarget = (units grp1) select ((count units grp1)-1)

TheOakster

  • Guest
I see...

So to 'setpos getpos' a person to a position for the camera shot I would put

Code: [Select]
{(units grp1) select 1} setpos getpos pos1
And it wouldnt matter if the original person below the leader had been killed because it is looking for the next alive person?

e.g If the team was made up of Leader, A, B, C, D, E and A was killed before the cutscene then the above script would move B to the position of pos1.

(Apologies for bumbling through this)

Ben

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Code: [Select]
((units grp1) select 1) setpos getpos pos1
that is correct.

and no apologies needed - we're here to help until you get it :)

Offline penguinman

  • Contributing Member
  • **
  • Money is worthless, just paper, ink, and threads
Just a tip, mabey after the enemies are defeated, have some reinforcements come in, and one of those could mabey take up the part for the cutscene instead of relying on guys that could possibly die.