BIS fnc lookAtArray: Difference between revisions
| Lou Montana (talk | contribs) m (Text replacement - "\|game([0-9])= *([^ ]+) *  +\|version([0-9])= *([^ ]+) * " to "|game$1=$2 |version$3=$4 ") | Lou Montana (talk | contribs)  m (Text replacement - " (\|[pr][0-9]+ *= *[^-]+) *- *A([a-z])" to " $1 - a$2") | ||
| (2 intermediate revisions by the same user not shown) | |||
| Line 12: | Line 12: | ||
| |p1= initialize: [[Boolean]] - [[true]] to initialize, [[false]] to remove it | |p1= initialize: [[Boolean]] - [[true]] to initialize, [[false]] to remove it | ||
| |p2= lookAtData: [[Array]] -  | |p2= lookAtData: [[Array]] - an array with arrays of look-up-data in form of: | ||
| *0: [[Object]] - Object to be looked at | *0: [[Object]] - Object to be looked at | ||
| *1: [[Number]] - How long player has to look at it | *1: [[Number]] - How long player has to look at it | ||
| Line 20: | Line 20: | ||
| |r1= [[Nothing]] | |r1= [[Nothing]] | ||
| |x1= < | |x1= <sqf> | ||
| private _lookAtArray =   | |||
| [ | |||
| 	[ | |||
| 		BIS_apc,										// name of object | |||
| 		2,												// time we have to look at it | |||
| 		false,											// do we destroy the entry after we looked at it | |||
| 		{ ["What a wonderful APC"] call BIS_fnc_log; }	// code | |||
| 	], | |||
| 	[ | |||
| 		BIS_otherUnit,   | |||
| 		2, | |||
| 		false, | |||
| 		{ ["apc looked at"] call BIS_fnc_log; } | |||
| 	] | |||
| ]; | |||
| [true, _lookAtArray] spawn "BIS_fnc_lookAtArray"; | |||
| sleep 15; | |||
| [false] spawn "BIS_fnc_lookAtArray"; | |||
| </sqf> | |||
| |seealso= [[BIS_fnc_lookAtArrayEH]] | |seealso= [[BIS_fnc_lookAtArrayEH]] | ||
| }} | }} | ||
Latest revision as of 12:40, 8 November 2023
Description
- Description:
- Executes a code when one of the specified objects is looked at (player's cursor pointed towards it) for enough time
- Execution:
- call
- Groups:
- Interaction
Syntax
- Syntax:
- [initialize, lookAtData] call BIS_fnc_lookAtArray
- Parameters:
- initialize: Boolean - true to initialize, false to remove it
- lookAtData: Array - an array with arrays of look-up-data in form of:
- Return Value:
- Nothing
Examples
- Example 1:
- private _lookAtArray = [ [ BIS_apc, // name of object 2, // time we have to look at it false, // do we destroy the entry after we looked at it { ["What a wonderful APC"] call BIS_fnc_log; } // code ], [ BIS_otherUnit, 2, false, { ["apc looked at"] call BIS_fnc_log; } ] ]; [true, _lookAtArray] spawn "BIS_fnc_lookAtArray"; sleep 15; [false] spawn "BIS_fnc_lookAtArray";
Additional Information
- See also:
- BIS_fnc_lookAtArrayEH
Notes
- 
Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
 Only post proven facts here! Add Note
 
	