Jump to content

Grumpy Old Man

Member
  • Content Count

    4333
  • Joined

  • Last visited

  • Medals

Everything posted by Grumpy Old Man

  1. Grumpy Old Man

    Daytime question

    If you want to check or compare dates you can use dateToNumber and numberToDate. If you want to do a simpler check when stuff will happen on the same day, simply use daytime. dayTime is rather straightforward, 10 being 10:00, while 10.5 is 10:30. Cheers
  2. Might be the position error of the command messing things up, you could simplify it like this: _rndTarget = selectRandom _nearby; _targetPos = getPosATL _rndTarget; So the final snippet would look like this: GOM_fnc_mortarAutoReveal = { params ["_mortar"]; while {alive _mortar AND canFire _mortar AND count crew _mortar > 0} do { _enemySides = side _mortar call BIS_fnc_enemySides; _mag = currentMagazine _mortar; _nearby = (getposatl _mortar nearEntities 4000) select {side _x in _enemySides AND _mortar getArtilleryETA [getposatl _x,_mag] > 0 AND getPosATL _x inRangeOfArtillery [[_mortar], _mag]}; //no enemies found which are in range and have a firing solution, skip and wait if (count _nearby > 0) then { _rounds = 4; _rndTarget = selectRandom _nearby; _targetPos = getPosATL _rndTarget; (effectiveCommander _mortar) commandArtilleryFire [_targetPos,_mag,_rounds]; systemchat format ["%1 targets: %2",effectivecommander _mortar,count _nearby]; sleep _rounds * 6;//give enough time to fire all rounds, then start over }; sleep (3 + random 3); }; }; GOM_fnc_spawnMortars = { params ["_side",["_debug",true]]; _sides = [west,east,resistance]; if !(_side in _sides) exitWith {systemChat "Wrong side parameter"}; _mortarTypes = ["B_Mortar_01_F","O_Mortar_01_F","I_Mortar_01_F"]; _mortar = _mortarTypes select (_sides find _side); _markers = allMapMarkers select {toUpper _x find toUpper str _side >= 0};//for east this returns all markers containing "east" in the name _mortars = []; if (_debug) then {systemchat format ["Spawning %1 mortars: %2",_side,_markers]}; { _mortarSpawn = _mortar createVehicle getMarkerPos _x; createVehicleCrew _mortarSpawn; _mortars pushBack _mortarSpawn; } forEach _markers; {[_x] spawn GOM_fnc_mortarAutoReveal} forEach _mortars; if (_debug) then {systemchat format ["Spawn finished: %1",_mortars]}; }; //now when you want to spawn the mortars simply do this: _spawn = [east] call GOM_fnc_spawnMortars; Should be more precise. Cheers
  3. So you have multiple triggers doing the same thing? Are you using other practices similar to this one? Other than that try build stuff from the ground up and see when those "lags" start to show up. Vanilla first, add mod units/vehicles when the framework for the mission does what it should. Then add fancy stuff like video playback, music etc. Cheers
  4. Not that I know of, seems the AI brain waits for the units to disembark, then waits for everyone to get in again. You could force every unit out of the vehicle using moveOut command, then immediately moveInAny, might do the trick but strongly depends on how the AI FSM is working. Cheers
  5. Grumpy Old Man

    Location location?

    Not sure if this is what you want, but you can retrieve all locations like this: _locations = nearestLocation [[worldSize/2,worldSize/2],[],(worldSize/2) * 1.4142]; Then you'd need to further filter for location names if you want a specific one. Cheers
  6. Grumpy Old Man

    [Release] GOM - Aircraft Loadout V1.35

    The answer is in my third reply on this very page. Might be passing the variable name of a deleted object to the script maybe? None of the functions included in this script package handle player respawn or music playback on respawn. Might be some other script/mod causing this. Cheers
  7. Grumpy Old Man

    Time inside a while

    That's not proper syntax. Would look like this: if ((getposASLW _vehicle select 2) < -25 and (getposASLW _vehicle select 2) > -43) No idea where you getting at, you mention a smaller area depending on depth, yet your example doesn't show anything similar. Also the usage of getPosASLW can lead to unwanted results, especially with heavy sea (especially since you seem to check for depths between -83 and -85m). State exactly what you want to do, since there's probably a more convenient way to do it other than spawning and deleting triggers inside a while loop. Cheers
  8. Grumpy Old Man

    Chances in an array

    35? Try reading the wiki entry. Cheers
  9. Indeed this seems to be the case. Well the AI seems to be truly done for this iteration... Placed a HEMTT transport with a waypoint, a few units in the cargo slots, all of the same group. Then called this: {_x doFollow leader group _x} forEach units squadLeader; Half the squad left the vehicle, just to get in again. After that the vehicle starts moving towards the waypoint... Not really sure if it's worth it to post a ticket. Cheers
  10. Grumpy Old Man

    Time inside a while

    This looks sketchy as hell. The while true loop will run every second, creating a trigger every second when the _vehicle is 25m below water. _vehicle also is undefined inside the scope you're using it. Did this even work when you tried it? What do you want to achieve? Also post using code tags and proper indentation, makes it easier to go through. Cheers
  11. Don't worry about performance until you run into performance issues caused by your scripts. Other than that depends on your workflow I guess. I've grown fond of having multiple smaller, specialized functions where possible. Makes it easy for the eyes having to go over a few lines vs scrolling through 1000+ lines. Cheers
  12. Grumpy Old Man

    Searching a script

    Where exactly did you search? Won't find any scripts in a barn, just saying. Cheers
  13. Grumpy Old Man

    Handicapped player

    Carrying? What do you mean? Cheers
  14. Your while loop has no sleep inside, might be causing it since it will run at full speed, didn't look much further though. Cheers
  15. Grumpy Old Man

    [IceBreakr/IBIS] Lingor & Dingor for A3

    Almost got a heart attack when I saw you replying to this thread, thought 3.9 is happening! Most favorite map by far, keep up the good work! Cheers
  16. Grumpy Old Man

    INTRO - need some good tutorial

    Just ditch the idea of using the vanilla intro/outro stuff and script it via event files depending on for whom you want to run this intro. Cheers
  17. Grumpy Old Man

    Draw circle on terrain in script

    19 minutes ago, heh... Maybe you'll make it within a minute on mercury. Cheers
  18. Make sure to check out the alternative syntax for most scripting commands, quite a few neat additions in the last 2 years. Cheers
  19. Grumpy Old Man

    Draw circle on terrain in script

    No idea if there's a formula (might be) for it and if the thread starter actually needs it. My geometry lessons are in the distant past, heh. Cheers
  20. Grumpy Old Man

    [SOLVED] Addaction run once

    In the script parameter. Cheers
  21. Grumpy Old Man

    [SOLVED] Addaction run once

    With multiple actions on the same object this could lead to unwanted removal of actions added by other scripts/addOns. Cheers
  22. Grumpy Old Man

    [SOLVED] Addaction run once

    Inside the addAction: _this#0 removeAction _this#2 Cheers
  23. Grumpy Old Man

    Draw circle on terrain in script

    For using proper math you'd use something like this: _centerPos = getPosATL player; _centerPos params ["_centerPosX","_centerPosY"]; _distance = 20; _angle = 2;//will place objects every 2° for "_i" from 0 to (360-_angle) step _angle do { "Sign_Arrow_F" createVehicle [_distance*cos(_i) + _centerPosX,_distance*sin(_i) + _centerPosY]; }; Basic formula to get positions of a circle. Cheers
  24. On a sidenote, you can look at script commands sorted by functionality: Go to the Scripting Commands page Click Scripting Commands by Functionality Click Command Group: Markers All there in plain text. Cheers
×