mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Updated sound & anim, added ground tagging
This commit is contained in:
parent
1532fe3ced
commit
7262690ee3
@ -4,5 +4,6 @@ ADDON = false;
|
||||
|
||||
PREP(checkTaggable);
|
||||
PREP(tagWall);
|
||||
PREP(tagGround);
|
||||
|
||||
ADDON = true;
|
||||
|
44
addons/tagging/functions/fnc_tagGround.sqf
Normal file
44
addons/tagging/functions/fnc_tagGround.sqf
Normal file
@ -0,0 +1,44 @@
|
||||
/*
|
||||
* Author: BaerMitUmlaut
|
||||
* Creates a tag on a wall that is within 2m on front of the player.
|
||||
*
|
||||
* Arguments:
|
||||
* None
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* [] call ace_tagging_fnc_tagGround
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
|
||||
|
||||
#include "script_component.hpp"
|
||||
private ["_tagPos", "_groundPos", "_vectorDirAndUp"];
|
||||
|
||||
_tagPos = player modelToWorld [0, 1.2, 0];
|
||||
_vectorDirAndUp = [];
|
||||
|
||||
_groundPos = getPosATL ACE_player;
|
||||
_groundPos set [2, 0];
|
||||
|
||||
//Check if we're in or on top of some object
|
||||
if (lineIntersects [getPosASL ACE_player, ATLToASL _groundPos, ACE_player, objNull]) then {
|
||||
_tagPos set [2, (getPosATL ACE_player) select 2];
|
||||
_vectorDirAndUp = [[0,0,-1], vectorDir ACE_player];
|
||||
} else {
|
||||
_tagPos set [2, 0];
|
||||
_vectorDirAndUp = [(surfaceNormal _tagPos) vectorMultiply -1, vectorDir ACE_player];
|
||||
};
|
||||
|
||||
ACE_player playActionNow "PutDown";
|
||||
|
||||
[{
|
||||
private ["_tag"];
|
||||
playSound3D [QUOTE(PATHTO_R(sounds\spray.ogg)), ACE_player, false, (getPosASL ACE_player), 10, 1, 15];
|
||||
_tag = ("ACE_tagWall" + str (floor (random 5))) createVehicle [0,0,0];
|
||||
_tag setPosATL (_this select 0);
|
||||
_tag setVectorDirAndUp (_this select 1);
|
||||
}, [_tagPos, _vectorDirAndUp], 0.6] call EFUNC(common,waitAndExecute);
|
@ -16,7 +16,7 @@
|
||||
|
||||
|
||||
#include "script_component.hpp"
|
||||
private ["_eyepos", "_touchingPoints", "_pointCloser", "_pointFurther", "_posCheckCloser", "_posCheckFurther", "_touchingPoint", "_tag"];
|
||||
private ["_eyepos", "_touchingPoints", "_pointCloser", "_pointFurther", "_posCheckCloser", "_posCheckFurther", "_touchingPoint"];
|
||||
|
||||
//Cache eyepos in case player moves
|
||||
_eyepos = eyePos ACE_player;
|
||||
@ -57,8 +57,11 @@ _touchingPoints = [];
|
||||
} foreach [-0.5, 0.5];
|
||||
|
||||
ACE_player playActionNow "PutDown";
|
||||
playSound3D [QUOTE(PATHTO_R(sounds\spray.ogg)), ACE_player, false, (getPosASL ACE_player), 10, 1, 15];
|
||||
|
||||
_tag = ("ACE_tagWall" + str (floor (random 5))) createVehicle [0,0,0];
|
||||
_tag setPosASL (((_touchingPoints select 0) vectorAdd (_touchingPoints select 1)) vectorMultiply 0.5);
|
||||
_tag setDir ((_touchingPoints call BIS_fnc_dirTo) - 90);
|
||||
[{
|
||||
private ["_tag"];
|
||||
playSound3D [QUOTE(PATHTO_R(sounds\spray.ogg)), ACE_player, false, (getPosASL ACE_player), 10, 1, 15];
|
||||
_tag = ("ACE_tagWall" + str (floor (random 5))) createVehicle [0,0,0];
|
||||
_tag setPosASL (((_this select 0) vectorAdd (_this select 1)) vectorMultiply 0.5);
|
||||
_tag setDir ((_this call BIS_fnc_dirTo) - 90);
|
||||
}, _touchingPoints, 0.6] call EFUNC(common,waitAndExecute);
|
Binary file not shown.
Loading…
Reference in New Issue
Block a user