Jump to content

codeivo

Member
  • Content Count

    7
  • Joined

  • Last visited

  • Medals

Community Reputation

1 Neutral

About codeivo

  • Rank
    Rookie

Recent Profile Visitors

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

  1. that's the whole code/log, of course it's not how I will implement it, but it doesn't work anyway with that simple line: vehicle player setEffectiveCommander player;
  2. I haven't been able to use this command succesfully, and still i have found no problem footnotes in the wiki nor posts of the like; yet every time i try to use it I get a missing semicolon error. Even when I use nothing but the example line in the wiki (with me and a team inside a vehicle) it still won't run but return: 'vehicle player |#|setEffectiveCommander player;' Error missing ; anybody else has had the same trouble?, hopefully with a workaround; Cheers.
  3. Hello guys, is there a way either by mod or already integrated in which you could play a mission and have the play-through recorded so that you can later replay it while freely being able to move the camera around. I would like to review how a mission went in detail, like how the different units behaved further than from the scope of my own pov and in general altogether as a squad, with the ability to pause and going back to rewind key moments.
  4. Thanks a lot man, love this community. Yeah, the snippet is actually going to be spawned as a function, with the "center" parameter being one of three opfor hq, and an !alive boss condition to exit the script. The main block where I create the ai and made them occupy an area is also randomized which is why I want to make it modular and as simple as I can. Now, the continuosly looping is actually on purpose, since I want to spawn each ai every 5 mins so I encounter a considerable enemy force grown on unpatrolled areas. Also dumbed down the code to understand better myself how to make it work, while removing irrelevant parts from the post aswell. I will probably add the killed EH just want to really wrap my head around it's structure and the way it is implemented in the script first.
  5. Thank you so much wogz, I also ended up coming with a solution while checking your code (I'm still getting familiar with EHs). I just set the forEach's target to both the vehicle and it's crew instead of just the vehicle, and it all came together. here's how it ended up. [] spawn { _fleet = []; _limit = 3; while {true} do { sleep 1; if ((count (_fleet)) < _limit) then { veh = createVehicle ["O_G_Offroad_01_armed_F",(position player), [], 15, "NONE"]; _fleet pushBack [veh,[]]; }; { if ( (count((_x select 1) select {alive _x})) < 3 ) then { {moveOut _x;} forEach ((crew (_x select 0)) select { !alive _x }); sleep 1; _crewmate = (createGroup east) createUnit ["O_soldier_F", (getPos (_x select 0)) , [], 0, "NONE"]; _crewmate moveInAny (_x select 0); (_x select 1) pushBack _crewmate; }; if (!((damage (_x select 0)) < 1)) then { _fleet deleteAt (_forEachIndex); }; } forEach _fleet; }; }; cheers Master Sergeant, from a designer aswell and hopefully future developer too.
  6. So i'm building a randomly self-generating scenario of a sort, and i'm trying to spawn a vehicle around the player and fill it with one crew at a time until it is filled, then spawn and fill another vehicle until there are 3 vehicles full, replacing the dead units with each loop aswell. To acomplish it I put a while-true loop with this: a condition to spawn a vehicle if there are less than my 3 vehicles limit, and a foreach loop for every one of my already spawned vehicles. inside the foreach I check if the crew is empty to create one. Now, I want to create a new crew when the old crew is dead, but crew, fullCrew, assigned, etc seem to only if they are inside the vehicle. I figured I would add each vehicle's unit into an array just as I am creating them, then check if anybody is alive in that array at the end of the loop so that then it would clear the array and the condition could run and create their replacements. I believe that for it to work each array should be private/local to it's own foreach loop, and that for it to exist outside the scope where it creates units I should define the empty array before it, at the start of each foreach loop; but then that would mean that every time it loops back the array gets cleared, thus creating more units forever since it take it as the cleared array means they died. I tried conditioning the first array declaration with isNil but then it is private to that condition's scope and don't exist outside of it. I could just make the array global scoped containing all crew teams with a reference to their each own vehicles but it doesn't seem as correct also I'm afraid to overwriting local variables and whatnot. Please help, this is my first time coding and have been able to work my way through it by reading old posts and the wiki, but I have trouble with this snippet. [] spawn { _fleet = []; _limit = 1; _blacklist = []; while {true} do { sleep 1; if ((count (_fleet)) < _limit) then { veh = createVehicle ["O_G_Offroad_01_armed_F",(position player), [], 15, "NONE"]; _fleet pushBack veh; }; { _crew = []; if ( !(_x in _blacklist) ) then { for "_i" from 1 to 3 do { sleep 1; _crewmate = (createGroup east) createUnit ["O_soldier_F", (getPos _x) , [], 0, "NONE"]; _crewmate moveInAny _x; _crew pushBack _crewmate; }; _blacklist pushBack _x; }; _check = count(_crew select {alive _x}); comment "if ( _check == 0 ) then { _blacklist deleteAt (_blacklist find _x);}; "; } forEach _fleet; }; }; I only spawn one vehicle in the code (variable _limit) because I want to have it working well on a single vehicle crew. Also commented out the last line where it makes able for a new crew to be created because otherwise units would be created infinitely probably causing a crash. Thanks a lot!
  7. how could I whitelist the townsPosSize with the same @pierremgi script? tried switching their place at the randomPos call but it gives me the error: 2 elements provided, 3 expected
×