Jump to content

Dj Rolnik

Member
  • Content Count

    143
  • Joined

  • Last visited

  • Medals

Everything posted by Dj Rolnik

  1. Hey, It's probably simple but I cannot find a simple solution for it. I would like to teleport individual AI that enter a trigger into a predefined spot (by coordinates). Thanks in advance!
  2. Hello, I am looking for a solution to an issue which troubles me greatly - AI going prone on contact. I guess all of us have experienced it before and know that once the AI changes combat mode, it instantly goes to the ground which is not always realistic, nor is it good for the players. I have searched for a solution for some time now and most of the solutions suggested forcing AI to one specific stance, either by Zeus or by setUnitPos. Unfortunately, none of the solutions considered allowing the AI to either STAND or KNEEL, which is what I'm hoping for. Maybe there is a way to add an eventhandler of some sort which could override the PRONE stance with KNEEL, if possible. Otherwise, maybe it could just disable prone itself, leaving kneel and stand for the AI to choose normally. I did find a semi-solution to this, which is using trigger areas and modules, which force the stance change of the AI within a trigger to whatever I set, however that's a) fixed to one stance, and b) always in zones that have been predefined by me, not dynamic in any way. I lack enough experience to write something like this on my own, but I do feel like forbidding AIs PRONE stance only is possible - I just don't know exactly how to do it. Will be grateful for any help! Adam
  3. Yep, that's working great! Thank you very much @Gunter Severloh ❤️
  4. Hey guys, I am using the Zeus-placed countdown timer that displays during my TvT games. As it stands now, once the time set in the module reaches 0, the mission ends with the selected criteria. What I would like to do instead is trigger a script instead of ending the mission right away. So far I was unable to find a way to launch this countdown timer via script, especially so without the mission ending at the countdown end. Any idea how I could use the exact timer functionality, but without ending the mission right away? Thanks!
  5. Hey guys, I am currently working on a mission that would feature some kind of a "command center" (for the lack of better description...) which would have a few screens. Those screens have been set up to receive a texture captured from a camera attached to a uav (to be precise, the Pelter drone from the new Contact DLC). I have used a script kindly provided by @killzone_kid which I have only adjusted for the other drone type and basically looks like this - this is repeated for 12 screens in the init.sqf: laptop1 setObjectTexture [0, "#(argb,512,512,1)r2t(uavrtt1,1)"]; cam1 = "camera" camCreate [0,0,0]; cam1 cameraEffect ["Internal", "Back", "uavrtt1"]; cam1 attachTo [pelter1, [0,0,0], "PiP1_demining_pos"]; addMissionEventHandler ["Draw3D", { _dir = (pelter1 selectionPosition "PiP1_demining_pos") vectorFromTo (pelter1 selectionPosition "PiP1_demining_dir"); cam1 setVectorDirAndUp [ _dir, _dir vectorCrossProduct [-(_dir select 1), _dir select 0, 0] ]; }]; The UAV feeds are being thrown on the screen in sequence one by one. This is how it looks in a test environment with 12 machines - you can see that the last four laptops turn black and show no feed. When I deleted the part of the script responsible for the first laptop, the 9th one worked fine so again - no more than 8 at once. I have two issues with it: - Obviously, I can display no more than 8 feeds at once - any more than that will appear as black screen - similarly, when opening the uav terminal, the turret control window will also appear black/blank. I do not mean to complain, but do you think this is an engine/performance limitation of some kind and there's no way around it? - Will this effect even be global to other players or only local (I fear the latter)? If local, is there a way to display this kind of effect globally to such a scale in a multiplayer environment? I appreciate all the feedback on this topic. Thanks a lot in advance! Adam
  6. Hey everyone, I am working on a game mode idea that is loosely based on the idea of Dark Zones in The Division games. The game mode would be PvP and would revolve around both Player killing, collecting items and performing various tasks. I would like to create a system that would allow players to extract found items in exchange for points. The idea is that players collect items throughout the game (both by finding them on the map and looting them from other players) and may deposit them in certain "extraction zones" on the map in exchange for "points". Those points would stack up with all the items the players extracted. When the game ends, the points would have to be tallied including both the extracted loot as well as the one still in the players' inventory - the data would have to be pullable for the game summary somehow so that the best player can be chosen as the winner. So... a full list of what I'm going after, exactly: - multiple different loot-items worth a different amount of points - loot-items can be extracted in specific areas of the map one by one, possibly with an action that takes some time to complete - extracted loot-items are converted to points and awarded to the player (or a whole group if several members are working as part of one team). - if the player dies, he loses all of his points and is eliminated but the loot-items in his inventory can be looted by other players - exchanging the earned points OR loot-items for specific game items (ammo, meds, etc.) On a slightly different, but still related note, the game mode will feature a few separate factions, all with different goals during the game. Other players will have different goals and I would also like to reward them with points for stuff like: - collecting players' dog tags - collecting a different category of items found in the game - spending some time inside a specific area (researchers performing researcher things..) I believe those last three should be fairly easy once I have the reward system in place and working, since I can tweak the method I use for granting those points to players later on. How I roughly see it is twofold: - Either I assign variables to each player and adjust those variables according to the aforementioned actions and criteria - I exchange the items players extract for, say, a money item (in that case money would be the points equivalent to summarize the end game) Now the thing is, my scripting knowledge is probably insufficient for this task, so I would be very grateful for any tips or even some useful snippets of code that you guys could share with me. Any pointers and suggestions are highly welcome. Thanks! Adam
  7. Aaaahhh, I knew that there was a better and more optimized way of doing this and Larrow would be the one to show it. Damn you, sqf wizard! (in a positive sense!)
  8. Ok, fixed it myself while I was brainstorming this at work >.<". I was executing the code on the array and at the same time removing items from it, so it executed on one marker, removed one marker, executed on the next marker, removed the next one, and only one was left, so it just executed - this gave me three successful spawns. I simply added a separate array, the exact same as the original marker array but named different and executed the spawning code on each element of THAT NEW array. // Anomaly placement markers anomaly_spawners_main = [ "ra_1", "ra_2", "ra_3", "ra_4", "ra_5" ]; anomaly_spawners = [ "ra_1", "ra_2", "ra_3", "ra_4", "ra_5" ]; // Available anomalies anomalies = [ "anoamly_moduleElectra", // Electra "anoamly_moduleBurner", // Burner "anoamly_moduleFruitPunch", // Fruit Punch "anoamly_moduleMeatgrinder", // Meatgrinder "anoamly_moduleSpringboard" // Springboard ]; // Generating random anomalies losowe_anomalie = createGroup sideLogic; { randomAnomalies = selectRandom anomalies; randomSpawners = selectRandom anomaly_spawners; randomAnomalies createUnit [ (getMarkerPos randomSpawners) getPos [random 15, random 359], // <- THIS! losowe_anomalie, "this setVariable ['BIS_fnc_initModules_disableAutoActivation', false, true];" ]; anomaly_spawners deleteAt (anomaly_spawners find randomSpawners) } forEach anomaly_spawners_main; Now I just need to randomize the radius from the marker. I actually did that just as you suggested @_foley. Took me like a minute. That was satisfying! Thanks! ❤️
  9. Yeah, sorry, let me clear it up a bit. I want each marker to spawn one of the five anomalies. There will probably a few dozens of those markers but for all of them I want to have only one anomaly, randomly selected from the array of five. I mean "anomaly module" because they are in fact modules in the editor, not an object, so I cannot use createVehicle.
  10. Hey y'all, It's been a while since I've posted. I have been chugging along with the project, and mananged to get it pretty close to what I have in mind. I am currently struggling with randomizing some stuff spawning. What I want to do is: 1. Spawn a random anomaly module on a randomly selected marker 2. Have the anomaly spawn in a certain random vicinity from the marker (say +/- 15m, not on its exact position) I have done something like this before but I am mingling some things and cannot get it fully to work this time. What I have is the below, and when I run it, it only spawns in THREE anomalies instead of FIVE, and they always spawn on the exact position of the marker. I am pretty certain that the fact only three are spawning is due to the order in which code is being run, but the random placement, I have not yet been able to figure out. Thanks for your help in advance! // Anomaly placement markers anomaly_spawners = [ "ra_1", "ra_2", "ra_3", "ra_4", "ra_5" ]; // Available Anomalies anomalies = [ "anoamly_moduleElectra", // Electra "anoamly_moduleBurner", // Burner "anoamly_moduleFruitPunch", // Fruit Punch "anoamly_moduleMeatgrinder", // Meatgrinder "anoamly_moduleSpringboard" // Springboard ]; // Generating random anomalies losowe_anomalie = createGroup sideLogic; { randomAnomalies = selectRandom anomalies; randomSpawners = selectRandom anomaly_spawners; randomAnomalies createUnit [ getMarkerPos randomSpawners, losowe_anomalie, "this setVariable ['BIS_fnc_initModules_disableAutoActivation', false, true];" ]; anomaly_spawners deleteAt (anomaly_spawners find randomSpawners) } forEach anomaly_spawners;
  11. No, I get it now. I got a bit confused and forgot about the fact that the _randSel starts as empty and mixed up both arrays, my bad! I think I got it now, it sure is clever. Thank you Larrow 🙂
  12. Yes, both work just fine, thank you gentlemen! Didn't think it would be so simple. I am having some trouble figuring out what the heck happened though and I'd like to understand. So what I get is that the bracketed part deletes an element of the _mercTargets array selected randomly by the latter part of the bracket. The pushBack is confusing to me, but what I get is it pushes the removed item to the back of the array (?). That is then done 9 times so I understand that in the end the array still contains the same amount of items, but simply rearranged, so how does it produce just nine items? Thanks!
  13. Yo, Coming back at you with a different topic now. I am looking to convert the results of the following code into an array. I am planning to select nine random items from the below array and from then I will pull those items for other purposes. I found the bottom piece of code done for a similar purposes but it was displaying the results as systemChat messages, while I need an array of results. I tried using the toArray command but to no avail. I also tried using the compile command but no luck as well. Any suggestions on how to approach it? _mercTargets = [ loner_1, loner_2, loner_3, loner_4, loner_5, loner_6, loner_7, loner_8, loner_9, loner_10, loner_11, loner_12, duty_1, duty_2, duty_3, duty_4, bandit_1, bandit_2, bandit_3, bandit_4, sky_1, sky_2, sky_3 ]; for "_i" from 0 to 8 do { if (count _mercTargets == 0) exitWith {}; private _rindex = floor(random (count _mercTargets)); private _randSel = _mercTargets # _rindex; toArray hint str (_randSel); _mercTargets deleteAt _rindex; }; Cheers!
  14. Ok yes, that was it. Gosh I didn't think about bracketing the whole thing, my bad there... I did not fully understand the idea of addition of a variable to itself, you know, the x = x + something. I think I get it now: it simply returns the _itemCount * _itemValue for the corresponding item, then runs it again for all other items in the _presntItems array except the variable _sumScore is already a new value based on the previous calculation so it adds up the new corresponding points value. Thank you for that guys, I really appreciate it. I know I may be a slow learner, but I am really trying ">.>
  15. // Calculate item values _presentItems = _lootValues apply { _itemName = _x; _itemValue = _y; _itemCount = {_x isEqualTo _itemName} count magazineCargo chest1; _itemDisplayName = _lootNames get _x; [_itemName, _itemCount, _itemCount * _itemValue, _itemDisplayName] }; // Filter out missing items _presentItems = _presentItems select {_x select 1 > 0}; _sumScore = 0; _sumScore = {_sumScore + (_x select 2)} forEach _presentItems; Two problems: - It does not sum all the items in the chest, only displays the last item - if there are no items in the chest, it says <null> and says the _sumScore is undefined.
  16. Well, I added the previous line but it was only summing the last item on the list so it was missing something. Adding what you provided spews an error that the _sumScore is undefined and when the chest1 was empty, the hint displayed a scalar NaN string as an error.
  17. Ok, small update is that I managed to grab the total value of items and throw it into the hint Title, but I haven't yet added all the values. So far it only cycles through them (I assume) and then shows the last one. // Filter out missing items _presentItems = _presentItems select {_x select 1 > 0}; _sumScore = {_x select 2} forEach _presentItems; // Prepare hint text _hintLines = _presentItems apply { format ["%1: %2 - %3 RUB", _x select 3, _x select 1, _x select 2]; }; _hintTitle = format ["%1 - %2 RUB", name player, _sumScore]; So yeah, I do not know how to loop that so that I can add all those values together.
  18. Ok well, I spoke too soon. Turns out I am still too much in the dark when it comes to understanding it as I cannot figure out how to do the total value thing. I tried making new sections where I apply new code to the already filtered items and I tried to pull this data out somehow, even trying to change the _hintTitle to the same "apply" structure but apparently I cannot do that in the header of the hint? I am clueless and it hurts my ego to ask for a ready-to-go solution, so I would like to ask for a bit clearer explanation on where the heck I would put this total thing. Just to get on the same page, let me throw in the actual final code without placeholder variables and such, to make it easier to follow. // Display names hashmap _lootNames = createHashMap; _lootNames set ["ARMST_ART_control", "Altered Wheel"]; _lootNames set ["ARMST_ART_black_angel", "Angel"]; // Loot values hashmap _lootValues = createHashMap; _lootValues set ["ARMST_ART_control", 2000]; _lootValues set ["ARMST_ART_black_angel", 1000]; // Calculate item values _presentItems = _lootValues apply { _itemName = _x; _itemValue = _y; _itemCount = {_x isEqualTo _itemName} count magazineCargo chest1; _itemDisplayName = _lootNames get _x; [_itemName, _itemCount, _itemCount * _itemValue, _itemDisplayName] }; // Filter out missing items _presentItems = _presentItems select {_x select 1 > 0}; /*_sumScore = */ // Prepare hint text _hintLines = _presentItems apply { format ["%1: %2 - %3 RUB", _x select 3, _x select 1, _x select 2]; }; _hintTitle = format ["%1 - %2 RUB", name player/*, _sumScore*/]; // Show hint _hintTitle hintC _hintLines; // Hide regular hint at the end hintC_arr_EH = findDisplay 72 displayAddEventHandler ["unload", { 0 = _this spawn { _this select 0 displayRemoveEventHandler ["unload", hintC_arr_EH]; hintSilent ""; }; }]; It all seems to make sense when I read it, but for the love of me, I cannot process this and create it on my own.
  19. Oh God, I swear I almost felt your excitement there 😄 I almost took brain damage while trying to figure this stuff out but it's cool to finally understand something ^^" When I get back home I will try to put it into practie!
  20. If I want to also display a total value of points for all accumulated items, would this be enough? _totalItemsValue = _presentItems * _itemValue Another question: If in the hint I do not want to display class names but rather predefined text strings, can I do this? (writing this form work, cannot test at home!) - Create a separate hashmap with class names and their corresponding display names I want: private _lootNames = createHashMap; _lootNames set ["FirstAidKit", "FAK Test Display Name"]; _lootNames set ["Medikit", "MED Test Display Name"]; then add a variable to the _presentItems array that I could call from the new hashmap? // Calculate item values private _presentItems = _lootValues apply { _itemName = _x; _itemValue = _y; _itemCount = {_x isEqualTo _itemName} count magazineCargo chest2; _itemDisplayName = lootNames get _x; [_itemName, _itemCount, _itemCount * _itemValue, _itemDisplayName] }; and finally refer to it in the hint? // Prepare hint text private _hintLines = _presentItems apply { format ["%1 - %2 Points", _x select 3, _x select 2]; }; private _hintTitle = format ["%1 - %2 Points", name player, _totalItemsValue]; I may have messed something up, I feel...
  21. I think so. So technically I can use the same variable multiple times depending on where and how I call them as long as I maintain the proper structure. I will think about it and try to do some more work in the coming days. Muchas Gracias!
  22. And what does private mean? It's a little confusing to me.
  23. It's not exactly the commands that I have issue with, but the complex structure of ambiguous references. I always had problems with understanding code that was all _x, _y, command names only and everything referenced everything. I will need some time to fully understand the solution you provided >.>.
×