OFPEC Forum
Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting General => Topic started by: Case on 28 Jun 2007, 00:07:17
-
I am doing final (hopefully) bug testing on my mission, and I have one that is repeatable and kind of a pain.
I have two MH-6 insert the squad anywhere on the map. Once I (squad leader) exit the chopper and start assigning move commands to my team members, the chopper (whichever one I rode in) follows them.
I have in the script for it to return to base and land, then I remove it's fuel. So, if it gets to base, then there is no problem.
I tried to fix this by using:
[_MH6] join grpNull
But this doesn't seem to help. I call the grpNull command after everyone has left the chopper.
Any ideas?
If it would help, I can post the entire script.
Cheers!
-
[driver _MH6] join grpNull
-
Excellent, thanks Mandoble.
I just finished testing though, and it looks like that wasn't my problem.
What looks like is happening, is for some reason when I click on the map after the insertion is done, it seems to call my insertion script again. Not sure if this is a bug with 'onmapsingleclick' or a problem with my script.
For now, I am just going to use a global variable, and set it to true if the script has been run, then check for that variable at the start of the script, not very elegant, but hopefully it should work.
Cheers!
-
and it looks like that wasn't my problem.
So, if after the insertion you DO NOT click the map again, the chopper still keeps following you?
-
Isn't it necessary to switch off onMapSingleClick after using it to avoid this?
For example:
onMapSingleClick {group2 move _position2; leader grp2 sidechat "On my way"; variable1 = true; onMapSingleClick {}}
The bold part being the switch off...I hope :D
Planck
-
Mandoble,
Yes, that's correct. If I click in 3d view and order troops around it doesn't follow me now.
Planck,
For disabling the onMapSingleClick command, I actually have another script that calls this command (for a Harrier airstrike). Will disabling it in the first 'insertion' script only disable it in that script, so it will still be available for the airstrike call?
Cheers!
-
From my experience, everytime you execute the OnMapSingleClick command it stays active until you stop it with
OnMapSingleClick "";
The next time you execute the command it starts all over again and will have to be deactivated again.
///an example
OnMapSingleClick "your code";
//stop reading map clicks
OnMapSingleClick "";
//new stuff
OnMapSingleClick "new code";
//stop reading map clicks again
OnMapSingleClick "";
and I know you aren't using OnMapSingleClick {} in ArmA...or it wouldn't work at all.
FWIW
-
Thanks Nixer, I was hoping it behaved like that.
And, ya, I already battled the whole {} vs. "" thing.
:)
Cheers!