OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: bedges on 03 Sep 2005, 23:17:02
-
i have a script which disengages the player from an existing group and then creates a new group with the player as leader. this works fine when the player is the leader of the original group, but when there's an ai leader, the player retains his position in the group even after leaving, like so -
(http://www.tumeric.co.uk/mrb/flashpoint/teampic.jpg)
how do i remedy this?
-
Hard to tell when I cant see the script but a guess would be if your using [player] join player, try [player] join grpnull.
-
[player] join grpnull
hint "Creating New Squad!"
~1
[player] join player
my_sqd = group player
that's the disengaging part of the script, everything else is creating loons and joining them to the player.
-
Can you make them join a different group real quick before they come back?
-
erm... come back from where?
see, i thought [player] join grpnull would make the player number 0 in the group array. then when other loons are created in his group, he remains the leader at position one. but if the player leaves a group where he's been second or third in command, then he's still second or third in the new group, despite being the leader...
weird, no? ???
-
It's not so weird, bedges, because I think the positioning inside the group is a matter of ranks in that (or any) group; you see, you're positioned according to your rank inside the group.
EDIT: Hm, no it's not like I asumed, just checked ... it is weird ...
-
[player] join player is unnecessary. Try
[player] join grpnull
hint "Creating New Squad!"
~1
my_sqd = group player
[arrayofloons] join player
Also look at:
http://www.ofpec.com/editors/resource_view.php?id=770
EDIT: I have done a bit of testing. As karantan says - it is wierd. The script above results in the new leader staying in the same place in the squad. I will invetigate this some more.
EDIT2: Not only does the new leader keep the old position in the squad, but even though he is the group leader he is not the formation leader. This is intriguing.
EDIT3:
It gets worse. (formLeader player == player) is true - but the whole squad make their formation from the previous leader of the group!
EDIT4:
I now believe what you are trying to do is not possible. The number the player is assigned at the start of the mission seems to depend on his rank order within the group he starts with. I have found no way of changing this subsequently. If he starts in a group of just himself, he will remain #1 even when he joins another group of more senior soldiers. Changing the number of any of the units that are not players is not difficult. It just seems that the player's number is locked for the duration f the mission right at the start. (Unless some one else knows different.) Sorry.
-
argh is all i can say. argh with bells on. :-\
it doesn't even work if all the original squad are dead...
-
it doesn't even work if all the original squad are dead...
As I saw it in my previous checking of this problem, it should work with loons outside your initial squad, because that weird positioning applies only towards the members of your initial squad, so if all are dead... Any 'outsiders' should be positioned behind you, even if you're a Private, and they're all Colonels.
-
Have you tried assigning all members who are to join the player to grpNull before assigning them to him?
Also, try assigning him to join objNull. The 'join' command works on both objects and groups so that might work.
-
I've also had some very peculiar results when shuffling the player between groups.
The nastiest one is the player remaining on the same radio net as his previous group! (If anyone can solve this bug for me I'll name my first born after you! :P)
I've found that rank doesn't seem to matter, it's more the order in which the guys join the group that defines what position they'll be in.
But it varies... OFP's like that sometimes ::)
-
I've found that rank doesn't seem to matter, it's more the order in which the guys join the group that defines what position they'll be in.
For ai units that is certainly the case. When experimenting with this a bit yesterday I did notice though that the player's initial position in a group does seem to change if you change his rank. I found no way to change the player's position number after the start of the mission. I assigned him to grpNull to other groups, I assigned other groups to him etc. Nothing I did would change the number he was given at the start. Though I didn't try Tyger's idea of assigning him to objNull. That would be worth a try.
-
I can't help feeling that BIS tried imperfectly to hardcode this into the game to avoid confusing the player. You start as 3, you're always 3. It's a perfectly rational approach.
-
[player] join objnull doesn't work either. i suppose i'll just have to accept the limitation and move on.
thanks for the responses anyways gents, always appreciated 8)