Taurus 20 Posted January 27, 2004 Groups, these things that keeps groups together. group1 = group this, in an officers initline will create an group object, and all units assigned to this leader will now be in that group1. we tell the group to move to the flag over there, abot 400 meters away from the group, using group1 move getPos flag1 the groups starts moving towards the flag, however, when the group are about 200 meters away from the flag, some east machinegunners jump out from nowhere and kills the whole group. the game quietly awaits the respawn the group are officially dead, and respawned as follows "SoldierWB" createUnit [getPos respawn,group1,""] and so on until we have the original number of units in the group. BUT, now the strangest thing happen. the soldiers in the group "group1" starts moving towards the flag, even tho I did not tell them to. Why? As far as I know this is because the "group object" group1 is still aware of where the groups was heading before it was killed. to avoid this I proptly tell the leader of the group, when he is respawned to join grpNull [officer1] join grpNull making the officer part in a new group .e.g. 1: officer in alpha black 2: respawned and joined grpNull. officer in bravo Black then in the respawnscript group1 = group officer making the rest of the soldiers to join/be created into bravo Black. this works about 82% of the times when I try it... so my questions: 1: does the groups eventually run out? i.e. there are no more groups that can be created, returning "nullGroup"? 2: is it possible that the game "randomly" creates groups that are allready present in the game? i.e. grpNull create Alpha Bravo, that allready are assigned to another still "living" group? 3: are there any other way to prevent the "group object" to remember where it was heading? Thanks in advance /Taurus Share this post Link to post Share on other sites
Chris Death 0 Posted January 27, 2004 hmm - i need to investigate that problem, you're talking about: if group gets killed and respawns, so i can't tell you very much about this right now. But: Quote[/b] ]group1 = group this,in an officers initline will create an group object, and all units assigned to this leader will now be in that group1. Is not really true. group1 = group this, will just assign the already existing group of THIS to an objectname: group1 You do not really need to do this, to build a group. It's also not only the leader's init field, where you can do this, you could do it in any init field of one of the groupmembers. group1 represents the very same thing as: group anyguyofthegroup or: group (units this select 1) in any of the groupmembers init field Sorry that i can't help you with your group/respawn/don't move problem at the mo, i'll give that a shot when i'm back home from work tomorrow morning. I just thought it's time to clear up some misunderstandings going around. ~S~ CD Share this post Link to post Share on other sites
Sgt_Wilson 0 Posted January 27, 2004 Quote[/b] ]the soldiers in the group "group1" starts moving towards the flag, even tho I did not tell them to.Why? Because a group will remember waypoints given to it after its members die. In other words, you cant kill a group just the units assigned to it and waypoints are assigned to groups and not individual units. Share this post Link to post Share on other sites
Chris Death 0 Posted January 27, 2004 Taurus, what if you would try: "_x doMove getpos flag1" forEach units group1 Do they still continue moving to flag1 after respawn? Using this method would order each object from the array: units group1 to move towards flag1. In case somebody respawns, he might not be a part of the previous array group1. Just give it a try, i do have a good feeling on that one ~S~ CD Share this post Link to post Share on other sites
Sgt_Wilson 0 Posted January 27, 2004 Chris, if you use DoMove on just the squad leader, would the rest of the guys follow him? Waypoints assigned to groups could be really handy. You could have numerous virtual groups with different waypoint types (e.g A group with Seek and Destroy waypoints) When you need a Seek and Destroy mission just spwan\move the squad into the correct group, then move the waypoint to the correct location using map click e.t.c Share this post Link to post Share on other sites
Chris Death 0 Posted January 27, 2004 Quote[/b] ]Chris, if you use DoMove on just the squad leader, would the rest of the guys follow him? IMHO they would, but what if the groupleader forgets to watch "left-right" on the next road, and there's that huge dark-black monster truck comming along. New leader would say: oh no - 1 is down (in some pre-resistance version, he would even not stop yelling that ) And then the remaining part of the group would stand around where the ex-leader came under the truck, just having not a clue, where their destination was. But basically yeah, they would follow him, if there weren't some other scripting commands been told to them. ~S~ CD Share this post Link to post Share on other sites
Taurus 20 Posted January 27, 2004 Thanks for the showing interest in this "mysterious" behaviour. I'll try _x doMove. However, I need to have the group still moving towards an posistion even if the leader get's overrunned by an huge black truck of death. Share this post Link to post Share on other sites
Sgt_Wilson 0 Posted January 27, 2004 Good point about the leader, but would giving units individual move orders stop them acting as a group? Edit: Hmm...When you spawn your group again ,cant you give them the following order: group1 move ( getPos  (Leader ((units group1) Select 0)) ) This way they will not go anywhere until you tell them. BTW there are probably better ways of getting the spawn position Edited again, just to try and answer some of your other questions: Quote[/b] ]1: does the groups eventually run out?i.e. there are no more groups that can be created, returning "nullGroup"? Yes I think they would, every time you move units from one group to a new group using NullGroup you leave the old group in memory. OFP has a limit of 64 groups pers side (This may just be a limitation enforced by the mission editor), perhaps if you set the old group to null once your finished with it? But I dont think you need to use nullgroup just to stop them moving. Quote[/b] ]2: is it possible that the game "randomly" creates groups that are allready present in the game?i.e. grpNull create Alpha Bravo, that allready are assigned to another still "living" group? I would be suprised if BIS let this slip through. Does someone know what happens when you reach the max number of groups from within a script? Quote[/b] ]3: are there any other way to prevent the "group object" to remember where it was heading? Yes tell it to move to its current spawn position. Share this post Link to post Share on other sites
Taurus 20 Posted January 28, 2004 Sgt_Wilson Quote[/b] ]group1 move ( getPos  (Leader ((units group1) Select 0)) ) I'm afraid this wouldn't do the trick, I've tried it and the group promptly ignores it and wonder of towards thier "previous" destination. Quote[/b] ]Yes I think they would, every time you move units from one group to a new group using NullGroup you leave the old group in memory. OFP has a limit of 64 groups pers side (This may just be a limitation enforced by the mission editor), perhaps if you set the old group to null once your finished with it? But I dont think you need to use nullgroup just to stop them moving. , well then I'll need to capture and "nil" those groups then. This would be possible I think. I thought that OFP "cleansed" groups that are not used after a while. Quote[/b] ]Yes tell it to move to its current spawn position. See answer above. Share this post Link to post Share on other sites
Bart.Jan 0 Posted January 28, 2004 Sgt_WilsonQuote[/b] ]group1 move ( getPos  (Leader ((units group1) Select 0)) ) I'm afraid this wouldn't do the trick, I've tried it and the group promptly ignores it and wonder of towards thier "previous" destination. Try this: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">"OfficerW" createUnit [[x,y,z] , group,"temp=this",0.5, "sergant"] ~0.1 temp move position temp ... respawn other squad members Share this post Link to post Share on other sites
Sgt_Wilson 0 Posted January 28, 2004 I tired this from a radio trigger and it worked a treat: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">DeleteVehicle MyLeader; "SoldierWB" CreateUnit [GetPos Flag1,MyGroup,"MyLeader=This"]; MyGroup Move (GetPos Flag1) Quote[/b] ]I thought that OFP "cleansed" groups that are not used after a while. I dont know, it would make sense to cleanup unused groups. But I would be a bit annoyed if it deleted a Group variable just because I choose not to use it straight away. Share this post Link to post Share on other sites
Taurus 20 Posted January 28, 2004 nah, didn't work  I noticed now that grpNull eventually "run out" not at a specific time, but rather when OFP "feels" like it. a short explanation what I'm trying todo, and what up until just now worked 100% I have an groupleader, which dies and respawns as other "playable" units in ofp with "Respawn_side" this groupleader was in a group, call it Alpha Black. the groupleader dies, but the group(Alpha Black) needs to carry on it's duties, if the groupleader is in the same group as he was before(Alpha Black), he will order the whole group to "return to formation". Making the group, that can be up to 2 km away starting to run towards him. to avoid this, I joined the leader to grpNull. Now this no longer works, so I tried [groupleader] join westHQgroup. the groupleader joins westHQgroup but can not then be ordered to move via "MOVE" instead doMove needs to be commanded, as the westHQgroup cannot reach the leader's intended destination. BUT doMove an unit like this, makes him walk towards the respawn position, then he carriy on with whatever he was doing before... I do not know how I can proceed, this is really getting to me now. I really need him to stop, and wait until he's previous group(Alpha Black) is dead. the flow: then(with grpNull) leader dies, I catch this with an trigger [leader] join grpNull he respawns, and is given new weapons and a new destination, i.e. the respawn position. then he waits at the respawn position, when the group(Alpha Black) is dead I create an new group from the leader group1 = group leader group1 might now be: Alpha Red then respawns the group using the group1 e.g. "SoldierWB" createUnit [getPos respawn,group1,""] after this, the group(Alpha Red) is then again ordered to move along. BUT sometimes, at random, the group which the leader belongs to is "null" NOW: the leader dies (catched as before with an trigger) [leader] join westHQgroup the leader respawns, is given new weapons and are "doMove"'d to the respawnposition, he walks there, and then move towards he's previous destination. the group is respawn, the leader joins the group before any other units are respawned. [leader] join group1(Alpha black) the units are respawned and hurries after him... FÖR HELVETE. how can I prevent this from happening? [edit ] I moved the "join grpNull" thing to when the officer is respawned. It seems that this did the trick, however... But now, all of a sudden the game chrashes to desktop about 30-40 minutes into the game(whilst playing)  Share this post Link to post Share on other sites
Sgt_Wilson 0 Posted January 29, 2004 Quote[/b] ]I have an groupleader, which dies and respawns as other "playable" units in ofp with "Respawn_side"this groupleader was in a group, call it Alpha Black. the groupleader dies, but the group(Alpha Black) needs to carry on it's duties, if the groupleader is in the same group as he was before(Alpha Black), he will order the whole group to "return to formation". Making the group, that can be up to 2 km away starting to run towards him. I was thinking about this problem for a MP mission I plan to do "one day". What do you do with your surviving squad if you die? In CTI they just stand around waiting for you, until you tell them to do something different. It should be easy enough to work out, although I dont know anything about the mechanics of spawning units in MP. Did you want to give your newly spawned guy a completly new squad so he could get on with other stuff, or just make him wait for the others to die? Is it for AI,Players or Players/AI? Share this post Link to post Share on other sites
Taurus 20 Posted January 29, 2004 Did you want to give your newly spawned guy a completly new squad so he could get on with other stuff, or just make him wait for the others to die?Is it for AI,Players or Players/AI? It is for MP with AI units that are "playable" in the MP selection screen. I needed the "new group" thing in order to prevent the groupleader to order his units(group) to his position. i.e. "All: return to formation". If I'd simply left him standing about the group will still return to him. If I'd "detached" him and joined him to another existing group, he would still carry out what he was doing before. If I'd joined him with grpNull, the game eventually chrashes,,,, (It seems, this is VERY odd since it worked the day before yesterday i.e. this tuesday) Share this post Link to post Share on other sites
Sgt_Wilson 0 Posted January 29, 2004 You should be able to stop any AI with the DoStop command. You could use something like this once your commander has respawned: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">MyGroup Move (GetPos Flag1) DoStop (Leader MyGroup) This will send the group on its way without the officer. Share this post Link to post Share on other sites
Taurus 20 Posted January 29, 2004 You should be able to stop any AI with the DoStop command. You could use something like this once your commander has respawned: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">MyGroup Move (GetPos Flag1) DoStop (Leader MyGroup) This will send the group on its way without the officer. I'm afraid this isn't applicable with what I'm trying todo. see: 1: group 2: group moves out(done via script) 3: groupleader dies 4: confusion... at step 4 the group must proceede to thier next waypoint. unfortunatly I cannot keep track of where the waypoint was so I can make the rest of the group move to that destination, as you suggested Share this post Link to post Share on other sites
whisperFFW06 0 Posted January 29, 2004 Does the flag move? If not, the original "move WP" created by the move command is the good one. Why do you need to change group? I mean, your problem is that they start moving as soon as they respawn. So you created a new group, to "forget" (for a short time) the flag destination. Why not stop them, keeping them in the same group, until they are all respawned, and release them? To stop them, just switchMove them in a animation state in which they can't move, and switchMove them back to "" to enable moving. Share this post Link to post Share on other sites
Taurus 20 Posted January 29, 2004 Does the flag move? Yes, the waypoint are moved along an dynamic route to an final destination. (as original waypoints doesn't work with respawned groups) heres an "cartoon" presentation of what I'm doing: http://thetaurus.mine.nu/images/ofp_move_groups.jpg Warning, cartoon consist of drawn voilence and blood. this is the preffered way. Explanations to the pictures: 1: group are assigned as blue 2: waypoint is calculated, and group are told to move to this destination 3: well they starts to move 4: Leader is killed 5: group mourns the loss (oh no 1 is down), the group still hasn't reached thier destination 6: Leader is respawned into orange 7: blue group continues to move the the waypoint 8: Leader is tired, beein all orange and stuff 9: blue group gets killed, still not reached thier wp 10: zleeping 11: blue group is respawned and joining the orange leader, making "orange group" 12: new wp is created, orders are given to move out. if the leader isn't assigned into an new group, this happens: http://thetaurus.mine.nu/images/ofp_move_groups2.jpg as you see, the leader order his group to move to him. after this they move to thier intended wp if then the whole group dies, this is what is happening: http://thetaurus.mine.nu/images/ofp_move_groups3.jpg 4: group dies 5: nothing 6: leader respawns first, sometimes he runs towards his previous wp 7: group respawns 8: whole group moves out. BTW Great that BIS made an scriptlanguage that we cannot debug, or even tell to create logfiles. Share this post Link to post Share on other sites
Sgt_Wilson 0 Posted January 30, 2004 . Quote[/b] ]I'm afraid this isn't applicable with what I'm trying todo. Quote[/b] ]waypoint is calculated If you create your own waypoint for the original Move command, then you can use it when the commander respawns. You just have to get the script to remember it, or re-calculate it? Share this post Link to post Share on other sites
Taurus 20 Posted January 30, 2004 If you create your own waypoint for the original Move command, then you can use it when the commander respawns. Yes, but I want the group to move to the wp as well, even if I'd "doStop" the commander, he will order his units back to him You just have to get the script to remember it, or re-calculate it? I recalculate new wp's at the begining of the script, and when the group has reached thier wp, until they reach their final destination. then new a wp is calcultated to the next base, and so on. So the script knows allways where the wp is, but I do not want the officer/commander/groupleader to move there if he get's killed, only the remaining units in his group should go there. Anyway, it chrashes for me know, without any reason, I need to tear it all down and start all over, I'll return about an week or so(this is what I've been doing the last 2 months) Thanks for your support. Share this post Link to post Share on other sites
-)rStrangelove 0 Posted January 30, 2004 I had similar problems when i made my SpawnManager II. Quote[/b] ]so my questions:1: does the groups eventually run out? i.e. there are no more groups that can be created, returning "nullGroup"? 2: is it possible that the game "randomly" creates groups that are allready present in the game? i.e. grpNull create Alpha Bravo, that allready are assigned to another still "living" group? 3: are there any other way to prevent the "group object" to remember where it was heading? Thanks in advance /Taurus 1. Yes, after 63 groups have been used. 2. No, it only happens after you've used up 63 group names. New units will join an existing group and will fill it up to 12 units. Spawn commands into a filled group will be ignored, but may be stored in memory. Never found out why my first spawnman scripts crashed. 3. Don't know. Share this post Link to post Share on other sites
Taurus 20 Posted January 30, 2004 )rStrangelove @ Jan. 30 2004,15:20)]1. Yes, after 63 groups have been used.2. No, it only happens after you've used up 63 group names. New units will join an existing group and will fill it up to 12 units. Spawn commands into a filled group will be ignored, but may be stored in memory. Never found out why my first spawnman scripts crashed. 3. Don't know. 1: Allright 2: So what if the game creates the 63 groups, and therefor hits the "grouplimit" as you said in answer to #1. What happens then if the game(script) tries to create group 64? If I understod you correctly the units may be respawned and joining an group that are allready in the game? 3: no problem Perhaps it could be done by making an "group pool" Say that I have a total of 12 groups in my mission, I create another 12 at start. then 1: group1 dies, all units are spawned into group1_1 2: group1_1 dies, all units are spawned into group1 goto 1 Might work? Share this post Link to post Share on other sites
Sgt_Wilson 0 Posted January 30, 2004 Hmm perhaps I am going around in circles. I seems quite straight forward to me, at least I can get the following to work. 1)You calculate a waypoint and give it to the group. 2)They go off on there merry way. 3)The leader cops it. 4)He respawns and tells himself and the rest of the group to DoStop. 5)At this point everybody is standing around doing nothing. 6)The original waypoint is retrieved or a new waypoint is calculated. 7)The group is given the waypoint as a Group Move order, so everybody sets off for the new waypoint (They will not try to return to formation but just head to the WP). 8)The leader is immedeatly told to DoStop so he waits around while the rest of the group continues. Like I said I might be missing something about MP respawn? Share this post Link to post Share on other sites
Taurus 20 Posted January 30, 2004 I feel the same way about the encirclement. Quote[/b] ]4)He respawns and tells himself and the rest of the group to DoStop. Interesting point, hasn't tried this Quote[/b] ]5)At this point everybody is standing around doing nothing. Well they should Quote[/b] ]6)The original waypoint is retrieved or a new waypoint is calculated. Rodger this Quote[/b] ]7)The group is given the waypoint as a Group Move order, so everybody sets off for the new waypoint (They will not try to return to formation but just head to the WP). yes. Quote[/b] ]8)The leader is immedeatly told to DoStop so he waits around while the rest of the group continues. Never tried this. 4 and 8, most defenatly worth trying. However, I'm getting a very strange "crash to desktop" behaviour right now. First I thougt that it only happened to clients, but now all of a sudden it also crashes the server. I cannot pinpoint the cause of this. I'm about to explode, and will most certainly be forced to do it all over again. I can not for the life of me understand why things that has worked before, just stops working... Quote[/b] ]Like I said I might be missing something about MP respawn? With my previous experiences, yes this might be it. Thanks again for the suggestions, it is very much appreciated Share this post Link to post Share on other sites
Sgt_Wilson 0 Posted January 30, 2004 I'm interested in taking a look at it, I would like to learn more about the MP side. Plus an extra pair of eyes never hurt? Share this post Link to post Share on other sites