Mder 0 Posted April 1, 2007 i saw this post the other day but didnt get a chance to look at it. i searched the forums for 30 min trying to find it but i cant. does anyone know a script that my squad starts off the mission in a chopper/vehicle that isnt in my squad? Share this post Link to post Share on other sites
XCess 0 Posted April 1, 2007 Put this in the init field ofthe group leader. _grpName = group this; {_x moveInCargo _vehName} foreach units _grpName Share this post Link to post Share on other sites
Mder 0 Posted April 1, 2007 didnt work for me.. it said error in local variable in global space Share this post Link to post Share on other sites
-SPA-LynxEye 0 Posted April 1, 2007 And where the error-shown in screen was putting the char # ? Maybe you have the word 'group' also as variable; maybe 'units' too. Just check the variables written by Xcess if you having it without the _ char in more scripts in your mission. It seems an error with 'mixed' local/global variables. Note to Xcess: 'this' in your example can be '_this' ? Share this post Link to post Share on other sites
Mder 0 Posted April 1, 2007 i deleted a space that it had and the error message didnt come up anymore..but then when i preview the mission they are not in the chopper. Share this post Link to post Share on other sites
-SPA-LynxEye 0 Posted April 1, 2007 what is the name of your chopper. Be sure the variable _vehName has your chopper as object, or at least the name you put it in the 'name field' where 'Edit Unit' screen. Share this post Link to post Share on other sites
Mder 0 Posted April 1, 2007 yeha i named the chopper "chopper" and put for vehName chopper...still didnt work.but i remember seeing a smaller script last time. something like "[unit1,chopper] getin" or something like that Share this post Link to post Share on other sites
-SPA-LynxEye 0 Posted April 1, 2007 Try this litterally writen _grpName = group this; {_x moveInCargo chopper} foreach units _grpName and/or _grpName = group this {_x moveInCargo chopper} foreach units _grpName Copy and paste, don't type it. AND/OR check in your mission.sqm, if the leader is declared after 'all those soldiers you wanting to put inside the chopper'. I think leader has to be the last declared-in-order soldier of that group... i can't understand how ArmA can launch the script in initField when 'still' not all soldiers of the group is (are?) declared. And also be sure... that the chopper is declared after leader... Share this post Link to post Share on other sites
Mder 0 Posted April 1, 2007 it is the same error when i use those...it brings me to the part on the script line where it says..... foreach units _grpName when i delete the space between the word "units" and "_" it doesnt give me the error on the editor but when i go in the mission, they arnt in the chopper. Share this post Link to post Share on other sites
-SPA-LynxEye 0 Posted April 1, 2007 The error will not be shown because "units_grpName" is not doing any 'dangerous' thing. Then it seems _grpName is not containing the name (ID?) of the group. Then, ArmA can't put AI soldiers into the chopper, because you (maybe) are bad-referring that _grpName variable. It means, because you have not a group. Make first a group. _grpName, is a variable containing the name of your group. Maybe not the name, maybe only the object, or the ID of the group. Additional info about 'group' command: Quote[/b] ]Problems:In MP the command ist not initialised in functions called by initline or init eventhandlers. Can be shown here: http://community.bistudio.com/wiki/group Read all the article. Share this post Link to post Share on other sites
Mder 0 Posted April 1, 2007 how do i name my group? Share this post Link to post Share on other sites
-SPA-LynxEye 0 Posted April 1, 2007 If all your AI soldiers... having a 'name'... http://community.bistudio.com/wiki/join Sry, i can't help much more beyond this point, because: - i never tried to script with AI's. - never tried to use a 'Foreach' statement. - never tried to use 'triggers'. So all the time i'm trying to solve it with 0 experience. Please: Add these links (if you want) to your favorite links of your Internet browser: This is my little fast-links-to-bible. VEHICLES http://community.bistudio.com/wiki/ArmA:_CfgVehicles http://community.bistudio.com/wiki/ArmA:_Vehicles SOLDIERS http://community.bistudio.com/wiki/ArmA:_Infantry OBJECTS http://community.bistudio.com/wiki/ArmA:_Objects http://www.armaleague.com/buildin....iLL.htm WEAPONS (SOLDIER/VEHICLE) http://community.bistudio.com/wiki/ArmA:_Weapons BRIEFING http://www.flashpoint1985.com/docs/briefing.html ALL COMMANDS http://community.bistudio.com/wiki/Category:Scripting_Commands_ArmA http://community.bistudio.com/wiki....ds_List ACTIONS http://community.bistudio.com/wiki/ArmA:_Actions EVENT HANDLERS http://community.bistudio.com/wiki/User_Interface_Event_Handlers http://community.bistudio.com/wiki/ArmA:_Event_Handlers ANIMATIONS http://community.bistudio.com/wiki/ArmA:_Moves MISC How to add some easy images to your vehicles. http://community.bistudio.com/wiki/squad.xml How to start to handle 'drop' particles. http://community.bistudio.com/wiki/ArmA:_ParticleShape Files in a normal mission. http://community.bistudio.com/wiki/Mission_Design How Description.ext doing. http://community.bistudio.com/wiki/Description.ext This SUPERB tutorial about Mission Editor (by Fasad). http://community.bistudio.com/wiki....terface http://community.bistudio.com/wiki/Control_Structures http://community.bistudio.com/wiki/For_Type http://community.bistudio.com/wiki/Category:Common_Scripting_Errors http://community.bistudio.com/wiki/Title_Effect_Type http://community.bistudio.com/wiki/Category:Syntax http://community.bistudio.com/wiki/Category:ArmA:_Mission_Editing VARIABLES http://community.bistudio.com/wiki/Data_Types http://community.bistudio.com/wiki/String http://community.bistudio.com/wiki/Category:Arrays http://community.bistudio.com/wiki/Variables etc etc etc... Share this post Link to post Share on other sites
fasad 1 Posted April 2, 2007 how do i name my group? in the initialization string for any unit in the group: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">myGroupName = group this where myGroupName is whatever variable name you wish to name the group. the local variable problem is caused by the use of _grpName. You cannot define or use local variables in init strings! Share this post Link to post Share on other sites
Chris Death 0 Posted April 2, 2007 _grpName is a local variable indicated by the _ Change it into a global variable like: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">group1 = group this; {_x moveincargo chopper} foreach units group1 ~S~ CD Share this post Link to post Share on other sites
Mder 0 Posted April 2, 2007 thanks a lot guys i got it to work now Share this post Link to post Share on other sites