Jump to content

NunesSergio

Member
  • Content Count

    25
  • Joined

  • Last visited

  • Medals

Community Reputation

17 Good

1 Follower

About NunesSergio

  • Rank
    Private First Class

Recent Profile Visitors

692 profile views
  1. Something like: if !isServer exitWith {}; //Fade to black effect [0] remoteExec ["BIS_fnc_fadeEffect"]; //Wait till screen fades completely uiSleep 3; //Move all inside trigger area private _myTrigger = <your trigger name/object goes here>; private _playersToTeleport = allPlayers inAreaArray _myTrigger; { _x setVehiclePosition [_myPosition, [], 0, "NONE"]; sleep 0.3; } forEach _playersToTeleport; //Fade in effect [1] remoteExec ["BIS_fnc_fadeEffect"]; Important: This code must run in scheduled environment, so it should only be ran via execVM or spawn. Also because of all these commands global effect nature, I made it so even if you mistakenly start it on every machine, only the server will go through with it, as it's all that's needed.
  2. Hello! I'm trying to make players not die whenever they receive fatal damages. I figured it out for on-foot soldiers, but whenever in a vehicle, it's explosion/destruction causes the immediate death of the player regardless of any damage handling I apply to the soldier. Even "killed" Event Handler seems to fire past the point of all crew deaths. So I figured I'd have to intercept and manage the vehicle damage and manually destroy it only after I eject all crew. The thing is I can't really point out the main/more frequent causes of a vehicle destruction and didn't want to make it too unnatural. Using "HandleDamage" EH gives me many mixed signals, as different vehicles have different selections and hitpoints, and sometimes even giving >= 1 damage to all hitpoints doesn't make it go !alive. Also damage seems to play little to no role on vehicle destruction on the majority of times. Do any of you know a good / best practice way to check for vehicle integrity and perceive it's destruction?
  3. Is this for a solely SP mission? Or is it also MP? BIS_fnc_holdActionAdd codes run local on player machine. setUnconscious requires a local argument. Maybe you'd have to remoteExec it for it to work 100% of the time? If locality is not the issue, then I'm probably not good to help you now. Never used setUnconscious before.
  4. remoteExec'ing a .sqf goes like this: //Using "example.sqf" Local (normal) execution: [] execVM "example.sqf"; To remote execute on server machine: "example.sqf" remoteExec ["execVM", 2]; If the script requires argument(s): [[_arg1, _arg2], "example.sqf"] remoteExec ["execVM", 2];
  5. Is there any way (scripting command or function I overlooked) to draw trigger area in 3D space, while in-game, like it shows in 3DEN Editor? I've seen Mr. H's post and it's a handy solution, but I'd prefer the vanilla result if possible.
  6. Yes I use this a lot, but when spawning a whole group, the safe position is only guaranteed to be the group leader's. The other members spawn in formation (or any other) and can end up more often than not under terrain rocks 😞 I just didn't want to use findSafePos for every single unit I spawn.
  7. Hello there! I'm trying to account for soldiers being spawned inside of rocks, so I figured I'd draw a line upwards above the soldier's head, pick the object of the first surface the line touches and call it a day. The thing is, the command does not throw me classname objects, it throws me proxy objects (p3d). Here is my code: _pos = getPosASL _unit; _objs = lineIntersectsWith [_pos, _pos vectorAdd [0,0,10], _unit]; _objs //This gives me: [155305: sharprock_spike.p3d] As you can see, that's just the kind of object I want to detect. But passing it through isKindOf doesn't help. Other "line" commands (lineIntersectsObjs, lineIntersectsSurfaces, etc), give me the same result. How can I detect if that object is a rock? The only thing I could think of was to convert that using str and check for "rock" in the resulting string, but I assume that's just sloppy and could cause some false alarms.
  8. NunesSergio

    Get Caller of Script

    That is correct, but since you'd be messing with dialogs (thus on uiNamespace), you should consider setting the unit on this environment: uiNamespace setVariable ["TAG_myUnit", _caller]; Don't forget uiNamespace variables live through all the game execution duration, not just mission duration. So remember to always delete setted values on uiNamespace to avoid possible conflicts with other sessions the player may enter before closing the game. To erase the unit's reference from the variable once you close the dialog, you can use: uiNamespace setVariable ["TAG_myUnit", nil]; on the dialogs "onUnload" event handler.
  9. if (((units east) inAreaArray _myTrigger) findIf {player knowsAbout _x == 0} < 0) then { systemChat "Player knows about every EAST unit in trigger"; } else { systemChat "Player doesn't know about every EAST unit in trigger"; };
  10. Point to any vehicle (a vehicle able to be slingloaded) and run the following code. The nearest sling loading position to the player will be highlighted in red: _veh = cursorTarget; _selections = (_veh selectionNames "Memory") select {"slingloadcargo" in _x}; addMissionEventHandler ["Draw3D", { _thisArgs#0 apply { drawIcon3D [ "", [1,1,1,1], _thisArgs#1 modelToWorldVisual (_thisArgs#1 selectionPosition [_x, "Memory"]), 0, 0, 0, _x, 2 ]; }; }, [_selections, _veh]]; _distances = []; for "_i" from 0 to ((count _selections) - 1) do { _distances pushBack (_veh modelToWorldVisual (_veh selectionPosition [_selections#_i, "Memory"])); _distances set [_i, [player distance _distances#_i, _distances#_i, _selections#_i]]; }; _distances sort true; addMissionEventHandler ["Draw3D", { drawIcon3D [ "", [1,0,0,1], _thisArgs#0 modelToWorldVisual (_thisArgs#0 selectionPosition [_thisArgs#1, "Memory"]), 0, 0, 0, _thisArgs#1, 2 ]; }, [_veh, _distances select 0 select 2]];
  11. The way I did it was, upon initPlayerLocal.sqf I remotely add an Score event handler on server which, based on the value of the score, remotely fires my hitmarker function back on player machine: //initPlayerLocal.sqf params ["_player", "_didJIP"]; [_player, "configScore.sqf"] remoteExec ["execVM", 2]; //configScore.sqf params ["_player"]; _player addEventHandler ["HandleScore", { params ["_unit", "_object", "_score"]; //Score == 1 means you killed one soldier enemy unit (be it in or out of a vehicle) if (_score isEqualTo 1) then { ["hitMarkerAnimation.sqf"] remoteExec ["execVM", _unit]; }; }]; Keep in mind that if your mission has respawn of players, you'd have to re-assign the Score event handler to the respawned unit. So repeat the initPlayerLocal.sqf lines on onPlayerRespawn.sqf (changing _player for _newUnit): //onPlayerRespawn.sqf params ["_newUnit", "_oldUnit", "_respawn", "_respawnDelay"]; [_newUnit, "configScore.sqf"] remoteExec ["execVM", 2]; Whenever you kill an enemy unit, wherever it's spawned from, or how it was handled by scripts, you get your hitmarker and are free from tracking enemy unit creation process.
  12. Hello there! So I have a dedicated server running a mission of mine. I want to possibly show JIP players which mods they could use if they want to. I know I can hardcode some info somewhere to the players but I'm looking for a way to do it dynamically, so when the "*.bikey" (s) on my server keys folder changes, connecting players would have access to the updated possible modset. Ps: I can wrap my mind around on how the server passes this information to JIP clients, but I can't seem to find a way to detect said keys in the first place. Ps²: I tried something along the lines of the fileExists command, but it seems to work only with mission-relative paths. Can it be done? Kinda would want to avoid having to create an extension for that (should that be the only way).
  13. Just use "false" as the third parameter of this command: heli1 AnimateDoor ["Door_rear_source", 1, false]
  14. If by team you mean group you could do: private _notOnMyGroup = []; _notOnMyGroup = allPlayers select { group _x isNotEqualTo group player }; _notOnMyGroup //every player not in player's group
×