Home   Help Search Login Register  

Author Topic: Numbers NEXT to the unit icons, not under.  (Read 1270 times)

0 Members and 1 Guest are viewing this topic.

Offline bardosy

  • Honoured Contributor
  • ***
  • campaign designer
    • CartooDiv
Numbers NEXT to the unit icons, not under.
« on: 13 Sep 2006, 09:37:56 »
I know it could be a nooby question: What does it mean the numbers next to the unit icons in the mission? And how can I clear these?

The problem:
A squad of rangers (the player is the leader) fly in a BlackHawk.
A cutscene started:
1., player and his group setPos to an other position.
2., BlackHawk which transport the player deleteVehicle
3., BlackHawk2 and a ranger squad 2 (in BH2) setPos where the player was and cutscene show when this chopper is shooted down.
4., BlackHawk2 and a ranger squad 2 setPos to a far position
5., A BlackHawk-wrenck setPos to the crash site.
6., Player and his group setPos to the crash site.
7., Cutscene end.

Then the player's rangers have their own number next to their icon and they run away and they don't want follow the player's orders.

I tried a lot of solution, but I didn't find any good one. Now I kill the all of player's rangers and when the cutscene end, I relive (setDammage 0) them. It works but very odd when under the cutscene, the player character say: 2 is down, 3 is down, 4 is down...



Fix bayonet!

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re: Numbers NEXT to the unit icons, not under.
« Reply #1 on: 13 Sep 2006, 13:09:36 »
You get problems like this if you setPos units out of vehicles.  You need to unassign them and then let them get out themselves.  Or I suppose you could eject them and unassign them.

If you ever played Abandned Armies and if you took your squad in a truck to collect the first group of civilians, when you return to the mountain lodge you get a scene in which you see the player's team get out of the truck - the reason I did this was because of this exact problem.

Offline bardosy

  • Honoured Contributor
  • ***
  • campaign designer
    • CartooDiv
Re: Numbers NEXT to the unit icons, not under.
« Reply #2 on: 13 Sep 2006, 13:35:13 »
Thanks Thobson for your answer!

I tried your solve, but doesn't work for me. :(
I sucked a lot with unassignVehicle before and I think it coud work if they have time (3-6 sec). But now I unassign the whole group from the BlackHawk and then inmediately setPos them to a position and - in the same moment (no delay) - I deletevehicle the BlackHawk. In an other mission I tried to use the unassignVehicle (a group get out from a chopper and then they didn't want get in to a truck, until I destroy (deleteVehicle) the chopper. So now I delete the BlackHawk for unassign them.

OK. That's what I tried. But what are you suggest me?

1., setPos the BlackHawk (with whole group) to a safe position
2., unassignVehicle all member of the group from the blackhawk (I used {unassignVehicle _x} forEach units group player)
3., Wait? Wait for what or how many sec? And other problem the BlackHawk in the air 30-80m above the ground. If I unassign the group they will fall down or they start parachute (and when I setPos them back after the cutscene, it could be look odd). OK. I think I must setPos the flying BlackHawk to the ground (could it I?) and then unassign and wait.
Fix bayonet!

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re: Numbers NEXT to the unit icons, not under.
« Reply #3 on: 13 Sep 2006, 14:36:31 »
I can only skim read all this while I am work, so I may be missing your point.  Basically you need to get them out of the vehicle in a way that the OFP engine can cope with - so it is best to use the engine to get them out.

Unassign followed by an Eject it can cope with (even for vehicles that are in the air) so try that.  Unassign is usually sufficient for vehicles on the ground - providing you wait until they all get out before doing any setPosing.  (I can't remember but it may be necessary to eject the leader of the group if that is the player).  Also remember that a unit in a parachute is the driver of a vehicle so don't setPos them out of a parachute either!

Quote
But now I unassign the whole group from the BlackHawk and then inmediately setPos them to a position and ...
Don't setPos them out of the vehicle - they must get out on their own

If it is a custscene - why do you need to use the same group?  Could you use one that looks the same?

Quote
I used {unassignVehicle _x} forEach units group player
Correct.

Do you get the impression that what you are trying to do can cause problems?  If you do then you are correct.  Problems like this need a lot of experimentation to get round.

Offline bardosy

  • Honoured Contributor
  • ***
  • campaign designer
    • CartooDiv
Re: Numbers NEXT to the unit icons, not under.
« Reply #4 on: 13 Sep 2006, 15:07:56 »
Thank you very much THobson!

I'll try some eject and put the BlackHawk down (funny movie title :D )  to the ground before eject.
I hope when the cutscene runing I have enough time to do the OFP engine get out my men from the chopper.
Fix bayonet!

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re: Numbers NEXT to the unit icons, not under.
« Reply #5 on: 13 Sep 2006, 16:08:57 »
An eject can be quite quick.  I suggest you check that they are all out before allowing your script to progress.  Something along the lines of:

Code: [Select]
@({(alive _x) and (_x != vehicle _x)} count units group player < 1)

Offline bardosy

  • Honoured Contributor
  • ***
  • campaign designer
    • CartooDiv
Re: Numbers NEXT to the unit icons, not under.
« Reply #6 on: 14 Sep 2006, 08:48:09 »
Hello Thobson!

I follow your guidline and the eject is the key. Eject is very quick. I force land the BlackHawk and then unassignVehicle and a few second later eject.
When I lave a few second after eject and befor setPos back to the crash site, my men was wounded (I think the BH didn't land correctly and they jump from 8-10 m). But When I setPos them in the same moment when eject, everything was correct.
Thanks your help!
Fix bayonet!

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re: Numbers NEXT to the unit icons, not under.
« Reply #7 on: 14 Sep 2006, 12:28:23 »
You are welcome.  Now if you would be so kind as to solve the topic that would be appreciated also :)