Jump to content

Dj Rolnik

Member
  • Content Count

    143
  • Joined

  • Last visited

  • Medals

Community Reputation

29 Excellent

About Dj Rolnik

  • Rank
    Sergeant

Profile Information

  • Location
    Poland

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Yep, that's working great! Thank you very much @Gunter Severloh ❤️
  2. 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!
  3. 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!
  4. 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!)
  5. 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! ❤️
  6. 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.
  7. 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;
  8. 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 🙂
  9. 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!
  10. 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!
  11. 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 ">.>
  12. // 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.
  13. 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.
×