Search the Community
Showing results for tags 'scripthelp'.
Found 2 results
-
This script is a bit of a doozie and I generally wanted it to be handled within all one SQF... Or at least thats what I thought I could do. But my issue is with every attempt at (albeit randomly) changing scopes/globals I always get 'error undefined variable in _' and to be quite I have no idea what I am doing outside of looking at several examples of several things, then attempting to combine them. So I have a scenario involving 4 groups, in a traitor-survival permadeath like scenario. Campers, killers, hunters, and guards. I wanted to an add action script on a Bell to ring that, in this order: Institutes a 30 second COOLDOWN for the addaction. Initiates a titleText BLACK FADED screen when activated, that pauses then shows text like "12 hours later" Hidden by that screen I wish to teleport players to certain markers And skips time 12 hours, more pause BLACK IN titleCut when then the teleportation has happened and they see a different time of day upon lifting Script/Addaction resets/loops Technicalities: Script must be repeatable for my purpose I want a UNIT VARIABLE NAME array, 1 for each pre mentioned group that is NOT SIDE dependent. All units are on Indfor. And a TELEPORTATION MARKER array, and code inserted to the teleportation bits so that once activated, for example, all campers will randomlytravel to one of the several CAMPER markers. This allows for rounds to not be the exact thing. CODE MUST NOT BE SIDE DEPENDENT. Ive clearly tried to make 3 arrays, one for each 'type', the reason why all units are Indfor is for smooth 'roleplay' purposes What Works: I believe the time passage works. The black screen fade in/out/text works. The teleportation does NOT WORK. I am screwing up with scopes/globals in accessing the array's Ive set up... Genuinely would like some help but have no idea how to proceed forward and I thank anyone in advance bellInteraction.sqf // Define the unit and marker arrays outside the function to avoid redefining them every time the script runs. campers = ["cpr1", "cpr2", "cpr3", "cpr4", "cpr5", "cpr6", "cpr7", "cpr8", "cpr9"]; campMarkers = ["campMarker1", "campMarker2", "campMarker3"]; scouts = ["sct1", "sct2", "sct3"]; scoutsMarkers = ["scoutMarker1", "scoutMarker2", "scoutMarker3"]; hunters = ["htr1", "htr2", "htr3"]; huntersMarkers = ["hunterMarker1", "hunterMarker2", "hunterMarker3"]; guards = ["grd1", "grd2", "grd3"]; guardsMarkers = ["guardMarker1", "guardMarker2", "guardMarker3"]; // Teleport function _teleportPlayers = { params ["_unitArray", "_markerArray"]; { private _unit = missionNamespace getVariable _x; if (!isNull _unit) then { private _randomMarker = selectRandom _markerArray; _unit setPos (getMarkerPos _randomMarker); }; } forEach _unitArray; }; // The main script that will be executed when the bell is rung _bellScript = { params ["_target", "_caller", "_id"]; // Check for cooldown if (!isNil {bellCooldown}) exitWith { _caller sideChat "The bell is on cooldown. Please wait."; }; // Set cooldown bellCooldown = true; _target removeAction _id; // Screen fade out to black titleText ["", "BLACK FADED", 1]; sleep 5; titleText ["<t color='#ffffff' size='5'>12 hours later...</t>", "BLACK FADED", -1, true, true]; sleep 2; // Skip 12 hours skipTime 12; // Teleport each group [campers, campMarkers] call _teleportPlayers; [scouts, scoutsMarkers] call _teleportPlayers; [hunters, huntersMarkers] call _teleportPlayers; [guards, guardsMarkers] call _teleportPlayers; // Screen fade in from black titleCut ["", "BLACK IN", 5]; // Reset cooldown after 10 minutes (600 seconds) sleep 600; bellCooldown = nil; // Re-add the action to the bell _target addAction ["Ring Bell", _bellScript]; }; // Execute the script with the provided parameters params ["_bell"]; _bell addAction ["Ring Bell", _bellScript]; The Bell Init Code: bell addAction ["Ring Bell", "mscripts\bellInteraction.sqf"];
- 1 reply
-
- 1
-
- scripthelp
- coding
- (and 9 more)
-
Script Help: Markers On Objects For One Side
Basicology Major posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
So currently I have not found many ways with my small knowledge of SQF/arma natives or finding anyway online thats been demonstrated- But I'd like assistance in creating a script. Currently I am using SOG Prairie Fire Exectutor/Random Site modules to place caches that are all removeable via addAction for a search and destroy type mission- With each cache being randomly spawned via module. All of this works and I wish to to map markers to said caches that do spawn, as the Random Site module chooses several different locations. I would like only for (in this instance EAST or OPFOR) to have markers on said objects that are the caches. What method could I use for this? A snippet in initPlayerLocal? Can someone help create a mockup of what that would be? Id like: Markers to be visible for OPFOR only in mission MOST methods for one side markers Ive seen show ALL the markers in the briefing regardless Dont know how to actualize this. In initPlayerLocal? In seperate SQF script? Have them tied to editor placed objects. In this case, the object name/type in the screenshot: Multiple objects that are names cache_(letter)(number) ex. cache_a1 Any help is appreciated. I dont really know where to start code wise.-
- script
- scripthelp
-
(and 6 more)
Tagged with: