StartRecordingPlayback: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
(7 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
<poem style="border: 2px solid #d6d2c5; background-color: #f9f4e6; padding: 1em;"> | |||
The parameter flags was added in v1.8 and will not work in previous versions. | |||
</poem> | |||
{{Welcome| | {{Welcome| | ||
desc=This will run a .rec file which has to be saved in the npcscripts/recordings folder. The NPC will follow the actions recorded in the file.| | desc=This will run a .rec file which has to be saved in the npcscripts/recordings folder. The NPC will follow the actions recorded in the file.| | ||
params=<syntaxhighlight lang="lua">(playbacktype, recordname)</syntaxhighlight> | params=<syntaxhighlight lang="lua">(playbacktype, recordname, flags=0)</syntaxhighlight> | ||
<poem>::playbacktype : The [[RecordingTypes|type]] of the recording to be loaded | <poem>::playbacktype : The [[RecordingTypes|type]] of the recording to be loaded | ||
::recordname : The name of the .rec file to run.</poem>| | ::recordname : The name of the [[.rec_file|.rec]] file (without extension) to run. | ||
retvals= | ::flags : The options [[Play_Flags|playback flags]] for overriding various data in rec file</poem>| | ||
example=<source lang=" | retvals=True on success and null on failure ( file not found or header different version )| | ||
example=<source lang="Lua"> | |||
function OnNPCEnterVehicle(vehicleid, seatid) | function OnNPCEnterVehicle(vehicleid, seatid) | ||
{ | { | ||
print("I entered vehicle "+vehicleid+" and my seat is "+seatid+"\n"); | print("I entered vehicle "+vehicleid+" and my seat is "+seatid+"\n"); | ||
StartRecordingPlayback(2,"stretch | StartRecordingPlayback(2,"stretch"); | ||
} | } | ||
</source>| | </source>| |
Latest revision as of 09:56, 28 February 2024
The parameter flags was added in v1.8 and will not work in previous versions.
Description:
This will run a .rec file which has to be saved in the npcscripts/recordings folder. The NPC will follow the actions recorded in the file.
Parameters:
(playbacktype, recordname, flags=0)
playbacktype : The type of the recording to be loaded
recordname : The name of the .rec file (without extension) to run.
flags : The options playback flags for overriding various data in rec file
Return Values:
True on success and null on failure ( file not found or header different version )
Example
function OnNPCEnterVehicle(vehicleid, seatid) { print("I entered vehicle "+vehicleid+" and my seat is "+seatid+"\n"); StartRecordingPlayback(2,"stretch"); }
Related Functions
The following functions may be helpful as they relate to this function in one way or another.