Jump to content


  • Content Count

  • Joined

  • Last visited

  • Medals

Community Reputation

0 Neutral

About SophionBlack

  • Rank
  1. SophionBlack

    Convert string to variable

    Thanks everyone for the insight!
  2. SophionBlack

    Convert string to variable

    I'm a bit lost on this topic, I have the same question but I'm not sure how it has been answered. To convert a string to a variable is it as below? private _ReSpawnedGuy = _this select 0; private _OrigSquadLead = leader _ReSpawnedGuy; private _OrigSquad = groupID group _OrigSquadLead; private _ReinSquadName = _OrigSquad + " Reinserts"; private _SQDCounter = _OrigSquad + "_Squad_Pack_Counter"; _ReinSquadName = missionNamespace getVariable [_ReinSquadName, objNull]; _SQDCounter = missionNamespace getVariable [_SQDCounter, objNull]; But I'm doing something wrong as both _ReinSquadName and _SQDCounter are "<NULL-object>", the default variable state.
  3. Correct, I was messing with that line trying to figure things out. The main issue that I'm having is calling those variables, after declaring them as a public variable, from inside the event handler. Such as: createMarker [_LZNameID, _pos,0,player] The _LZNameID isn't taken as the name and adding str doesn't do it either.
  4. That's an issue... The variables inside the event handler must be passed outside, otherwise the marker and LZ report wont match. I've revised the code but still find myself in the same boat. Am I using the wrong tool for the job? Please see the full code below: private _PhonAlph = ["Alpha","Bravo","Charlie","Delta","Echo","Foxtrot","Golf","Hotel","India","Juliet","Kilo","Lima","Mike","November","Oscar","Papa","Quebec","Romeo","Sierra","Tango","Uniform","Victor","Whiskey","Xray","Yankee","Zulu"]; private _LZNameID = format ["LZ_%1", _PhonAlph select random 26]; private _LZNameTXT = format ["LZ %1", _LZNameID select [3,8]]; private _Time = format ["%1-%2%3", date select 2, date select 3, date select 4]; private _AMC = player; private _LZPOC = GroupID (group _AMC); clicked = 0; hint "Click on map to set the target location"; openmap true; onMapSingleClick {_marker = createMarker [LZMark, _pos,0,player]; _marker setMarkerType "mil_end"; _marker setMarkerText _LZNameTXT; _Helipad = 'Land_HelipadCivil_F' createvehicle getmarkerpos _marker; clicked = 1; openmap false; onMapSingleClick ''; true; }; waitUntil {(clicked == 1)}; hint "LZ Designated"; sleep 3; //Generate LZ Report; private _LZCoords = mapGridPosition getmarkerpos _LZNameID; private _LZLine1 = format ["%1 Open - %2", _LZNameTXT, _Time]; private _LZLine2 = format ["Coordinates: %1", _LZCoords]; private _LZLine3 = format ["Contact %1 prior to approach", _LZPOC]; private _LZLine4 = format ["LZ marked with smoke/chemlight (day/night)"]; private _LZLine5 = if (windStr <= 0) then {format ["Wind: Calm"]} else {format ["Wind %1 at %2", windstr, winddir]}; private _LZLine6 = if (getposASL _Helipad select 2 <= 0) then {format ["Elevation: Sea Level"]} else {format ["Elevation: %1", round (getposASL _Helipad select 2)]}; private _LZLine7 = format ["Report all fire recieved"]; hint composeText [_LZLine1, lineBreak, _LZLine2, lineBreak, _LZLine3, lineBreak, _LZLine4, lineBreak, _LZLine5, lineBreak, _LZLine6, lineBreak, _LZLine7];
  5. I have a script that's causing me to learn a bit more in formatting and an except is below: private _PhonAlph = ["Alpha","Bravo","Charlie","Delta","Echo","Foxtrot","Golf","Hotel","India","Juliet","Kilo","Lima","Mike","November","Oscar","Papa","Quebec","Romeo","Sierra","Tango","Uniform","Victor","Whiskey","Xray","Yankee","Zulu"]; private _LZNameID = format ["LZ_%1", _PhonAlph select random 26]; onMapSingleClick "_marker = createMarker [_LZNameID, _pos,0,player]; clicked = 1; openmap false;onMapSingleClick ''; true;"; The problem is that as how the code is written now, the further commands just don't have a target and the changers aren't made. _LZNameID setMarkerType "mil_end"; I notice when I specify a name for it and forgo it using a variable I have to put it in single quote marks such as: 'MarkerName' how do I get it to read the variable as a single quote string to be read? Such as the str command but for single quote marks?
  6. I have four compositions that I've been trying to place that all relate to one vehicle. The vehicle itself is a marshal without a turret that has several various objects attached to it via the BIS_fnc_attachToRelative script. Back view of marshal The first composition is the marshal itself with the various objects and can be placed without issue. The second is an invisible helipad that has the init field with a script containing a remote exec that adds actions that add functionality to parts of the marshal; this can be placed without a problem. The third, problem child composition, is another invisible helipad that has the following in the init field: [apcnoT,["To Gunner's Seat (Mortar)",{MoveOut (_this select 1);(_this select 1) action ["getingunner", apcnoTMor]}, [], 0, false, false, "", "_this in (crew _target) && (isNull gunner apcnoTMor)"]] remoteExec ["addaction",0,true]; deleteVehicle this This, as opposed to the others causes BattlEye to automatically kick me from the public zeus with the message "RemoteExec restriction #12" The other codes: Marshal (apcnoT) apcnoT removeWeaponTurret ["LMG_RCWS", [0]]; apcnoT lockturret [[0,0],true]; this lockturret [[0],true]; apcnoT animate ["HideTurret", 1] Mortar (apcnoTMor) [this, apcnoT] call BIS_fnc_attachToRelative; this removemagazines "8Rnd_82mm_Mo_shells"; this removemagazines "8Rnd_82mm_Mo_Flare_white"; this removeMagazines "8Rnd_82mm_Mo_Smoke_white"; this addmagazine ["8Rnd_82mm_Mo_LG", 8]; this addmagazine ["8Rnd_82mm_Mo_LG", 8]; this addmagazine ["8Rnd_82mm_Mo_LG", 8]; this addmagazine ["8Rnd_82mm_Mo_LG", 8]; this addmagazine ["8Rnd_82mm_Mo_LG", 8]; this addmagazine ["8Rnd_82mm_Mo_LG", 8]; this addmagazine ["8Rnd_82mm_Mo_LG", 8]; this addMagazine ["8Rnd_82mm_Mo_Smoke_white",8]; this addMagazine ["8Rnd_82mm_Mo_Smoke_white",8]; enableWeaponDisassembly false Tarp (apcnoTSurf) // Adds surface to the top of the marshal, otherwise players would be infinitely falling. Location is used to teleport player. [this, apcnoT] call BIS_fnc_attachToRelative Equipment Box [NATO] (spbx1) // Action added to this to resupply mortar [this, apcnoT] call BIS_fnc_attachToRelative Rugged Portable Cabinet Lid (Sand) (NOT_NAMED) // Used as a means to climb up on top of the marshal [this, apcnoT] call BIS_fnc_attachToRelative;[this,["Climb<img size='1' image='\a3\ui_f\data\IGUI\Cfg\Actions\ladderup_ca'/>", {_this select 1 setpos getPos apcnoTSurf;;}, nil, 1, true, true, "", "true", 1.5, false, "", "" ]] remoteExec ["addAction",0]; Rugged IP Telephone (Sand) (apcnoTphone) // Arsenal after activation by helipad [this, apcnoT] call BIS_fnc_attachToRelative Helipad (Invisible) (addPhoneFunc) // Adds Arsenal to phone and resupply action to spbx1 [spbx1,["Resuply Mortar <img size='1' image='\a3\ui_f\data\IGUI\Cfg\Actions\reammo_ca'/>", {apcnoTMor setVehicleAmmo 1}, nil, 1, true, true, "", "true", 2, false, "", "" ]] remoteExec ["addAction",0,true]; [apcnoTphone,["Arsenal <img size='1' image='\a3\ui_f\data\IGUI\Cfg\Actions\ico_on_ca'/>", {["Open", true] spawn BIS_fnc_arsenal}, nil, 1, true, true, "", "true", 1.5, false, "", "" ]] remoteExec ["addAction",0,true]; deletevehicle this Helipad (Invisible) (addSeatFunc) // Adds ability to get into the mortar gunner seat while inside the marshal. This is the problem child of the bunch. [apcnoT,["To Gunner's Seat (Mortar)",{MoveOut (_this select 1);(_this select 1) action ["getingunner", apcnoTMor]}, [], 0, false, false, "", "_this in (crew _target) && (isNull gunner apcnoTMor)"]] remoteExec ["addaction",0,true]; deleteVehicle this Helipad (Invisible) (addSeatFunc2) // Adds ability to get out but on top of the marshal as well as ability to get into the marshal directly while on top of it. [apcnoTSurf,["Get In", {[_this select 1, apcnoT] remoteExec ["moveInCargo", 0];}, nil, 1, true, true, "", "true", 4, false, "", "" ]] remoteExec ["addAction",0,true]; [apcnoT,["Get Out (Topside)",{_this select 1 setpos getPos apcnoTSurf;}, [], 0, false, false, "", "_this in (crew _target)"]] remoteExec ["addaction",0,true]; deleteVehicle this I apologize for my archaic coding format as I'm used to the very old ways of scripting in the original Operation Flashpoint. I hope that extra eyes can slim down the coding or maybe combine it all into one composition that wont automatically kick me when placed. Thanks in advance.
  7. The actual position of the trigger is returned not the position of the unit that activated the trigger.
  8. I'm beyond rusty when it comes to scripting and mission editing; it has been close to a decade since I messed around with things. My problem is this: I'm trying to put into a trigger "on activation" field a simple script that fires two mortar rounds at a detected unit. The trigger is activated by BLUFOR detected by OPFOR and in the script on activation is simply: _BeatenZone = [(getpos _this select 0), (getpos _this select 1), (getpos _this select 2)]; Mortar1 doArtilleryFire [_BeatenZone, "8Rnd_82mm_Mo_shells", 2] In the process of debugging I added hints to walk through where the code is going off the rails and at the below script it returns "Any, Any, Any": hint format ["triggered %1", _BeatenZone] which means the old way of doing thins is just that, old and outdated. What is the new way that works?