OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: CosmicEvo on 21 Sep 2002, 23:06:35

Title: join grpNull == No more AI?
Post by: CosmicEvo on 21 Sep 2002, 23:06:35
HELP!

 I've been trying to create a way to remove units from a players group to allow for leaving them defending an area in a large scale mp game.  But everytime I remove a unit from a group they go into STUPID mode, and no longer target, move, or respond to an enemy, even if the enemy is standing next to them with a gun pointed at their head..  I can't figure out how to make the AI respond again, it's almost as if the disableAI command has been performed.  

PLEASE HELP, I am at a loss on this one...

Cosmic
Title: Re:join grpNull == No more AI?
Post by: uiox on 23 Sep 2002, 00:01:46
If you unjoin AI of player AI is disable.
Use create unit.
Title: Re:join grpNull == No more AI?
Post by: CosmicEvo on 23 Sep 2002, 00:32:44
Yeah,
  I created the units using createunit, but I wanted to be able o disband guys to protect my flanks in the mission I'm working on.   Oh well, I'll just leave that option out for now, I guess....


Cosmic
Title: Re:join grpNull == No more AI?
Post by: Chudley on 25 Sep 2002, 02:51:51

What to do is - assign them a new group!!

This is how to do it if , for example, you remove 3 men from a group.

newGroup = formLeader unitname1
[unitname2, unitname3] join newGroup

Title: Re:join grpNull == No more AI?
Post by: Longjocks on 29 Sep 2002, 09:03:48
Just to ask a question to expand on this...

How can you now use this group as normal with their own waypoints, etc, from the time they are separated from the main group?
Title: Re:join grpNull == No more AI?
Post by: Chudley on 29 Sep 2002, 21:49:49
i.e.

newGroup commandMove getMarkerPos "WP1_NewGroup"

:D

hope this helps, obviously you'll have to place and define the markers first though.
Title: Re:join grpNull == No more AI?
Post by: Longjocks on 30 Sep 2002, 13:03:37
Understood. Thanks a heap, mate.
Title: Re:join grpNull == No more AI?
Post by: CareyBear on 07 Oct 2002, 18:11:38
A question re: this...

If I have a group of 4, say unit1 - unit4, can I set them up with different move commands each.. like

#loop
[unit1, unit2] move getmarkerpos "marker1"
[unit3, unit4] move getmarkerpos "marker2"
@ unitready unit1
@ unitready unit3
[unit1, unit2] move getmarkerpos "marker2"
[unit3, unit4] move getmarkerpos "marker1"
@ unitready unit1
@ unitready unit3
goto "loop"

And make a psuedo-synched patrol loop? I want some small patrols, but I want to keep the number of groups as low as possible & don't really mind if there's scripting overhead to do it.

So, will this work, or will they keep coming back into formation all the time?
Title: Re:join grpNull == No more AI?
Post by: Bremmer on 07 Oct 2002, 18:40:23
The Move command effectively creates a new move waypoint that the whole group will want to go to, so this wont really work.

DoMove is a whole different story, and only applies to the units you specify. Therefore you could change your script to ...


#loop
"_x domove getmarkerpos ""marker1""" foreach [unit1, unit2]
"_x domove getmarkerpos ""marker2""" foreach [unit3, unit4]
@ unitready unit1
@ unitready unit3
"_x domove getmarkerpos ""marker2""" foreach [unit1, unit2]
"_x domove getmarkerpos ""marker1""" foreach [unit3, unit4]
@ unitready unit1
@ unitready unit3
goto "loop"


... it might just work.

 :)
Title: Re:join grpNull == No more AI?
Post by: CareyBear on 07 Oct 2002, 19:44:39
WhooHOO! Sweeeeeeet....

Actually... It works perfectly.
Title: Re:join grpNull == No more AI?
Post by: CosmicEvo on 09 Oct 2002, 01:20:36

What to do is - assign them a new group!!

This is how to do it if , for example, you remove 3 men from a group.

newGroup = formLeader unitname1
[unitname2, unitname3] join newGroup



Thanks,

    That would be perfect if I could get the join function to work in MP.  Unfortunately it doesn't seem to allow anyone other then the server to use the join command.  And furthermore, if I create a server/client setup to work around, it still won't switch to another group.   :(  Oh well, so much for '2ndary group converge on location'...  

Maybe someone knows how to get around this "bug" in the MP coding?  If so, any suggestions would be appreciated...

Cosmic