Jump to content

ZaellixA

Member
  • Content Count

    115
  • Joined

  • Last visited

  • Medals

Community Reputation

105 Excellent

2 Followers

About ZaellixA

  • Rank
    Sergeant

Contact Methods

  • Skype
    zaellixa
  • Biography
    Born in Ioannina, Greece. Grew up all around Greece and now still trying to settle somewhere. Sound engineering pays for most of my expenses.
  • Steam url id
    zaellixa
  • Linkedin
    achilleskappis
  • Reddit
    ZaellixA

Profile Information

  • Gender
    Male
  • Location
    Greece
  • Interests
    Acoustics, Digital Signal Processing, ArmA 3, Programming, Research, Computational Acoustics, Wave-Fields, Reproduction

Recent Profile Visitors

299 profile views
  1. ZaellixA

    Restrain mouse movement

    Thanks, is quite nice to now that I don't have to spend time on that 🙂
  2. ZaellixA

    Restrain mouse movement

    Yeah, as I said in the initial post I have already used this command to do exactly that. In the previous post I was just saying that I cannot think of a good way to use the commands wogz187 suggested to get the weapon direction. So far I haven't managed to do something with any commands I have found... It seems to me that there are no scripting commands to constrain the move of the mouse inside a specific "polygon". Or to be more exact I haven't found any way to restrain the mouse movement at all (except when in the map getMousePosition and setMousePosition). I have come to believe that this is not possible through ArmA scripting. Please let me know if you have any other idea that could prove me wrong. Thanks all for the information. Best, Achilles.
  3. ZaellixA

    Restrain mouse movement

    Hhhhmmm, interesting approach... Can't really think of a way to use cursorTarget and/or cursorObject to get the direction the weapon is pointing relative to the unit. If you have something specific in mind I would be more than glad to head about :). Now regarding the disableUserInput, I don't think this is what I am looking for, as I am looking for a way to restrain the mouse and not letting it move outside a specific boundary (looking for a restrain on the horizontal axis but ending up restraining the mouse in a box wouldn't hurt too much). disableUserInput actually renders the player unable to use anything, which is not what I am looking for. I would really like to get something like setMousePosition which will work while NOT in the map (which is how setMousePosition works).
  4. Hey all, I am trying to find a way to restrain the movement of the mouse. The aim is to restrain the movement of the weapon to lie inside the aiming deadzone so that the player won't be able to steer the unit with the mouse. So far I have used vectorDir, weaponDirection and some vector manipulation commands in order to find what the angle between the facing-direction of the unit is and the direction the weapon is facing. Seems to work OK (unless I am missing something), but regardless of the functionality of this part of the script I can't find any way to restrain the mouse movement. If you have any idea (or a source to point me to) please let me know. Thanks in advance, Achilles.
  5. Yep, wogz187's script seems about right, or you could actually do it the other way around (depending on the structure of your other scripts and calls)..., that is instead of deleting red2 at random, create red2 at random, with pretty much the same effect.
  6. Care to share the way you made it work for future reference to people who may face the same issue?
  7. ZaellixA

    Random Teleport Script

    Hey there Sneax x, (a warm welcome from my side too). GEORGE FLOROS GR's script does exactly that. I will brake it down to all the commands with explanation comments for you. private _markersArray = ["marker_1", "marker_2", "marker_3"]; // You place the names of the markers you want to use in the array. It is assumed that you have already created and named the markers (either in editor or with script commands) private _randomMarker = selectRandom _markersArray; // Select one of the markers randomly private _pos = getMarkerPos _randomMarker; // Get the position of the randomly selected marker _caller setPosASL _pos; // Teleport the caller (assume you have access to him) to the position of the randomly selected marker GEORGE FLOROS GR used some marker names that contain the word respawn (also used for respawning) but this does not mean they cannot be used for your purpose too. Just change the names and place names that are convenient for you (also..., make sure you have created the markers somehow). Hope this clarifies a bit the script. Please don't hesitate to ask for more info if you need to.
  8. Hey GEORGE FLOROS GR, to be honest I did read this and after some testing (was trying to find a way to help here) I realized that this is NOT a solution. I also tried with setHit, setDamage (which I am not sure makes sense but tried it anyway) and setHitPointDamage and none made the job...!!! I am not sure why this is happening as, to my understanding, at least the setHit and setHitPointDamage should do the job (the HandleDamage event handler provides enough to be able to use them). I do hope someone will shed some light here as, despite the fact that I am not directly interested in the solution, I am indeed intrigued by the fact that those commands "do not work" (forgive the abuse of phrase here).
  9. Hey there M1ke_SK, one way I could think you can do it is to set the items you remove to a predetermined value and then run another loop that will delete them (after you have iterated once through the array to add items to your unit). This could look like this (quoting your code) private _items = ["Titan_AT", "Titan_AT", "Titan_AA", "NLAW_F", "RPG7_F", "RPG32_HE_F", "RPG32_F"]; { systemChat format["_item: %1 | _items: %2", _x, _items]; if(player canAdd _x) then { player addItem _x; _items set[_forEachIndex, -1]; // Set the value equal to -1 }; } forEach _items; // Loop again through the array to delete the items you removed private _index = 0; // Initialize an index while{_index < (count _items)} do { // Check if the item at the index position is -1 if((_items select _index) isEqualTo -1) then { _items deleteAt _index; // If it is... delete it and do NOT increment the index } else { _index = _index + 1; // Otherwise just go to the next position }; }; systemChat str _items; I have only tested this in Single Player and worked OK. I did not test extensively but it worked just fine for all the tests I ran. In general the "trick" here is to NOT increment the index when you delete (because the next element will move down to your current position). So, no matter what way you will choose, one way will be to take care of the index increments. Please let us know if this works for you or if you require something different.
  10. ZaellixA

    Simple script shows error

    I would strongly suggest you should follow GEORGE FLOROS GR's advice and use an event handler. One minor note I would add is to use "Reloaded" event handler which is, most probably, triggered less often, which could prove to give a minor (or even close to zero) efficiency improvement. Apart from the different event handler and the different parameters passed I believe the code is exactly the same. Just for reference I will reproduce GEORGE FLOROS GR's code with those small changes. { if!(isplayer _x) then { _x addEventHandler["Reloaded", { // CHANGED EVENT HANDLER FROM FIRED TO RELOADED params["_unit", "_weapon", "_muzzle", "_newMagazine", "_oldMagazine"]; // CHANGED THE PARAMETERS if({_x isEqualTo _magazine} count magazines _unit < 2) then { _unit addMagazines [_oldMagazine, 3]; // CHANGED THE VARIABLE HOLDING THE MAGAZINE (TYPE)... HERE YOU COULD ALSO USE _NEWMAGAZINE systemchat "addMagazines"; }; }]; }; }foreach units group player; One minor thing here is the case in which the previous magazine and the new one is different... For example, if the old magazine is replace by a tracer magazine. There will be a difference as to what magazines will be added to the unit if you use _newMagazine against _oldMagazine. Now, regarding your marker script..... I believe you are doing a couple of things that might be wrong... I will try to use your script as base to work on your logic and make it both easier for you to understand and adapt your code. // I WILL CALL THIS SCRIPT markerFollower.sqf _unit = _this select 0; _text = _this select 1; _randomnumber = random 100 + random 100; _nameMarker = "Markername" + (str _randomnumber); _debug = true; // NOT SURE WHAT THIS IS FOR, SO I WILL JUST LEAVE IT AS IT IS... createMarker [_nameMarker, getPosVisual _unit]; _nameMarker setMarkerType "hd_dot"; _nameMarker setMarkerColor "ColorBlue"; if (_text == 1) then { _nameMarker setMarkerText "Repair truck"; }; if (_text == 2) then { _nameMarker setMarkerText "Fuel truck"; }; if (_text == 3) then { _nameMarker setMarkerText "Ammo truck"; }; // UP TO THIS POINT YOU HAVE CREATED AND PLACED A MARKER (SO THAT'S JUST FINE) // NOW WHAT YOU WANT IS TO MOVE THE MARKER AS LONG AS THE UNIT IS ALIVE, SO YOU SHOULD IMPLEMENT IT AS STRAIGHT FORWARD AS YOU CAN while {alive _unit} do { // Take care to use DO instead of THEN on while-loops _nameMarker setMarkerPos (getPosVisual _unit); // Set the position of the marker sleep 5; // Set a delay to save some CPU }; // NOW THE NEXT PART WILL BE EXECUTED WHEN THE UNIT CEASES TO BE ALIVE.... 8|. SO THIS IS THE PLACE TO CHANGE THE NAME OF THE MARKER if (_text == 1) then { _nameMarker setMarkerText "Repair truck is destroyed"; }; if (_text == 2) then { _nameMarker setMarkerText "Fuel truck is destroyed"; }; if (_text == 3) then { _nameMarker setMarkerText "Ammo truck is destroyed"; }; // Here you can add an event handler that will be triggered when the unit respawns _unit addEventHandler["Respawn", { private _respawnUnit = _this select 0; // Get the unit that is respawned... This is the same as the "_unit" you have above _respawnUnit removeEventHandler _thisEventHandler; // Remove the current event handler (a new one will be added two lines below...!!!) deleteMarker _nameMarker; // Delete the marker (the one named "Some Kind Of Truck Destroyed") [_respawnUnit, _text] execVM "markerFollower.sqf"; // Now run the current script }]; Now, some things to note. First and foremost THIS IS NOT TESTED... Additionally, this is definitely not the best way to do it, but having to work on your implementation and looking for a quick solution, this is what I came up with... Hopefully someone else will come up with a better one (for example without the need to constantly remove and add an event handler). I hope this helped somehow... If there's any gray fields please don't hesitate to ask.
  11. One thing to note though (for people looking here in the future) is that mission event handlers are client side. So, in order to make the presented solution quite generic, a good place for it is in the initPlayerLocal.sqf. This way it will be executed for each joining player (just you in the single player case).
  12. ZaellixA

    Can't save a .sqf file

    Well, sorry if I caused any confusion. I just used nil because I thought that the idea was to not assign the script handler. Didn't really mean to imply that nil is a variable. Because, as you also said, there is no (functional) difference between nul and null I thought that nil was meant right from the start. Thanks for the clarification though and hope this didn't cause any confusion... 😐
  13. ZaellixA

    Can't save a .sqf file

    Well, first of all, if you place nil = execVM "rem.sqf"; in the player's init field you don't need init.sqf. Secondly, I am almost 100% (close to 99.9% to be more exact 😋... Check the wiki) sure that it should be nil instead of nul. Finally, if your rem.sqf is NOT in the mission folder you should specify a relative path like // Assuming that rem.sqf is in a subfolder named "TestingForumsSuggestions" inside the mission's folder nil = execVM "Scripts/TestingForumsSuggestions/rem.sqf"; // Execute the script Also, there is a version/syntax of execVM that needs no arguments, so you can omitt the brackets (wiki link). Hope this solves the problem 🤞.
  14. Hello arma_max and welcome to the forums. Regarding your question... In general you can put units in the same group with the join command. If you have named the units then this would be as simple as private _hq = createSide WEST; // Create a side, which is needed to create a group -> ONLY IN THE CASE YOU HAVEN'T CREATED ONE IN THE EDITOR private _firstBattalion = createGroup [WEST, true]; // Create a group for the BLUFOR and set to be deleted when emptied -> IN CASE YOU DON'T HAVE A GROUP TO USE ALREADY [unitOne, unitTwo, unitThree] join _firstBattalion; // This will assign the units in the array to the _firstBattalion group This shows how to add three units to a group (after creating it). Similarly you could add as many units as you want. This is a "not-so-good" implementation as you have to hardcode all the units one-by-one. In a better implementation you would "proceduraly" find the units and add them to the array which will be as argument to the join command. For the last step it would be beneficial to agree to a name for all the units you wish to include (such as battalion_1_unit_X, where X is a number just to differentiate the units that will join the first battalion). Now for the part of assigning waypoints... You can use the addWaypoint command. This will add a waypoint to a group. A simple example would be _firstBattalion addWaypoint[[2508.64, 5681.47, 0.0356369], 50]; // Add a waypoint to the first battalion at a specific (random in this case... taken from a page of the wiki) position with a radius 50 metres (the waypoint will be chosen randomly in the circle with center the position and radius the specified radius) Hope this helps a bit as a starting point. If there's anything more you would like help with, please don't hesitate to ask.
  15. Hello there Wilson543210, I'll be honest to say that I have no experience with either Epoch or DayZ at all. Furthermore, I am not sure I completely understand what you intend to do and what exactly you seek to achieve with your script. Maybe if you could be a bit more specific (or I just misunderstood something 😐) or give us some code example (or even pseudocode). As for the question (as presented in the topic title) you could possibly add an action or ACE interaction which will call an attachTo command to the object you want to fortify (or attach things to). This could possibly look something like (using addAction here because I don't remember exactly how to set up an ACE interaction, but the idea is the same) /* * - _objectToAttachThingsTo is the object you want to attach things to. You should somehow add the action to it, like in the init field on the editor. * - _thingToAttachToObject is what you want to attach to the _objectToAttachThingsTo. You should also somehow get the hold of it in a variable. */ // Add the action _objectToAttachThingsTo addAction["Attach", { private _objectToAttachTo = _this select 0; // Get the object you want to attach things to private _thingToAttach = _this select 2; // Get the thing to attach -> Passed as an argument after the current script snippet _thingToAttach attachTo[_objectToAttachTo]; // This will use automatic offset -> i.e. will place the object at the relative position between the two objects }, _thingToAttachToObject]; // Other arguments could be specified to the addAction but are omitted here I know this is very generic and maybe not so useful to you but I am not sure how experienced you are with ArmA scripting and what exactly you want to achieve and have already implemented. Please let us know if this is of any help or you would need something extra (or completely different to that).
×