Jump to content

falconx1

Member
  • Content Count

    179
  • Joined

  • Last visited

  • Medals

Everything posted by falconx1

  1. was wondering if i can add more conditions in place of the second if check? and how? still don't know the language enough to be very creative but i know its possible basically i want end mission called only if waves_east == AIWaveCount and east units is 0. i haven't tested this code yet but i think it works,any how i still want the code optimized this part has to stay intact because i have over 100 lines of code in it: while {waves_east < AIWaveCount} do { while {waves_east < AIWaveCount} do { //---this is inside a loop if (waves_east == AIWaveCount)then { _CountEast = {side _x == opfor} count allUnits; if (_CountEast == 0)then { ["End5","BIS_fnc_endMission",west] call BIS_fnc_MP; }; }; //---still in a loop }; Here is one of my many fails for LOLS if (waves_east == AIWaveCount && if _CountEast = {side _x == opfor} count allUnits == 0)then { ["End5","BIS_fnc_endMission",west] call BIS_fnc_MP; }; };
  2. I've noticed ai has many bugs in the current stable, for instance a group of ai in formation, moving to a waypoint there is always this one studdering laggy soldier in the group, and sometimes one or 2 will even disappear for good without a trace! Also yesterday i seen a car drive into a tree fairly slowly, didnt take much damage, but he stayed there ignoring his move waypoint for over 5 minutes.
  3. was wondering what the ranges are gonna be exactly? im trying to make AI spawn between like min 7.1 - 17 seconds max so game play stay less predictable s will be changed to sleep tho but just asking? s = (7.1+random(9.8));
  4. falconx1

    random numbers

    cool thanks, yea the numbers are pretty close i think any of these will do thanks!
  5. Init.sqf player addMPEventHandler ["MPRespawn",{_this execVM "onRespawn.sqf"}]; onRespawn.sqf waitUntil {alive player}; ///then rest of your code etc...
  6. Solved: basically i want the code to count east and west, it's west vs "east AI" Im counting players on west and if players are 5 or greater on west then i want the code to spawn more AI, problem is in testing tons of AI are spawning and west count is 1 "me" not getting any errors in debug or syntax but maybe somthing im missing? sorry i havnt condensed the code yet lol //-------------------------------------------------------------------------- _CountWest = {side _x == west} count allUnits; if (_CountWest >= 5 ) then { RandomDirection = ["Transmitter Tower1","Transmitter Tower2","Transmitter Tower3","Transmitter Tower4","Transmitter Tower5","Transmitter Tower6","Transmitter Tower7","Transmitter Tower8"] select floor(random 8); sleep (0.3+random(0.3)); _grp1 = createGroup east; _grp1 = [markerPos RandomDirection, EAST, ["O_Soldier_F", "O_Soldier_GL_F", "O_Soldier_AR_F"], [], [], [AICurrentSkill, AICurrentSkill]] call BIS_fnc_spawnGroup; { _x allowFleeing 0} forEach units _grp1; _wp0 = _grp1 addWaypoint [AttackMarkerLocation,0]; _wp0 setWaypointType "SAD"; _wp0 setWaypointFormation "LINE"; _wp0 setWaypointBehaviour "AWARE"; _wp0 setwaypointcombatmode "YELLOW"; _wp0 setWaypointSpeed "NORMAL"; _wp0 setWaypointCompletionRadius 20; diag_log format ["LOG: Wave: {%1} AI Spawned: {%2} AI Skill: {%3}", waves_east, RandomDirection, AICurrentSkill]; RandomDirection = ["Transmitter Tower1","Transmitter Tower2","Transmitter Tower3","Transmitter Tower4","Transmitter Tower5","Transmitter Tower6","Transmitter Tower7","Transmitter Tower8"] select floor(random 8); sleep (1.6+random(1.6)); _grp1 = createGroup east; _grp1 = [markerPos RandomDirection, EAST, ["O_Soldier_GL_F", "O_Soldier_AR_F" , "O_Soldier_F"], [], [], [AICurrentSkill, AICurrentSkill]] call BIS_fnc_spawnGroup; { _x allowFleeing 0} forEach units _grp1; _wp0 = _grp1 addWaypoint [AttackMarkerLocation,0]; _wp0 setWaypointType "SAD"; _wp0 setWaypointFormation "LINE"; _wp0 setWaypointBehaviour "AWARE"; _wp0 setwaypointcombatmode "RED"; _wp0 setWaypointSpeed "NORMAL"; _wp0 setWaypointCompletionRadius 20; diag_log format ["LOG: Wave: {%1} AI Spawned: {%2} AI Skill: {%3}", waves_east, RandomDirection, AICurrentSkill]; }; //-------------------------------------------------------------------------- if (_CountWest >= 8 ) then { RandomDirection = ["Transmitter Tower1","Transmitter Tower2","Transmitter Tower3","Transmitter Tower4","Transmitter Tower5","Transmitter Tower6","Transmitter Tower7","Transmitter Tower8"] select floor(random 8); sleep (0.3+random(0.3)); _grp1 = createGroup east; _grp1 = [markerPos RandomDirection, EAST, ["O_Soldier_F", "O_Soldier_F", "O_Soldier_GL_F", "O_Soldier_AR_F"], [], [], [AICurrentSkill, AICurrentSkill]] call BIS_fnc_spawnGroup; { _x allowFleeing 0} forEach units _grp1; _wp0 = _grp1 addWaypoint [AttackMarkerLocation,0]; _wp0 setWaypointType "SAD"; _wp0 setWaypointFormation "LINE"; _wp0 setWaypointBehaviour "AWARE"; _wp0 setwaypointcombatmode "YELLOW"; _wp0 setWaypointSpeed "NORMAL"; _wp0 setWaypointCompletionRadius 20; diag_log format ["LOG: Wave: {%1} AI Spawned: {%2} AI Skill: {%3}", waves_east, RandomDirection, AICurrentSkill]; RandomDirection = ["Transmitter Tower1","Transmitter Tower2","Transmitter Tower3","Transmitter Tower4","Transmitter Tower5","Transmitter Tower6","Transmitter Tower7","Transmitter Tower8"] select floor(random 8); sleep (1.6+random(1.6)); _grp1 = createGroup east; _grp1 = [markerPos RandomDirection, EAST, ["O_Soldier_F", "O_Soldier_GL_F", "O_Soldier_AR_F" , "O_Soldier_F"], [], [], [AICurrentSkill, AICurrentSkill]] call BIS_fnc_spawnGroup; { _x allowFleeing 0} forEach units _grp1; _wp0 = _grp1 addWaypoint [AttackMarkerLocation,0]; _wp0 setWaypointType "SAD"; _wp0 setWaypointFormation "LINE"; _wp0 setWaypointBehaviour "AWARE"; _wp0 setwaypointcombatmode "RED"; _wp0 setWaypointSpeed "NORMAL"; _wp0 setWaypointCompletionRadius 20; diag_log format ["LOG: Wave: {%1} AI Spawned: {%2} AI Skill: {%3}", waves_east, RandomDirection, AICurrentSkill]; }; //-------------------------------------------------------------------------- if (VehiclesEnabled == 1 ) then { RandomDirection = ["Transmitter Tower1","Transmitter Tower2","Transmitter Tower3","Transmitter Tower4","Transmitter Tower5","Transmitter Tower6","Transmitter Tower7","Transmitter Tower8"] select floor(random 8); _grp1 = createGroup east; _grp1 = [markerPos RandomDirection, EAST, ["O_MRAP_02_hmg_F"], [], [], [AICurrentSkill, AICurrentSkill]] call BIS_fnc_spawnGroup; _wp0 = _grp1 addWaypoint [AttackMarkerLocation,0]; _wp0 setWaypointType "SAD"; _wp0 setWaypointBehaviour "AWARE"; _wp0 setwaypointcombatmode "RED"; _wp0 setWaypointSpeed "NORMAL"; _wp0 setWaypointCompletionRadius 20; diag_log format ["LOG: Wave: {%1} AI Spawned: {%2} AI Skill: {%3}", waves_east, RandomDirection, AICurrentSkill]; sleep (15.1+random(15.1)); //-----------2X RandomDirection = ["Transmitter Tower1","Transmitter Tower2","Transmitter Tower3","Transmitter Tower4","Transmitter Tower5","Transmitter Tower6","Transmitter Tower7","Transmitter Tower8"] select floor(random 8); _grp1 = createGroup east; _grp1 = [markerPos RandomDirection, EAST, ["O_MRAP_02_hmg_F"], [], [], [AICurrentSkill, AICurrentSkill]] call BIS_fnc_spawnGroup; _wp0 = _grp1 addWaypoint [AttackMarkerLocation,0]; _wp0 setWaypointType "SAD"; _wp0 setWaypointBehaviour "AWARE"; _wp0 setwaypointcombatmode "RED"; _wp0 setWaypointSpeed "NORMAL"; _wp0 setWaypointCompletionRadius 20; diag_log format ["LOG: Wave: {%1} AI Spawned: {%2} AI Skill: {%3}", waves_east, RandomDirection, AICurrentSkill]; sleep (15.1+random(15.1)); }; sleep 5; }; ---------- Post added at 01:43 PM ---------- Previous post was at 01:02 PM ---------- SOLVED: never mind i forgot i had the other slots as AI still on my team hahahah man i was going crazy trying to figure this out rofl
  7. I'm trying to make a AI group get in this vehicle "O_MRAP_02_hmg_F" (full vehicle crewmen) commander gunner driver etc. and additionally i want a group of 4 AI infantry to be assigned into the vehicles group and have them move in formation with the vehicle these are the 4 guys i wanted to use these four would be on fooot the rest would be crewman in the vehicle to operate it: O_Soldier_F O_Soldier_GL_F O_Soldier_AR_F O_soldier_M_F. heres what i have left after a ton of fails _grp1 = "O_MRAP_02_hmg_F" createVehicle getMarkerPos RandomDirection; _grp2 = "O_crew_F" createVehicle getMarkerPos RandomDirection; _grp2 assignasdriver O_MRAP_02_hmg_F ; [_grp2] orderGetIn true ; _grp1 allowFleeing 0; _wp0 = _grp1 addWaypoint [AttackMarkerLocation,0]; _wp0 setWaypointType "SAD"; _wp0 setWaypointFormation "LINE"; _wp0 setWaypointBehaviour "AWARE"; _wp0 setwaypointcombatmode "YELLOW"; _wp0 setWaypointSpeed "NORMAL"; _wp0 setWaypointCompletionRadius 20;
  8. thanks very helpful , gonna try this now:xd
  9. how can i set the whole groups skill seems like multiplayer the skill dont take effect is this right?? _grp = [markerPos "yourMarker", EAST, ["O_Soldier_F", "O_Soldier_GL_F", "O_Soldier_AR_F", "O_soldier_M_F"]] call BIS_fnc_spawnGroup; _veh = [markerPos "yourMarker", 0, "O_MRAP_02_hmg_F", _grp] call BIS_fnc_spawnVehicle; _grp selectLeader effectiveCommander (_veh select 0); [color="#FF0000"]grpname = _this select 0; _grpleader = leader _grpname; _grpleader setskill 0.25;[/color]??? { _x allowFleeing 0} forEach units _grp; _wp0 = _grp addWaypoint [markerPos "yourMarker2", 0]; _wp0 setWaypointType "SAD"; _wp0 setWaypointFormation "LINE"; _wp0 setWaypointBehaviour "AWARE"; _wp0 setwaypointcombatmode "YELLOW"; _wp0 setWaypointSpeed "NORMAL"; _wp0 setWaypointCompletionRadius 20;
  10. I wish Moricky would simplify stuff for mission makers. not only JIP markers but he can add team markers preconfiged. And all we would need to do is. configed via Description.ext Team_Markers = 1; //shows team markers. true or false //config settings Team_Marker_Color = "ColorBLUFOR"; Team_Marker_Type = "mil_dot" Team_Marker_Size [0.8, 0.8]; etc....
  11. I like this idea can't wait to see the final product:cool:
  12. i made a test dialog box that i been messing with to try to get it to work. I haven't figured it out. the sliders i can't get to adjust the view distance or terrain grid settings. Can anyone point me in the right direction? Here is the test dialog box. http://postimg.org/image/7t53ept8v/
  13. :P cheese :butbut: it's true lol. _viewdistance = (_SV * 500); ?? Code updated in my last post above, it works almost perfectly if your looking to make your own feel free to mod the code how ever you want to. or if you want the dialogs and full code to get this added to your missions the download link is below. Screenshot: Download Link:
  14. falconx1

    Respawn with Custom loadout

    +1 asking the same as above
  15. it appears to me that the latest beta update changed the way stuff is removed from the map deleteVehicle _x}} forEach allDead; now realistically works in a way that it sinks casualties in the ground over a brief delay instead of a fast delete am i correct?
  16. this has been a big help thanks kylania
  17. im going to try this method since my markers are wrecked on JIP too
  18. falconx1

    Mission start

    yea, he's awesome, and the syntax King :bounce3: So what you do is add him on steam and bug him all day like i do. lol
  19. from init.sqf loads server.sqf the server.sqf loads the scripts below ExecVM "loop1.sqf"; is code below loop1.sqf going to be executed? ExecVM "loop2.sqf"; //---example of what loop1 and 2 might look like while {waves_east < AIWaveCount} do { waitUntil {({(side _x) == east} count allUnits) == 0}; }; maybe a dumb question lol , but i do think personally both loop1.sqf and loop2.sqf will be executed but i want to ask you guys first.
  20. this has been haunting me all day yesterday, and i can't track down the source, ive tried sleep, making sure vars are being broadcast after they change etc and it still draws an error, but only around 50 percent of the time. init.sqf //---GetSelected StartLocation Param GetStartLocation = (paramsArray select 9); publicvariable "GetStartLocation"; if (isServer) then {ExecVM "server.sqf"}; waitUntil {player == player}; if (local player) then {ExecVM "client.sqf"}; server if (GetStartLocation == 100) then{ // Pick Start Location / RndmStartLoc = round ((random 11) + 0.5); // publicvariable "RndmStartLoc"; sleep 3; switch (RndmStartLoc) do { Client.sqf if (GetStartLocation == 100) then { switch (RndmStartLoc) do { case 1: { player setpos getmarkerpos "StartingLocation1"; player setdir 180; }; error log Error in expression <tartLocation == 100) then { switch (RndmStartLoc) do { case 1: { player s> Error position: <RndmStartLoc) do { case 1: { player s> Error Undefined variable in expression: rndmstartloc
  21. im actually gonna change loop 2 was just using it hypothetically. so they will both execute then huh?
  22. I got the sliders working well the code posted above is rubbish. thanks for putting me in the direction though here is mine if anyone comes here looking for the same: it's not gold but it works lol :EDIT Code updated and both sliders now work _handle = CreateDialog "visualoptions"; //--- view distance control ID = 1900 //--- Terrain grid control ID = 1901 _NewVD = viewDistance; if (isNil "CurTerrainGrid") then {CurTerrainGrid = 50}; _NewTG = CurTerrainGrid; SliderSetRange [1900,500,5000]; SliderSetRange [1901,1,5]; //--- Set terrain grid slider range to only use numbers 1-5 SliderSetPosition [1900,_NewVD]; //--- Convert numbers to valid ranges. http://community.bistudio.com/wiki/setTerrainGrid if (_NewTG == 50) then {SliderSetPosition[1901,1];}; if (_NewTG == 25) then {SliderSetPosition[1901,2];}; if (_NewTG == 12.5) then {SliderSetPosition[1901,3];}; if (_NewTG == 6.25) then {SliderSetPosition[1901,4];}; if (_NewTG == 3.125) then {SliderSetPosition[1901,5];}; _OldVD = _NewVD; _OldTG = _NewTG; while {alive player && dialog} do { if (!dialog) exitWith {}; _NewVD = sliderposition 1900; _NewTG = Floor (SliderPosition 1901); //--- Floor to the next lowest integer to make sure every slide is a hit if (_NewVD != _OldVD) then {setviewdistance _NewVD; hintsilent format ["View Distance: %1" , _NewVD]; _OldVD = _NewVD; }; switch (_NewTG) do { case 1: { _NewTG = 50; setTerrainGrid _NewTG; }; case 2: { _NewTG = 25; setTerrainGrid _NewTG; }; case 3: { _NewTG = 12.5; setTerrainGrid _NewTG; }; case 4: { _NewTG = 6.25; setTerrainGrid _NewTG; }; case 5: { _NewTG = 3.125; setTerrainGrid _NewTG; }; }; if (_NewTG != _OldTG) then { hintsilent format ["Terrain Grid : %1" , _NewTG]; _OldTG = _NewTG; }; sleep 0.5; };
  23. these are controls where is your main window handle? anyway the text field is blank in the text class and if you have a picture referenced in the bottom class maybe the alpha has to be set to 1
×