OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started 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
-
If you unjoin AI of player AI is disable.
Use create unit.
-
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
-
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
-
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?
-
i.e.
newGroup commandMove getMarkerPos "WP1_NewGroup"
:D
hope this helps, obviously you'll have to place and define the markers first though.
-
Understood. Thanks a heap, mate.
-
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?
-
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.
:)
-
WhooHOO! Sweeeeeeet....
Actually... It works perfectly.
-
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