Jump to content

kylania

Member
  • Content Count

    9181
  • Joined

  • Last visited

  • Medals

  • Medals

Everything posted by kylania

  1. Ahh, so he just needs to run his function and not remoteExec anything. :)
  2. _this select 3 select 0; That leads me to believe you're running this from an addAction, which will never be run as a server since only clients can activate it so you never run your code. You'll need to use remoteExec to trigger the spawn on the server or some kind of variable based thing. This appears to work. Had a gameLogic named myBase sync'd to two helipads. Used this to call it. Got 4 guys (usually 3 on one pad 1 on the other) this addAction["Spawn", "spawnStuff.sqf",[myBase, 3]]; params["_object", "_caller", "_id", "_args"]; _args params["_obj_base", "_count"]; _spawnUnits = ["O_Soldier_F"]; _skill = [0.1, 0.15, 0.25]; _ammo_count = [0.0, 0.1]; _max_distance = 2; _max_azimuth = 360; for "_x" from 0 to _count do { _spawnRadius = random _max_distance; _spawnAzimuth = random _max_azimuth; _spawnObj = selectRandom synchronizedObjects _obj_base; _randomPos = _spawnObj getPos [_spawnRadius, _spawnAzimuth]; _curElem = selectRandom _spawnUnits; //Run BIS_fnc_spawnGroup on the server only. [_randomPos, EAST, _spawnUnits, [], [], _skill, _ammo_count, [], random 360] remoteExec ["BIS_fnc_spawnGroup", 2]; };
  3. You are using remoteExec wrong. // Runs: [_user, _uid] call extDB_Disconnect; only on the server. [_user, _uid] remoteExec ["extDB_Disconnect", 2]; // Runs: [_uid] call extDB_Disconnect; only where _unit is local (ie, nowhere since it's disconnected) [_uid] remoteExec ["extDB_Disconnect", _unit];
  4. kylania

    force music in mission

    Should probably leave it up to the player if music helps them enjoy the mission or not. Play the music, but let the player turn it off if they prefer. What sounds great to you might not be great for others.
  5. Here's a really quick demo showing how to set up the Functions library and how not to use init.sqf/initServer.sqf functions for what you're trying to do. There are three functions in the demo, all with the same code. fnc_removeLauncher_InitServer declared in initServer.sqf, fnc_removeLauncher declared in init.sqf and tp_fnc_removeLauncher declared via the Functions library. The PMCL AT Rifleman on the left is using the fnc_removeLauncher_InitServer function from it's init field to remove it's launcher. Clearly this didn't work. :) Same for the AA Missile Specialist in the middle. His function was declared in the init.sqf. Only the AT Missile Specialist on the left lost his launcher because the function called from his init field was declared in CfgFunctions. This also shows how to have a preInit file with multiple common functions instead of a file per function. We disable stamina from initPlayerLocal.sqf using a common function to allow you to run around with 15 explosive charges in your backpack. Also we declare a function to allow you to steal a loadout from other units via addAction. This is a bit more verbose then it needs to be, but helps keep things organized. To get the Functions Library going: description.ext: class CfgFunctions { #include "functions\cfgFunctions.hpp" }; functions\cfgFunctions.hpp: class TargetPracticeFunctions { tag = "tp"; // Functions tag. Functions will be called as [] call tp_fnc_chooseMission class coreFunctions { // Since these are called from a file they'll be called by their names in the file, ie, fnc_tp_disableStamina class coreFunctions {file = "functions\coreFunctions.sqf"; description = "core functions, called on mission start."; preInit = 1;}; }; class functions { file = "functions"; // Folder where individual function files are stored. class removeLauncher {}; // File name is functions\fn_removeLauncher.sqf }; }; functions\coreFunctions.sqf: // Disable Stamina tp_fnc_core_disableStamina = { params ["_unit"]; _unit enableStamina false; }; // Copy gear from a unit tp_fnc_core_copyGear = { params["_object", "_caller", "_id", "_args", "_copyFrom","_loadout"]; _copyFrom = cursorTarget; if (!(_copyFrom isKindOf "Man")) exitWith {}; _loadout = getUnitLoadout _copyFrom; _caller setUnitLoadout _loadout; hint format["You copied %1's gear.", name _copyFrom]; }; (Disable stamina is called from initPlayerLocal.sqf while the copy gear function is called from an addAction in the player's init field.) functions\fn_removeLauncher.sqf: params["_unit"]; _weapon = secondaryWeapon _unit; _unit removeWeapon _weapon; So removeLauncher was called via: [_this] call tp_fnc_removeLauncher; and stamina disable was called via: [_this] call tp_fnc_core_disableStamina; To add more functions you'd just add a new line to your cfgFunctions.cfg and a new functions\fn_stuffInventoryWithPistolMags.sqf file. class stuffInventoryWithPistolMags {}; // File name is functions\fn_stuffInventoryWithPistolMags.sqf Thanks to a tip from Larrow I've refactored this to match his suggestion.
  6. kylania

    Date/Timestamp in mission.

    Rip had PM'd me about an intro and I thought of polpox's script find here, so combined several intro tricks and came up with this: /* Author: kylania Description: Fade in from black intro, with a quote and Arma 3 style SitRep Date/Time/Mission credits. Run via execVM from playerInitLocal.sqf Parameter(s): 0: STRING - Name of the mission. SemiBold font under date during sitrep typing effect. Default: "An Arma 3 mission" 1: STRING - Author of the mission. Displayed under the mission name in medium font. Use a " " for nothing. Default: "by a Community Author" 2: STRING - Version of the mission. Displayed under the mission author in a medium font. Use a " " for nothing. Default: "Version 1.0" 3: STRING - Quote for center screen display on black screen. Default: "Not so long ago, not so far away...\n\n-A quote" 4: NUMBER - Duration of quote display. Default: 9 Returns: Nothing. Examples: ["Jungle Trek", "By Rip", "Version 1", '"A cat is a lion in a jungle of small bushes."\n\n-Indian proverb'] execVM "missionIntro.sqf"; ["A Mission", " ", " ", "", 0] execVM "missionIntro.sqf"; */ // Start with a silent black screen. titleCut ["", "BLACK FADED", 999]; 0 fadeSound 0; // Spawn text effects. _this spawn { params[ ["_missionName", "An Arma 3 mission"], ["_missionAuthor", "by a Community Author"], ["_missionVersion", "Version 1.0"], ["_quote", "Not so long ago, not so far away...\n\n-A quote"], ["_duration", 9] ]; // Starting quote as volume fades in. titleText [_quote,"PLAIN"]; titleFadeOut _duration; _duration fadeSound 1; sleep (_duration - 2); // New "sitrep style" text in bottom right corner, typed out over time. [ [_missionName,"font = 'PuristaSemiBold'"], ["","<br/>"], [_missionAuthor,"font = 'PuristaMedium'"], ["","<br/>"], [_missionVersion,"font = 'PuristaLight'"] ] execVM "\a3\missions_f_bootcamp\Campaign\Functions\GUI\fn_SITREP.sqf"; // Fade from black, to blur, to clear as text types. sleep 3; "dynamicBlur" ppEffectEnable true; "dynamicBlur" ppEffectAdjust [6]; "dynamicBlur" ppEffectCommit 0; "dynamicBlur" ppEffectAdjust [0.0]; "dynamicBlur" ppEffectCommit 5; titleCut ["", "BLACK IN", 5]; };
  7. kylania

    findEmptyPosition

    You could always just spawn anywhere and clear away what was there first.
  8. What's the format for extdb_disconnect? You're trying to run this where _unit is local? extDB_Disconnect _uid; // or _uid extDB_Disconnect Can't find any docs about extDB sql commands, so.. not sure.
  9. kylania

    Forum Errors

    Bunch of these errors on seemingly random threads. Also new users are posting 3-4 duplicate threads at once.
  10. Why wait for respawning? Change the players loadout randomly throughout the mission!
  11. kylania

    findEmptyPosition

    Might just not be a lot of room maybe? Here's using your code in a random seemingly open location and there was almost no available spots. Using [3,6] I got no results at all. In this picture Red is [1,6], Orange is [2,6] and Blue is [3,10]:
  12. There's also the virtual artillery modules you can setup using the Combat Support system. Those will spawn in arty pieces when needed to fire.
  13. opfor_mortar_dude doArtilleryFire [position alpha_1, "8Rnd_82mm_Mo_shells", 3]; The first parameter is an Array, such as a position. In the demo it was [3000, 120, 1000]. The command position returns an array so you just had an extra [ ] in there. You should have seen a black background script error talking about 3 arguments expected, received 1?
  14. I suspect it's the "APD Dispatch: %UNIT_NAME" part. I'm guessing it only accepts the values found in the wiki for radioChannelSetCallSign. Try taking out the "APD Dispatch: " part so it's just: apdDispatchChannel = radioChannelCreate [[0.117, 0.564, 1, 1], "APD Dispatch", "%UNIT_NAME", [p1]]; Assuming you have a unit named p1. Adjust the final array to match the variable names for your players. If you want a custom callSign, investigate the $key feature of the radioChannelSetCallSign command perhaps?
  15. kylania

    Date/Timestamp in mission.

    The one from polpox does it automatically. I found some others, but they had too many parameters to deal with at 2am. The sitrep.sqf one though looks really nice and easy to use. You can even customize it more. It's locked to Altis/Stratis though. I'll try to see if it's been updated for Tanoa.
  16. For multiplayer it would have to be run on the server, yes. So maybe put it in initServer.sqf?
  17. kylania

    CfgFunctions not working

    That's utterly bizarre! At least it's working now. :)
  18. kylania

    CfgFunctions not working

    Odd. I was testing on Dev Branch, were you using Stable perhaps?
  19. wiki/radioChannelCreate Can you post what you have so far?
  20. That was Drowning Pool's best song ever!
  21. kylania

    Revive Feedback

    Does it work if you select Revive Enabled and Spectator on Death in the editor and then have a trigger looking for all players dead and having that run ["end1", false] call BIS_fnc_endMission? There's no reason you can't use scripting as well as Eden features. It would be a "nice-to-have" but I'm sure you can get exactly what you want with scripting.
  22. kylania

    CfgFunctions not working

    You're not answering my question. Please read and understand this post and post the contents of your fn_loadoutMenu.sqf file here for us. Reinstalling Arma will do nothing. I believe you haven't properly formatted the function file and when you run ui_fnc_loadoutMenu all it's doing is then loading your declared fnc_ui_loadoutMenu function, which is why there's no errors since it's doing what you told it to do just not what you expect. That's also why it's "working" when you run it from init.sqf.
  23. kylania

    CfgFunctions not working

    Can you post the contents of your ui\functions\fn_loadoutmenu.sqf please? I just set things up exactly how you have it and it's working from the debug console for me. (I fixed my mistake with the tag above, so you've got that right already)
  24. kylania

    Error when loading the scenario

    Ctrl-O (O as in Old) from the Select Map dialog will open up the 2D editor in Dev Build and Apex RC Build.
  25. kylania

    CfgFunctions not working

    Do you have a file called fn_loadoutMenu.sqf in your ui\functions folder? That file would just be this: hint "You're running the loadoutMenu"; and not this: fnc_ui_loadoutMenu = { hint "You're running the loadoutMenu"; }; Also, your tag in this case would be "ui": [] call ui_fnc_loadoutMenu;
×