Jump to content

All Activity

This stream auto-updates     

  1. Past hour
  2. Today
  3. Yesterday
  4. Thank you! I can't believe I made such a silly mistake. It works like a charm now!
  5. FIXED: I fixed it guys. If anyone wants to use this script for whatever purpose to gather all groups of factions and place them under each seperate category. Here it is:
  6. CMDR Echo3

    Chat GPT tried to script

    Wow! Thankyou so much doing this. I can't wait to test it later. I will let you know how I get on.
  7. Reptilia ROF-90 Micro This project was originally started so that I can push myself to learn a new workflow and this Reptilia mount is the first mesh I've created in that workflow. I'm very happy with the first result of this new workflow. Hopefully, the results will only improve from here.
  8. All you need to do is exactly as I posted. So, create the file "onPlayerRespawn.sqf" in your mission's root folder, and paste that code snippet in it.
  9. Sanya

    Russia General

  10. Livonia Ambience is a config based environmental soundset replacement modification adding the environment soundsets from Livonia to various and suitable Arma 3 terrains. Features include: Environmental soundscape from Livonia. Ambient Birds - Adds crows, kestrels, eagles to the ambient system. Autumn Leaves - Wind affected leaves, grasses and pollen. (Note to mission makers, this mod doesn't create a dependency)
  11. Reapy

    Arma3 Videos

  12. jonpas

    Theseus Services

    Theseus Services has been updated to version 1.25.1!
  13. Thank you for replying unfortunately I only understood about half of your reply. Am I able to put the code in a different file or edit it to work for a dedicated server or a combination of changes to make it work or is it just not possible? Again, thank you for taking the time to reply.
  14. soldierXXXX

    Chat GPT tried to script

    So i just finished the code you wanted. Triggers can work with CollectedItems variable. Variable is number that is tracking how many intel you handed over. To see how many items you handed over you can write: hint format ["Items i have handed over:%1",CollectedItems]; Condition in trigger might be something like this example if you have collected 13 and more items. CollectedItems > 12; The script is run from action that i demonstratively attached to player. I´ve added classic scroll menu action and hold action. Choose one you like more and delete the other one. Only change in the original code is that local variable _intelItems was changed to global variable intelItems. Why ? Because now you need to access information about array of items in more than one script (or scope to be precise). Global variables are just better for changing information on single place. I´ve also added notification, but delete it if you want. Put this whole code to init.sqf and it will work (or elsewhere if you want). This is solution for singleplayer. For multiplayer it must be done differently. You can change parameters to your liking. I´ve commented most of them. If you have questions, i´m happy to answer them. 🙂
  15. leader _x should work, as createMarker will take an object as position.
  16. _x is a group, createmarker expects a position or an object.
  17. class CfgPatches { class MyAddon { units[] = {}; weapons[] = {}; requiredVersion = 1.0; requiredAddons[] = {}; }; }; class CfgFunctions { class MyAddon { tag = "TAG"; class Category { file = "MyAddon\functions"; class someScript { postInit = 1; }; }; }; }; Where the script file is named fn_someScript.sqf. postInit = 1 makes it autorun at mission post init. It would also compile it as a function called TAG_fnc_someScript, so change TAG and file path as needed.
  18. CMDR Echo3

    Chat GPT tried to script

    Your a legend! the day when AI replaces us all is a long way off LOL
  19. soldierXXXX

    Chat GPT tried to script

    Yeah that code won't work because, as I'm reading what AI wrote, there might be two situations. 1) player might have full inventory and thus can't add any item so it will just return 0. 2) player might be able to add item to inventory and the script will get stucked in while loop and since it's run in unscheduled environment it should stop around 10000 iterations and you don't want that. Pretty sure it would freeze arma if not whole PC 😄 If by any chance code worked it would have to repeat this process for x times depending on array length. However this is not what you desire. You want something much simpler and optimized. I will write the code for you when I'll return home. Basically the logic would be: Global variable of items given;//this will be good for triggers implementation Function: Count items that are relevant; Add this number to global variable; Remove all relevant items from player's inventory Currently I'm still at work, so I'll do it as soon as I'm available 😉
  20. Hey guys, with the latest KAT Update, the vanilla Medical Tent is now a medical facility. I would like to give my players the Option to build the medical Tent via Fortify Tool. I know how to add the tent to the List, but the problem ist, the modell of the tent has its doors closed. There are options in Eden to hide the Doors but how could i possibly make that happen via the fortify tool. Or would there be another way? As always, I have not the slightest idea how to get to work on this problem, so any kinda help would be appreciated. Cheers, Jan
  21. CMDR Echo3

    Chat GPT tried to script

    This is my convo with Chat GPT and the AI's effort at creating a script that removes all intel items and keeps count. I haven't tested it yet but thanks for pointing me in the right direction. the AI tends to make up code and syntax so it normally means i have to kind of reverse engineer what it's trying to do and fix the syntax errors. For a noob it's great for simple scripting and story ideas etc PROMPT: This is the script i use to gather intel in my arma 3 mission: private _intelItems = ["MobilePhone","SmartPhone","FlashDisk","Wallet_ID"]; /* This function will add random item to unit, if the unit has space in inventory for it. How to use the function: [ unit,//<unit> to which item should be added [],//<array of strings> array of items that function should add (this array can´t be empty) 0,//<scalar> number that will be randomized. (default:10) 0//<scalar> number that should be always lower than number randomized. The lower the number is the higher is the chance that unit will have the item generated. If number is 0 every unit will have random item selected (default:0) ] spawn soldierXXXX_fnc_randomItem; Example:[player,["FirstAidKit"],10,1] spawn soldierXXXX_fnc_randomItem; */ soldierXXXX_fnc_randomItem = { scriptName "RandomItem"; params ["_unit","_itemsArray",["_RandomNumber",10],["_RandomNumberLow",3]]; private _addIntel = round random _RandomNumber; if (_addIntel < _RandomNumberLow) exitWith {}; private _randomItem = selectRandom _itemsArray; if (_unit canAdd _randomItem) then { _unit addItem _randomItem; }; }; { [_x,_intelItems,10,6] spawn soldierXXXX_fnc_randomItem; } forEach units opfor; Can you create a script that removes all required items from my inventory and keeps count of how many I have handed in ANSWER: Sure, I can provide a script for that. This script will go through your inventory and count and remove all items listed in _intelItems /* This function will remove and count certain items from a unit's inventory. How to use the function: [ unit, //<unit> whose inventory will be checked array //<array of strings> array of items that function should remove and count ] call soldierXXXX_fnc_removeAndCount; Example: [player, ["MobilePhone","SmartPhone","FlashDisk","Wallet_ID"]] call soldierXXXX_fnc_removeAndCount; */ soldierXXXX_fnc_removeAndCount = { scriptName "RemoveAndCount"; params ["_unit", "_itemsArray"]; private _itemCount = 0; { if (_unit canAdd _x) then { while {_unit canAdd _x} do { _unit removeItem _x; _itemCount = _itemCount + 1; }; }; } forEach _itemsArray; _itemCount }; /* To use the function and display the count of items removed, you can use: */ private _count = [player, ["MobilePhone","SmartPhone","FlashDisk","Wallet_ID"]] call soldierXXXX_fnc_removeAndCount; hint format ["You have handed in %1 items.", _count]; This function will remove all instances of the items in the _itemsArray from the inventory of the _unit and count how many items have been removed in total. The count is then returned by the function. The last part of the script calls the function with the player as the unit and displays a hint with the total count of items removed.
  22. CMDR Echo3

    Chat GPT tried to script

    Ha, I think it probably did! Anything before Sept 2021 and Chat GPT has probably read it lol I've found that GPT uses and tries to adapt lots of content found in this forum especially GPT 4 that has Bing internet search integrated. I will just be using it in single player. Thanks in advance for the speedy reply
  23. Maybe this has already been discussed somewhere, but I couldn't find it, so I apologise in advance for possibly repeating a question that has already been asked here before. If there is a forum thread where it has already been discussed, send me the url. I created a .pbo file, which connected as an addon to the arma. With this, I figured it out. In general, I want my script runs every time I start any mission in arma3. I have config.cpp and the script itself with script.sqf file in the same folder. The sqf so far uses the hint call script just to check its auto-run. I've already tried everything and nothing happens after starting the mission or starting the game in the editor. My cpp file contains this but didnt work: class CfgPatches { class MyAddon { units[] = {}; weapons[] = {}; requiredVersion = 1.0; requiredAddons[] = {}; class Extended_InitPost_EventHandlers { class MyAddon { init = "call compile preprocessFileLineNumbers 'script.sqf';"; }; }; }; }; What's the best practice for this now?
  24. Normal. There is no player on dedicated server. Use the code @Harzach wrote for onPlayerRespawn.sqf you can add in your mission root folder, or use the missionEventHandler "entityRespawned" If I'm right, onPlayerRespawn.sqf will fire locally (player's PC). missionEventHandler "entityRespawned" is also LE (local effect). So, even if you place it in init.sqf, only the respawned player's PC will run the code, even if the MEH is present on all PCs. That means a little difference. You can have respawning AIs (when AIs are playable but not played). onPlayerRespawn.sqf will not fire for these AIs, but MEH will.
  1. Load more activity