Jump to content

Enigx

Member
  • Content Count

    61
  • Joined

  • Last visited

  • Medals

Everything posted by Enigx

  1. I have a script that spawn enemy units on marker and order a patrolling movement on waypoints. Simplifying the script it is as in the following: CallPatrol.sqf ..... // loop "for" for enemy spawning. _numFT: numbers of fire teams for "_i" from 1 to _numFT do { sleep 0.2; ... definition of random markers "p1","p2".. where define patrolling waypoints .. null = [ListEnemyUnit select _faction,["p1","p2","p3","p4","p5"],EAST] execVM "Spawn_Enemy_patrol.sqf"; }; // ListEnemyUnit: array containing arrays of enemies of different factions (each with 4 units), selected by _faction. I can vary the _faction parameter in game .... Spawn_Enemy_patrol.sqf _unitArray = _this select 0; _MarkerMoveArray = _this select 1; _sideFactionUn = _this select 2; grpAI = createGroup [_sideFactionUn, true]; _unitlArrayCount = (count _unitArray) - 1; // Fire team definition for "_i" from 0 to _unitlArrayCount do { _ce = grpAI createUnit [_unitArray select _i, getMarkerPos (_MarkerMoveArray select 0), [], 0, "FORM"]; }; EnGrp = grpAI; ..... other lines to set waypoints movement It works, but I have a strange behaviour with independent factions. One of the ListEnemyUnit array elements is an array on independent units (NAPA units form RHS). If I select this faction the script spawns them correctly, but they fight each other. I noticed that only the TL is "east" while the other 3 units of the group are something else, hostile to the TL. The TL kills them, they don't shoot the TL waiting their death! They appear green on map, but once killed they appear violet on editor left screen list. This doesn't happen if I pass INDEPENDENT and not EAST to the _sideFactionUn variable. Why this behavior? Any suggestions/solution? Thanks
  2. Thanks all for answers. Yes it is also written in BIKI, sorry I didn't read it. So I have two ways: 1) set independent as enemies from editor and create group as independent, as enigma said. No no I want a group composed by all independent units but with east behavior. The reason is because I can dinamically spawn enemies in game by a personal menu, and sometimes I use independent units as enemies. 2) createunit and then join the unit to the group, as pierremgi said So in Spawn_Enemy_patrol.sqf the "for" loop will be // Fire team definition for "_i" from 0 to _unitlArrayCount do { _ce = grpAI createUnit [_unitArray select _i, getMarkerPos (_MarkerMoveArray select 0), [], 0, "FORM"]; [_ce] join grpAI; }; Is it right?
  3. Hi guys, I've an user interface that allows to launch scripts when I'm in MP game, by dedicated scripts calling buttons. For training server I would like to use it to spawn two (or more) flag poles, by clicking their position on map, and add an addAction for all players to teleport them between the flags position. No problem to create flags and so on. The problem is the addaction. Of course I'm in game and I cannot insert it in the spawned flags init. So I have to use a remoteexec to create the addaction. It is visible to all but only me (that launched the script) can use the action. The other clients cannot. I have this for the addaction strings: // flag 1 to flag 2 [arrayFlags select 0, [_arrayTextFlag select 1, {player setPos (getPos (arrayFlags select 1))}]] remoteExec ["addAction",0,false]; // flag 2 to flag 1 [arrayFlags select 1, [_arrayTextFlag select 0, {player setPos (getPos (arrayFlags select 0))}]] remoteExec ["addAction",0,false]; Note: I have arrays of flags (with text and colors) because I can create more than 2 flags. I run the addaction globally, but only me can use the action. Why? They see the action but cannot use it. Maybe is "player" the problem? Is it always "me" and not the client, where the the addaction is created by the remoteexec with global "0"? Thank you in advance for support
  4. Thank you Dennenboom, I mistakenly thought that the global variable was for everyone. I read its definition better on wiki and I understood. I will try your solution. But I have another question. We are two administrators who can create teleport flags via the graphical interface. If we both create them do we have two distinct sets of flag teleports? How do we do if we want to create only one set of flags at a time? Thanks again
  5. Hi phronk thank you for your answer. I tried as you said but doesn't work. The two strings are the same. I found the solution passing varible in another way. PlaceIED.sqf .... other strings that define the marker area, ieds number... _iedMkr=["SpawnIED"]; //List of markers to spawn IEDs in [[_iedMkr,_numeroied,_armayes,_iedshow],"ied.sqf"] remoteExec ["execVM",2]; sleep 5; // Note: this gives time to the ied.sqf to complete the run before marker deleting // deleting of marker deleteMarker "SpawnIED"; hint "IEDs placed"; Your ied.sqf script // inputs _iedMkr1 = _this select 0; _iedNum1 = _this select 1; _iedDmg1 = _this select 2; _Dbug1 = _this select 3; // set global the inputs as requested by your script iedMkr = _iedMkr1; //List of markers to spawn IEDs in iedNum= _iedNum1; //Number of IEDs per marker, defined in iedMkr [Default: 5] iedDmg= _iedDmg1; //Can the IED be killed with weapons? [Default: false] TRUE = Yes | FALSE = Can only be disarmed Dbug = _Dbug1; //Show IED markers on map? [Default: false] //!!DO NOT EDIT BELOW!! iedBlast=["Bo_Mk82","Rocket_03_HE_F","M_Mo_82mm_AT_LG","Bo_GBU12_LGB","Bo_GBU12_LGB_MI10","HelicopterExploSmall"]; iedList=["IEDLandBig_F","IEDLandSmall_F","IEDUrbanBig_F","IEDUrbanSmall_F"]; iedAmmo=["IEDUrbanSmall_Remote_Ammo","IEDLandSmall_Remote_Ammo","IEDUrbanBig_Remote_Ammo","IEDLandBig_Remote_Ammo"]; iedJunk=["Land_Garbage_square3_F","Land_Garbage_square5_F","Land_Garbage_line_F"]; .... the rest of the script.... After some tests it works only with this solution. Anyway thank you, your script is great. Thanks for sharing. Cheers
  6. Hi @phronk I would like to use your script directly when in MP game to dinamically create ied on roads. I can run a calling script (PlaceIED.sqf) during game by personal interface. Of course it runs locally and calls your script (ied.sqf) to be executed on server. PlaceIED.sqf .... other strings that define the marker area, ieds number... // Defining of global parameters so to be recognized by called ied.sqf iedMkr=["SpawnIED"]; //List of markers to spawn IEDs in iedNum=_numeroied; //Number of IEDs per marker, defined in iedMkr [Default: 5] iedDmg=_armayes; //Can the IED be killed with weapons? [Default: false] TRUE = Yes | FALSE = Can only be disarmed Dbug=_iedshow; //Show IED markers on map? [Default: false] // call ied.sqf to be executed on server ["ied.sqf"] remoteExec ["execVM",2,false]; sleep 5; // Note: this gives time to the ied.sqf to complete the run before marker deleting // deleting of marker deleteMarker "SpawnIED"; hint "IEDs placed"; Your ied.sqf script /* these are not need because already defined as global variables in PlaceIED.sqf iedMkr=["iedMkr0","iedMkr1","iedMkr2"]; //List of markers to spawn IEDs in iedNum=5; //Number of IEDs per marker, defined in iedMkr [Default: 5] iedDmg=true; //Can the IED be killed with weapons? [Default: false] TRUE = Yes | FALSE = Can only be disarmed Dbug=false; //Show IED markers on map? [Default: false] */ //!!DO NOT EDIT BELOW!! iedBlast=["Bo_Mk82","Rocket_03_HE_F","M_Mo_82mm_AT_LG","Bo_GBU12_LGB","Bo_GBU12_LGB_MI10","HelicopterExploSmall"]; iedList=["IEDLandBig_F","IEDLandSmall_F","IEDUrbanBig_F","IEDUrbanSmall_F"]; iedAmmo=["IEDUrbanSmall_Remote_Ammo","IEDLandSmall_Remote_Ammo","IEDUrbanBig_Remote_Ammo","IEDLandBig_Remote_Ammo"]; iedJunk=["Land_Garbage_square3_F","Land_Garbage_square5_F","Land_Garbage_line_F"]; if(!Dbug)then{{_x setMarkerAlpha 0;}forEach iedMkr;}; if(!isServer)exitWith{}; iedAct={_iedObj=_this select 0; if(mineActive _iedObj)then{ _iedBlast=selectRandom iedBlast; createVehicle[_iedBlast,(getPosATL _iedObj),[],0,""]; createVehicle["Crater",(getPosATL _iedObj),[],0,""]; {deleteVehicle _x}forEach nearestObjects[getPosATL _iedObj,iedJunk,4]; deleteVehicle _iedObj;};}; ........... rest of your script It works in SP but not in MP (dedicated). Any help and suggestions about it? I tried also to pass variables in the remoteexec but not work. Maybe the if(!isServer)exitWith{}; stops the code? If yes why? Because I execute it on server. Thanks in advance.
  7. Thanks so much Larrow for your support, I will try this solution too.
  8. Thanks to all. I tried and it works!! Thanks again for your help.
  9. Enigx

    Help Listbox

    Hi, I'm trying to use this script to create a teleport script, merging one of my working script written to teleport me on map. So, you click on the list shown by this script and use the player _curName to set his position on mine. So _curName setPos (getpos player); 😐 it doesn't work. I have a doubt about the use of the _curName var in this script. It seems that it "contains" the string of the selected player and NOT the "player" himself. Is it true? Infact in the "" hint _curName; "" you pass a string, otherwise, if player, it should be "" hint name _curName; "" (or something like that). So the question is, is there a way to "identify" the player that has that name? Something like (<player having _curName>) setPos (getpos player); Thanks in advance
  10. Solved. I've used CDS. Thanks so much to Sceptre for sharing. Great!
  11. Dear all, I've created a gui interface that allows to run some scripts during mission, simply pressing a button. In one of them, by pressing the buttom, the sqf starts, it opens the map and with a map-click creates a marker area where some AI units are spawned. Parameters are directly included in the sqf (area dimension, number of units...). Now I'm forced to define them before the mission. I would like to improve it implementing a dialog box in which directly type the parameters (five number inputs) to be passed to the sqf. So in summary, you click on button, open the dialog window, type the five numbers and then click a "start" button to run the script, passing those numbers. I'm new in scripting and can't find clear information on how to do it. Any help or advice? Thanks in advance
×