Jump to content

Basicology Major

Member
  • Content Count

    4
  • Joined

  • Last visited

  • Medals

Community Reputation

1 Neutral

About Basicology Major

  • Rank
    Rookie
  1. 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"];
  2. 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.
  3. Would you mind supplying me with a User action (scroll menu) example to properly access and display via hint? I've made my attempts but it kind of just returns (null) every time and I just don't have much examples I can go off of to read and print variables into hints.
  4. I am pretty new to doing any sort of SQF/init scripting that isnt just frankensteining code together so I would appreciate any help! Simply put, I want to make a fun little roleplay mission where for that mission, a phrase comprised of multiple randomly selected arrays is generated. The Indfor act as captives that are all assigned ONE word from the phrase at random to keep secret. (This is where multiple arrays work better since you can just call the arrays by "word1", "word2", "word3". (I intend to have 4 words, 1 array for each.) And ontop of that I want the entire code phrase to be displayed in its entirety to the Blufor. For this to work, the result of the generation needs to only be prompted once and then have. TLDR: Server generates a code phrase from several arrays. I cant figure out the init code and they usually return as null no matter what I attempt. And to be exact, I dont want people to generate a phrase/array results every time they call; I simply want it generated, stored, and have players access the results. I dont know how efficiently this could be done whatsoever outside of theory crafting nonsensical code. If there is a better alternative please help me out. Please help, Working backwards I am trying to: I inserted the code into initServer.sqf for simplicity; Can execute it as a script later on? Or is a dedicated SQF necessary? This code is almost certainly full of wrong or incorrect syntax/formatting. This is just an outliner of what I am trying. If my method is wrong then please help me goal wise. 2. Have a way to display either a SINGLE result of that array on individual units, preferably just adding a action into their init boxes to get the array/codephrase. I want 2 UserActions I can insert into unit inits; One that displays the codephrase, and one that displays a single array's result- as hints.
×