-
Content Count
147 -
Joined
-
Last visited
-
Medals
Everything posted by MKD3
-
Done it hundreds of times. But to each their own.
-
Variable names failing in multiplayer
MKD3 replied to diehardfc's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Having done this sort of thing on a bigger scale, here's what I would use to temporarily debug players moving about. It'll tell you each time someone clicks the button, who it was, and where they're heading. Also try moveInAny as it allows the player to be put in any open seat. //Add this to function to init.sqf or just execute it locally using debug fn_diagnosis = { //params sent by player when button clicked params [_name, _targetvehicle]; //Exit if not you, comment this out if you wish it to be seen on all clients if !(getplayerUID player == "YOUR UID HERE") exitWith {false}; //You'll see this each time someone has a go at teleporting systemChat (format ["%1 has attempted teleporting to %2",_name,_targetVehicle]); }; //Add this to code when player clicks button to teleport. [(name player), _targetVehicle] remoteExec ["fn_Diagnosis", allPlayers]; -
Tried _plane enablesimulation false?
-
Need help with script for MP server (Resolved)
MKD3 replied to IGD Big Steve's topic in ARMA 3 - MISSION EDITING & SCRIPTING
You would be better off creating a function that gets called by your event handler. The best way to do it is using getPlayerUID. Here is an example of how I might do this. Written on a laptop, unsure if this works or has errors. fn_playerKilled = { params ["_killed","_killer","_instigator"]; //Exit if not players involved if !((isPlayer _killed) OR (isPlayer _killer)) exitwith {}; //Exit if on same side if (side _killed == side _killer) exitiwith {}; //You cannot give individual players points here as this is now serverside, you must make a variable per player _playerVariable = format ["%1_points", getPlayerUID _killer]; //retrieve current points private _points = missionNamespace getvariable "_playerVariable"; //Throw error if points are set before game start. if (isNil _points) exitwith {"Problem, no points set"}; _updatePoints = _points + 500; //Set points missionNamespace setvariable ["playerVariable",_points]; }; //Eventhandler addMissionEventHandler ["EntityKilled", {_this call fn_playerKilled}]; //Set everyones points to 0 on mission start { private _playerVariable = format ["%1_points", getPlayerUID _x]; missionNamespace setVariable [_playerVariable, 0]; } foreach allPlayers; -
Need help with script for MP server (Resolved)
MKD3 replied to IGD Big Steve's topic in ARMA 3 - MISSION EDITING & SCRIPTING
This is a locality issue. The biggest sign is it not working on a dedicated server but working locally. What is the difference you ask? Player is not assigned on a dedicated server, but is assigned locally. You must have a variable instead of the player command, and assign it a unit object instead. if ( _owner isEqualTo (side player)) then { pointsPlayer = pointsPlayer + 1000; .... Needs to be _unit = blueTeamGuy1 or (code to find specific player unit); if ( _owner isEqualTo (side _unit)) then { pointsPlayer = pointsPlayer + 1000; .... -
Chat Showing multiple times
MKD3 replied to JohnKalo's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Exactly Also I hope you're using a text editor such as notepad++, you could easily go replace and change ["sideChat", 0] into ["fn_displayChat", allplayers] for all of the instances in about 10 seconds. -
Chat Showing multiple times
MKD3 replied to JohnKalo's topic in ARMA 3 - MISSION EDITING & SCRIPTING
You just learned a good lesson about coding in general, if you've written it more than once make it a function. Here's a slightly less crappy way to make life easier. //Set globally, maybe in init.sqf //Now any changes can be quickly adjusted once, here. fn_displayChat = { _speaker = _this select 0; _text = _this select 1; _speaker sideChat _text; }; [BL, "I done goofed"] remoteExec ["fn_displayChat", allPlayers]; sleep 5; [BL, "this isnt tested"] remoteExec ["fn_displayChat", allPlayers]; sleep 2; -
Players start in heli, JiP-Players in Base (complex situation)
MKD3 replied to Purzel's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Id suggest learning a bit about locality in Arma for what this and player mean, especially in MP. Here is a little basic template you might want to give a try to get you heading the right direction. Create a file called initplayerLocal.sqf in your mission file, this will automatically execute on all clients on missions start. -
@gc8 Attach the camera to the helicopter, set the cameras target as the pilot or a unit within the helicopter. I accept donations and gifts.
-
Maybe @HazJ needs to relax a little. When a person doesnt understand the way arma functions and events happen, I wouldnt expect them to understand what a switch block or event a basic eventhandler do. Im pretty experienced with Arma but I wouldn't have got through this sort of thing without help from an actual programmer and hours of reading and asking seemingly stupid questions. Good luck @sbondo1234 EDIT: Not saying that hazJ hasnt been helpful, just saying a patience is a virtue
-
This code is client side so using this (setObjectTextureGlobal) will cause the texture to be set globally, this isn't that useful for init.sqf which executes globally anyway, but doesn't hurt anyone. As for your problem, my thoughts are that a good way to find your answer is in your question: Code works, however not in init.sqf. This means it is probably an initialisation order problem. Meaning this code is running before your units exist. Try this to test that. sleep 10; { _x setObjectTextureGlobal [0, "images\red.paa"]; } forEach (allUnits select {side _x == WEST});
-
Need solution for Saving and loading of container content between multiple editable Zeus missions
MKD3 replied to barto300's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Player loadouts can be saved via : https://community.bistudio.com/wiki/getUnitLoadout & https://community.bistudio.com/wiki/SetUnitLoadout Container contents are another thing. If youre not fussed about saving things inside containers... inside containers, then you can do it quite easily. If that matters to you, its a mess. There is 1000 examples of saving box contents on this platform so Ill leave that to you. To make it persistent you will want to save it to profilenamespace to be recalled later. -
Adding a weapon with attachments to a box
MKD3 replied to wyattwic's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Only two things i can think of would be 1. Arma or 2. Locality of the AI. Leaning more towards 1, have you tried running a loop such as.. while {(currentWeapon _unit != "")} do {sleep 1; //put in box again}; Just to see if its just the AI ignoring you? -
Spawning boats spread out along shoreline
MKD3 replied to cklymowsky's topic in ARMA 3 - MISSION EDITING & SCRIPTING
I had a bit of a play around from curiosity. Here's is a basic, find water position function I came up with. Not exactly what you want, but you might be able to use some of whats in it. //Number of positions private _boatCount = 10; //Settings private _minRange = 200; private _maxRange = 600; private _centrePos = getpos player; private _waterPosArray = []; //Generate Array for "_i" from 1 to _boatCount do { private _distance = floor random _maxRange; private _waterPos = [_centrePos, _minRange, _distance, 3, 2, 20, 0] call BIS_fnc_findSafePos; //Check if position is above water if (!(_waterPos isFlatEmpty [-1, -1, -1, -1, 2, false] isEqualTo [])) then { //Boat, not submarine _waterpos set [2, 0.5]; _waterPosArray pushback _waterpos; }; }; _waterPosArray; This is the sort of results I was getting, X being the centre and squares being the points. If it cant find anything, it returns an empty array. Good luck! -
Door Keypad [SCRIPT] Request
MKD3 replied to WarhammerActual's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Thats a big red pill -
Using Splendid Camera position as intro-camera?
MKD3 replied to mcnools's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Haven't done it in a long time due to just using an in house debug camera but there you go. -
Using Splendid Camera position as intro-camera?
MKD3 replied to mcnools's topic in ARMA 3 - MISSION EDITING & SCRIPTING
["fata",[6868.35,6964.27,1.80142],59.3982,0.47,[11.9879,0],0,0,408.146,0.173823,0,1,0,1] Bold text is the position. _c = "camera" camcreate [0,0,0]; _c cameraeffect ["internal", "back"]; _c camPrepareTarget [3780.09,2385.09,1.36698]; _c camPreparePos [3812,2384.91,0.326341]; _c camPrepareFOV 0.700; _c camCommitPrepared 0; sleep 5; player cameraEffect ["terminate","back"]; camDestroy _c; This is a very simple example. For static shots in intros, I use 10cm spheres in 3DEN, make them invisible, and call them eg. I_POS_1, I_TAR_1. Then use _c camPrepareTarget getpos I_TAR_1; _c camPreparePos I_POS_1; _c camPrepareFOV 0.300; _c camCommitPrepared 0; Is there better ways than this? Probably. -
Door Keypad [SCRIPT] Request
MKD3 replied to WarhammerActual's topic in ARMA 3 - MISSION EDITING & SCRIPTING
What youre asking isn't a small job. Thats probably why there isn't any responses. -
breaking a loop from outside
MKD3 replied to JohnHSmith's topic in ARMA 3 - MISSION EDITING & SCRIPTING
The variable stopNow is global and accessible from all scripts on the client -
Adding a weapon with attachments to a box
MKD3 replied to wyattwic's topic in ARMA 3 - MISSION EDITING & SCRIPTING
I have written functions to do this before. Ill just say, this is a painful thing to do. These functions will only work together. I don't know if these are the optimal way to make it work, but this is what I had to do, and from memory there is one or two edge case bugs. Maybe you can improve on this. -
Randomly generated minefield module
MKD3 replied to Sliver's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Define randomly? To my knowledge, you just place a minefield module, adjust your settings and bam. A minefield. Otherwise you could easily generate a script to make one. -
Not sure what causes this but its bad juju to use inits on a dedicated server. The code is called every time a client joins. Good if you like being put back into a car everytime someone drops out and returns.
-
There is also bis_fnc_dynamicText
-
Return player object from server
MKD3 replied to Midnighters's topic in ARMA 3 - MISSION EDITING & SCRIPTING
No, player is local to the client. You have to select them just like any other object. -
How to create a mission in which ai isn't...not smart?
MKD3 replied to jakers12's topic in ARMA 3 - MISSION EDITING & SCRIPTING
No but it can fake it. VCOM is probably the preferable option.