Jump to content

vonlugar

Member
  • Content Count

    4
  • Joined

  • Last visited

  • Medals

Community Reputation

10 Good

About vonlugar

  • Rank
    Rookie

Recent Profile Visitors

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

  1. vonlugar

    Help on Waypaths Script

    awesome explanation though. thanks a bunch.
  2. vonlugar

    Help on Waypaths Script

    so calling _x in here is like a loop? or is it inherit to the group/code being used in the same line? It works, just trying to understand _X some more
  3. vonlugar

    Help on Waypaths Script

    So I was setting the condition to: Opfor. present. in condition field: the list of units that i want to use as the bomber. i did this because I had other opfor around the area and I didn't want them to trigger it during fighting. I'm interested in the last bit pierremgi coded up. I could try selecting a random bomber during the same field as sending them to a waypoint. Rather than trying to find who stepped into the trigger, which is where i think nothing was happening. can you just call a variable you describe without having it be an Arma code? [] spawn{ private _targetedPlayer = selectRandom _candidates; _targetedPlayer; }; ***UPDATE*** So i moved the array to the same field as finding the player. And it does work. No landing trigger zone for the opfor anymore. I had to setup an array of allPlayers in the trigger area, selectRandom from that array, then doMove to that. [] spawn{ _green = [slime_gr_1, slime_gr_2, slime_gr_3, slime_gr_4, slime_gr_5, slime_gr_6, slime_gr_7, slime_gr_8, slime_gr_9, slime_gr_10, slime_gr_11, slime_gr_12, slime_gr_13, slime_gr_14, slime_gr_15, slime_gr_16, slime_gr_17, slime_gr_18, slime_gr_19, slime_gr_20, slime_gr_21]; _areaR = [[5050.288, 2841.632, 0], [5069.165, 2841.630, 0], [5088.359, 2841.634, 0]]; _spawn1 = selectRandom _areaR; _add1 = selectRandom _green; _getarea = allPlayers inAreaArray boss_fighting_zone; _getplayer = selectRandom _getarea; _find1 = getPOS _getplayer; _add1 setPOS _spawn1; _add1 doMove _find1; }; But my next silly problem is the selectRandom of the opfor bomber, will still pull a dead unit. I figured i could do an if statement to check the selectRandom and if !alive repeat, which i only understand if-else loops from python, where you would call the statement again if it failed. Doesn't seem to work in arma the way i thought. is there a better way to check alive or !alive from an array?
  4. I'm new to major coding sequences. I've been able to get simple 1-step, 2-step tasks done with what I can understand from online. I really struggle with unknown unit commands (_x, _this, _thislist, foreach) After about of week of research, and tests in map editor, I'm not finding a solution to my goal. What I'm trying to accomplish: A Unit(opfor) is moved to a area/location. A trigger is activated when it detects them at that location, finds the nearest player, runs up to them and explodes. (i have an attached trigger to the opfor unit so when a player is inside the range, it creates and bomb at the location). This is planned for a multiplayer game, LAN based, so it doesn't have to be for dedicated servers. Now. I've tried 2 ways of getting the Opfor unit to that location, and it still fails at not moving. I'm assuming I'm not finding a location to send them too. 1st. An already created Opfor unit is on the map; I move them to a random position in the trigger location. Upon landing i have: Condition: thislist = [slime_gr_1, slime_gr_2, slime_gr_3, slime_gr_4, slime_gr_5, slime_gr_6, slime_gr_7, slime_gr_8, slime_gr_9, slime_gr_10, slime_gr_11, slime_gr_12, slime_gr_13, slime_gr_14, slime_gr_15, slime_gr_16, slime_gr_17, slime_gr_18, slime_gr_19, slime_gr_20, slime_gr_21]; names of all the units i have already made, so the trigger only reacts to these names being "present" in the location. Activation: [] spawn{ _markerPos = getMarkerPos "mrk_ooze"; _playerList = allPlayers apply {[_markerPos distanceSqr _x, _x]}; _playerList sort true; _closestPlayer = (_playerList select 0) param [1, objNull]; _mrk = _closestPlayer; _x doMove _mrk; }; The unit doesn't move, they just stand there. Its the _x calling I can't seem to understand, and reading up on the Arma website doesn't help explain it. 2nd. I've tried creating the unit at the location without the trigger upon landing. Which lead to other problems that I haven't looked at yet. (attaching a smoke grenade and trigger for bomb [] spawn{ _areaR = [[5050.288, 2841.632, 0], [5069.165, 2841.630, 0], [5088.359, 2841.634, 0]]; _spawn1 = selectRandom _areaR; _grp_gr = createGroup opfor; _ooze_gr = _grp_gr createUnit ["O_Soldier_VR_F", _spawn1, [], 0, "CAN_COLLIDE"]; _ooze_gr setUnitPos "MIDDLE"; _smoke = createvehicle ["SmokeShellGreen",_spawnR,[],0,"none"]; _smoke attachTo [_ooze_gr, [0,0,0.5]]; sleep 45; }; Without trying to use _x. But then I couldn't find a way to get the unit to find a nearest player, move or create a waypoint there, and move them. I'm stuck at finding the nearest player. I've looked up "nearestObject" and "nearEntities" but it seems like those don't look for player but a specific model; ("man", "sheep", "car") So I moved to just finding the distance of a player to the unit, if that value is less than a set variable, "_x doMove player". And still I can't get any opfor that falls into a trigger to move, only when I call it's variable name to do the command. I'm sure i'm doing something over-complicated or wrong, but I can't wrap my head around it. Can anyone help or guide me?
×