-
Content Count
4313 -
Joined
-
Last visited
-
Medals
Everything posted by Grumpy Old Man
-
script EventHandler "Hit"
Grumpy Old Man replied to redburn's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Kidding aside, you want a variable to turn true once a vehicle is damaged more than 0.3? Why not just: RBN_granDamage = false; waitUntil {damage dispo1 >= 0.3}; RBN_granDamage = true; //do stuff Cheers -
script EventHandler "Hit"
Grumpy Old Man replied to redburn's topic in ARMA 3 - MISSION EDITING & SCRIPTING
0.30 or more amount -
script EventHandler "Hit"
Grumpy Old Man replied to redburn's topic in ARMA 3 - MISSION EDITING & SCRIPTING
That entire snippet doesn't make sense. At all. At first you don't need global variables, when you could simply use the _unit parameter that's being passed inside the EHs code. Then you manually set the damage of the vehicle to 0.1, yet check with an if statement if the damage is (what I presume) bigger than 0.3, which will only be true if the vehicle gets destroyed with one hit (big explosive charge or tank hit might do that). The check of the damage isn't proper syntax, you're using =>, which might pass as a smily face, but not as bool comparison, you might want to use >= instead. Then inside the if statement you set a local variable to true, which can't be accessed anywhere outside the scope where it has been defined, namely the if statement inside that EH. To top it off the variable names are all over the place, you'd want them named in a way that makes it obvious what they contain and as best practice add a tag to them to prevent conflicts with other scripts/addOns. The vehicle could be called RBN_obj_dispo1 (whith RBN being short for redburn), the global variable to handle the damage check could be called RBN_flag_dispo1Damaged or similar. I suggest taking a look at some basic scripting guides first before attempting something like that, heh. What exactly do you want to accomplish? In your post you state that you want to check for damage, but in the snippet you manually set the damage of the object. Cheers -
Make vehicle vulnerable only by player(vehicle)
Grumpy Old Man replied to FunnyCookieEver's topic in ARMA 3 - MISSION EDITING & SCRIPTING
What exactly didn't work? The plane stops taking damage, as intended. If you also want to make the vehicles crew immune to any damage (explosions, piercing ammo, etc) where a player is not the damage source you'll have to handle that separately. Cheers -
Try setVehicleAmmoDef. Also try to improve your search game, since you can easily stumble upon this command by using ctrl+f on the scripting command wiki page and searching for either "ammo" or "vehicle". Cheers
-
"Hit" Event Handler Params
Grumpy Old Man replied to Alpine_gremlin's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Group is its own data type, similar to object, location or array. The "in" command needs either a vehicle, to find if a unit is inside it, or an array, to check if an element exists inside an array. Group is of data type group, so the "in" command doesn't work, hence why you need "units group". Cheers -
Daytime question
Grumpy Old Man replied to Taylor1984's topic in ARMA 3 - MISSION EDITING & SCRIPTING
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 -
Automatic Spawning Mortor team that fires?
Grumpy Old Man replied to Grim5667's topic in ARMA 3 - MISSION EDITING & SCRIPTING
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 -
bi mystery Modules Lag when Mission does not
Grumpy Old Man replied to JohnKalo's topic in ARMA 3 - MISSION EDITING & SCRIPTING
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 -
Strange & perplexing problem with doFollow
Grumpy Old Man replied to madrussian's topic in ARMA 3 - MISSION EDITING & SCRIPTING
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 -
Location location?
Grumpy Old Man replied to NumbNutsJunior's topic in ARMA 3 - MISSION EDITING & SCRIPTING
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 -
[Release] GOM - Aircraft Loadout V1.35
Grumpy Old Man replied to Grumpy Old Man's topic in ARMA 3 - MISSION EDITING & SCRIPTING
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 -
Time inside a while
Grumpy Old Man replied to Barba-negra's topic in ARMA 3 - MISSION EDITING & SCRIPTING
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 -
Chances in an array
Grumpy Old Man replied to CreativeProduct's topic in ARMA 3 - MISSION EDITING & SCRIPTING
35? Try reading the wiki entry. Cheers -
Strange & perplexing problem with doFollow
Grumpy Old Man replied to madrussian's topic in ARMA 3 - MISSION EDITING & SCRIPTING
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 -
Time inside a while
Grumpy Old Man replied to Barba-negra's topic in ARMA 3 - MISSION EDITING & SCRIPTING
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 -
Is it better to have multiple functions or 1 big function ?
Grumpy Old Man replied to xjoker_'s topic in ARMA 3 - MISSION EDITING & SCRIPTING
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 -
Searching a script
Grumpy Old Man replied to Vitouse's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Where exactly did you search? Won't find any scripts in a barn, just saying. Cheers -
Carrying? What do you mean? Cheers
-
Scripts that used to work freezes at loading now.
Grumpy Old Man replied to kocrachon's topic in ARMA 3 - MISSION EDITING & SCRIPTING
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 -
[IceBreakr/IBIS] Lingor & Dingor for A3
Grumpy Old Man replied to icebreakr's topic in ARMA 3 - ADDONS & MODS: COMPLETE
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 -
INTRO - need some good tutorial
Grumpy Old Man replied to pierremgi's topic in ARMA 3 - MISSION EDITING & SCRIPTING
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- 3 replies
-
- intro
- mission.sqm
-
(and 2 more)
Tagged with:
-
Draw circle on terrain in script
Grumpy Old Man replied to JB47394's topic in ARMA 3 - MISSION EDITING & SCRIPTING
19 minutes ago, heh... Maybe you'll make it within a minute on mercury. Cheers -
spawn spawning a icon om map thru trigger
Grumpy Old Man replied to Play3r's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Make sure to check out the alternative syntax for most scripting commands, quite a few neat additions in the last 2 years. Cheers -
Draw circle on terrain in script
Grumpy Old Man replied to JB47394's topic in ARMA 3 - MISSION EDITING & SCRIPTING
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