Jump to content

_Mofo_

Member
  • Content Count

    59
  • Joined

  • Last visited

  • Medals

Everything posted by _Mofo_

  1. Not sure how you structured your files... but is the init.sqf loaded behind an "isDedicated" or "!isDedicated" of some sort? Also, I briefly recoded your function from the first page in my previous response as *thought* it had a few places with potential flaws in it. One other thing... do you have "-showScriptErrors" as a startup param and do you get any errors at all? Sorry to question so much... but we are flying kinda blind here and it's already hard enough trying to debug and especially when it's shots in the dark. But I do know that SHK_pos works on dedi as I've used it in MP missions and it seems to work as intended.
  2. Just curiosity here... how are you loading SHK_pos? --- private["_exclude_1","_exclude_2","_marker_center"]; // Cache your vars that won't change but are being will be referenced multiple times _exclude_1 = getMarkerPos "exclude_1"; _exclude_2 = getMarkerPos "exclude_2"; _marker_center = getMarkerPos "center"; { _checking = false; while {!_checking} do { _pos = [_marker_center, random 10000, random 359, false, [1, 5000]] call SHK_pos; if ((_pos distance _exclude_1 > 1500) && (_pos distance _exclude_2 > 500)) then { _checking = true}; }; }; _x setPos _pos; //DEBUG MARKERS _name = str(_x) + str(random 100); _marker = createMarker [_name, (getPos _x)]; _marker setMarkerShape "ICON"; _marker setMarkerType "DOT"; } forEach _array;
  3. Sounds like this "may" be a wasteland type mission. If so, look for "config.sqf" and the arrays contained therein. You need to look through the files the comprise the mission (w/e the mission is) and search out the variables that hold the information you want to edit to your liking. Just a tip.
  4. My home test server is working again... not sure if all is well in the world???
  5. If you want to give this a test... I found some information in another thread about adding an option to the startup parameters that "might" help... but I don't have anyone to test ATM and I'm at work. In TA2DST on the "Server Details" tab, put this in the "Parameters" line OTHERPARAMS='-ip=XX.XXX.XXX.XXX' replacing the X's with your WAN ip. Please let us know if it works. If no one has reported back by the time I get home this evening, I'll test it to verify. Reference post -------------- Edit... No need for a fix... users connected with & without the posted "fix". Seems things are back to normal? The world may never know.....
  6. Where did you hear this and is there a fix for it? I am having the exact same problem since today testing a mission I'm working on. I can connect... no one else can. Was working perfectly yesterday.
  7. I'm still learning FSM's myself, but I'm grasping them more and more as time passes. Main things to understand about FSM & debugging... writing "in" the FSM then executing the code makes it somewhat difficult to track bugs AND you can only "ctrl + z" back one time. /:| What I "typically" do when writing a block of code to execute is attach cheat engine to OA and set it up so that I can execute my test script... then write code (in a sqf) and execute it in game to more or less have a working live debugger. Once the code is good... then it goes to the appropriate place in the FSM.
  8. See above edit... The weapons your trying to add are for a different type of vehicle. I don't believe it's going to work the way you're thinking it will.
  9. when you say "menu"... what do you mean? Sorry... bad code... last part should be addWeaponCargoGlobal not addweapon Try this... // Create the vehicle _AN21 = createVehicle ["An2_1_TK_CIV_EP1", position player, [], 0, "NONE"]; // Clear it's cargo clearMagazineCargoGlobal _AN21; clearWeaponCargoGlobal _AN21; // Add the mags _AN21 addMagazineCargoGlobal ["2000Rnd_23mm_AZP85",4]; _AN21 addMagazineCargoGlobal ["12Rnd_Vikhr_KA50",1]; _AN21 addmagazineCargoGlobal ["60Rnd_CMFlareMagazine",1]; // Add the weapons _AN21 addWeaponCargoGlobal ["CMFlareLauncher",1]; _AN21 addWeaponCargoGlobal ["VikhrLauncher",1]; Also forgot another useful thing for you to use... Add "-showscripterrors" to your link properties. ;) ----------- Edit... on a side note... are you trying to do some sort of MadMax type thing with the biplane?
  10. Might I also suggest learning more about arrays as well as loops. It will help you TONS with repeating commands. You will also want to bookmark the bwiki to learn more about the functions and how to use them. https://community.bistudio.com/wiki/Main_Page // Create the vehicle _AN21 = createVehicle ["An2_1_TK_CIV_EP1", position player, [], 0, "NONE"]; // Clear it's cargo clearMagazineCargoGlobal _AN21; clearWeaponCargoGlobal _AN21; // Add the mags _AN21 addMagazineCargoGlobal ["2000Rnd_23mm_AZP85",4]; _AN21 addMagazineCargoGlobal ["12Rnd_Vikhr_KA50",1]; _AN21 addmagazineCargoGlobal ["60Rnd_CMFlareMagazine",1]; // Add the weapons _AN21 addweapon ["CMFlareLauncher",1]; _AN21 addWeapon ["VikhrLauncher",1]; P.s... I've only been coding for about 1 month. n00b to n00b. ;) P.s.s. This code keeps AN21 "local" to the script. I'm not sure why you wanted it global but if its for testing purposes... no need to make it global.
  11. _car = createVehicle [_cartype,_pos,[], _rad,"None"]; clearMagazineCargoGlobal _car; clearWeaponCargoGlobal _car; _car addMagazineCargoGlobal [_mag,(random 4)]; _car addWeaponCargoGlobal [_weapon,1]; It helps to see your code if we are to help with your specific case. In this example, I've left my variable names in there so you get the idea of where stuff goes. *Mine is MP... hence the Global
  12. FSM would work nicely for you here. Set a timestamp in your init code.. then in your condition check that { current time >= (60 minutes + timestamp) } Execute your FSM last in your server init.sqf
  13. Hey all- Have found this script while searching for a way to remove duplicates from an array and I'm not quite sure how to call / use this. 1. Is this part of the functions module? 2. If not 1, then how does one include this file? (compile?) (Source) http://code.google.com/p/arma2-sqf-library-communitys-shared-scripts/source/browse/trunk/css/lib/arrays.sqf?spec=svn1fabcfbda6efc7527aa02e9f29b533ab4f053918&r=1fabcfbda6efc7527aa02e9f29b533ab4f053918 (Download) http://code.google.com/p/arma2-sqf-library-communitys-shared-scripts/downloads/detail?name=SQF-Library%20Community%60s%20Shared%20Scripts%20%28revision%2024105a186b4c46aedb46a90666dd7867b022c47b%29.7z&can=2&q= ---- Everything I've tried (execVM, compile {crashes the game}, simply leaving it out all together) throws the same "Error: mission ;" on the invoking line; Note* this is is only a test array... the array I will use this on is a nested array with chords in which I'll check if the chords are already within the array. I.e. array = [[x,y,z],[x,y,z]];
  14. Guess I shouldn't stay on the page editing as I go so I can see replys. ;-) Thank you again for your help with this... I'm sure it will be VERY useful for the community to have this function.
  15. I won't be using nil in the array at all... give me a few mins to process this new information and try again to implement it. BTW... your brain must hurt every night if this is the sort of stuff you think about during the day. ;) Also... they "must" match "in order" according to position within the nest? So that... [1,2,3] vs. [1,3,2] = false (not matched) This code takes care of that correct? for "_i" from 0 to (count _arrayA - 1) do { _elemA = _objectA select _i; _elemB = _objectB select _i; //Process recursively if (not ([_elemA, _elemB] call FancyIsEqual)) exitWith {_result = false;}; }; ---------- Further testing... FancyIsEqual = { private ["_objectA","_objectB","_result","_elemB","_elemB"]; _objectA = _this select 0; _objectB = _this select 1; //Do they have the same type? if (typeName _objectA != typeName _objectB) exitWith {false}; //Are they values? if (typeName _objectA != typeName []) exitWith {_objectA == _objectB}; //It must be arrays. Do they have same length? if (count _objectA != count _objectB) exitWith {false}; //Process each element; assume true _result = true; for "_i" from 0 to (count _objectA - 1) do { _elemA = _objectA select _i; _elemB = _objectB select _i; //Process recursively if (not ([_elemA, _elemB] call FancyIsEqual)) exitWith {_result = false;}; }; _result }; RemoveDuplicates = { private ["_array", "_unduplicated", "_original","_exists"]; _array = _this; _unduplicated = []; { _original = _x; _exists = false; { if (not ([_original, _x] call FancyIsEqual)) exitWith { _exists = true; }; } forEach _unduplicated; if (not _exists) then { _unduplicated set [count _unduplicated, _original]; }; } forEach _array; _unduplicated }; This code now outputs the array with MATCHING elements. Also, I changed one error in the code to what I believed it should be. // Setup test array _test = [[1,2,3],[1,2,3],[4,5,6]]; // call remove duplicates _some = _test call RemoveDuplicates; RETURNS: [ [1,2,3], [1,2,3] ] for "_i" from 0 to (count _arrayA - 1) do { should actually be... back to further debugging I go to try and trace the problem. ----------- Final edit (for now)... changing this line if (not ([_original, _x] call FancyIsEqual)) exitWith { to... if ([_original, _x] call FancyIsEqual) exitWith { Works for the first test... going to stress test it now to see what breaks it. ---------------------------------------------- Working code to remove duplicate entries in arrays by MuzzleFlash: FancyIsEqual = { private ["_objectA","_objectB","_result","_elemB","_elemB"]; _objectA = _this select 0; _objectB = _this select 1; //Do they have the same type? if (typeName _objectA != typeName _objectB) exitWith {false}; //Are they values? if (typeName _objectA != typeName []) exitWith {_objectA == _objectB}; //It must be arrays. Do they have same length? if (count _objectA != count _objectB) exitWith {false}; //Process each element; assume true _result = true; for "_i" from 0 to (count _objectA - 1) do { _elemA = _objectA select _i; _elemB = _objectB select _i; //Process recursively if (not ([_elemA, _elemB] call FancyIsEqual)) exitWith {_result = false;}; }; _result }; RemoveDuplicates = { private ["_array", "_unduplicated", "_original","_exists"]; _array = _this; _unduplicated = []; { _original = _x; _exists = false; { if ([_original, _x] call FancyIsEqual) exitWith { _exists = true; }; } forEach _unduplicated; if (not _exists) then { _unduplicated set [count _unduplicated, _original]; }; } forEach _array; _unduplicated }; // Test arrays used _test = [[1,2,3],[1,2,3],[4,5,6],[7,8,9],[1,2,3],["a","b","c"],[4,5,6],["a","b","c"],[132.2,123.4,532.6],[132.2,123.4,532.6]]; _test = [1,1,2,2,"a","a","c","c",2.1,2.1]; // Used to output results _unDupe = []; _unDupe = _test call RemoveDuplicates; hint format["%1",_unDupe]; ------ Thank you MuzzleFlash for your efforts!!
  16. Thank you for the time and I'll be more than happy to check for errors while testing and correct as needed. I really do appreciate it your time!!! Will report back shortly. ------ Also, in trying to understand your logic and the way you are checking the arrays... when you say... "For array they are if they have the same length and same content:"... I'm assuming you mean that the entirety of the content must be the same... correct? I.e. _a1 = [[1,2,3],[2,3,4],[1,2,3]]; the Unduped array would be built using the entirely of the nested array content and not just the individual elements themselves _unDupe = [[1,2,3],[2,3,4]]; Sorry to question... but I'm really struggling to wrap my head around checking nested arrays for dupes. ------ First test: FancyIsEqual = { private ["_objectA","_objectB","_result","_elemB","_elemB"]; _objectA = _this select 0; _objectB = _this select 1; //Do they have the same type? if (typeName _objectA != typeName _objectB) exitWith {false}; //Are they values? if (typeName _objectA != typeName []) exitWith {_objectA == _objectB}; //It must be arrays. Do they have same length? if (count _objectA != count _objectB) exitWith {false}; //Process each element; assume true _result = true; for "_i" from 0 to (count _arrayA - 1) do { _elemA = _objectA select _i; _elemB = _objectB select _i; //Process recursively if (not ([_elemA, _elemB] call FancyIsEqual)) exitWith {_result = false;}; }; _result }; RemoveDuplicates = { private ["_array", "_unduplicated", "_original"]; _array = _this; _unduplicated = []; { _original = _x; { if (not ([_original, _x] call FancyIsEqual)) exitWith { _unduplicated set [count _unduplicated, _original]; }; } forEach _unduplicated; } forEach _array; hint format["%1",_unduplicated]; // hinting out the array after all runs }; // Setup test array _test = [[1,2,3],[1,2,3],[4,5,6]]; // call remove duplicates _test call RemoveDuplicates; This returns a blank array in the hint. Wouldn't the check fail on every run since "_unduplicated" will return "any" or "nil" for the first run? Since the array is empty to begin with... if (typeName _objectA != typeName _objectB) exitWith {false}; Would always return false? Maybe count _unduplicated array and if 0 store the first value no matter what since the array is empty?
  17. Ahhhhhhhh......... no truer words spoken.
  18. Hello... I know this must a be a n00b question but I cannot find the right way to phrase this question in the search on google or here on the forums to give me the right answer back. I'm modifying a mission and I'd like to remove all information that shows up on the crosshairs when you scroll the mouse wheel. (mainly the down pointing hand) In Day Z it's called nametags but I can't find any related information for Arma only. I've set the mission to veteran when starting the server and it rids the scroll range finding... but the hand still shows up. Any help or direction would be appreciated... thanks.
  19. Thanks guys... I understand now I believe. I'm using TA2DST to run a dedi on my own box for testing and I need to set the mission to use expert settings then manually configure the cfg file to turn on the things I still want. Got it. Thanks again!
  20. Yes.. I was thinking more along the lines of MP style use where the chances of having random players join is much higher. Not exactly sure how dialogs affect the controls of the player etc... but a small dialog up at the top out of the way could be used if it doesn't hinder the players ability to control their character. I'd have it default to forgive, after say 20 seconds like you said, so that the player actually has to punish the teamkiller manually before added time would be calculated or applied. It's a really cool idea man.. I can see the uses for this script... especially for missions like Taki Life or Wasteland or similar missions.
  21. Ahh... I had a feeling you'd say something like that. No worries... easy solution. Dialog on spawn of the team killed person saying "punish / forgive". Problem solved. (see wasteland for an example) ;-) The idea is "anti" team kill... if a player is griefing other players... your script is an EXCELLENT way to punish the player in a means that allows them to serve time to resolve the issue with an elevating time interval as the deterrent and persistence to apply the punishment for griefing regardless of leaving the server. However... it is your script and I'm only thinking of ways that it could be used to improve gameplay. Appreciate the response.
  22. Cool script Suicidal! Just reading through your topic to see the progression and had a thought that may be worth messing with at some further point... Persistence. Maybe at some point you can tie your script into a database and put a timestamp for a player in the database along with their UID that way if they disconnect (any method) then if they come back.. it reapplies the prior jail time. Structure could be like: UID TimeToServe TimeServed NumberOfTeamKills That way you can calculate how much time they severed before disconnecting and also the number of times they teamkill which could be used in conjunction with a multiplier. I.e. First Team Kill: 5 Mins Second: 5*2 Mins Third: 5*3 Mins Etc... I think this suggestion is more geared towards MP rather than SP though. P.s.... The comment about your friend / tester not enjoying not to be able to do anything in jail.... that's kinda the point... it's not supposed to be fun. ;-)
  23. (bold) Is this 20 questions? Are we playing a game show? Do I get a prize at the end of this? (underline) Sounds like you need to get out of the house more often as well as your base. Zing? Profit? ---------- Point being... you've yet to see the plane... but it DOES randomly spawn at downed chopper missions with a LOW chance of it being there.
  24. _Mofo_

    Arma2:Co Conquest Mode [Preview]

    Looks awesome Iceman77!! Congrats on the mode. BF2 ate up so much of my time years ago... It's about time something similar came to ArmA. If you need a tester sometime... shoot me a PM and I'll try to give you a hand. (Testing on an empty map just blows, and as Clinton said.. "I feel your pain")
  25. Maybe get out of your base more? I've got less time than you and I've seen the Harrier on 3 occasions...Yes... I'm sure about it. I stumbled across it and killed the npc's to take the jet the third time and I've seen it flying the other 2 times.
×