scardoc;Core

scardoc;Core
Functions

 Core_AddPlayerToTeam( PlayerID player, Team teams_table )
 

让玩家加入指定队伍【功能:玩家加入队伍】

Will remove the player from his previous team. If you pass in nil for newTeam, will add to a new empty team

  Source: [E:\P4Share\engine\assets\engine\scar\core.scar] (1012) 

 Core_Compare( Number value1, Number value2, COMPARISON comparator )
 

使用指定的比较器比较两个值【功能:值比较】

  Source: [E:\P4Share\engine\assets\engine\scar\core.scar] (1133) 

 Core_GetActiveTeamCount( )
 

返回剩余未淘汰的队伍数量【功能:获取存活队伍数】

  Source: [E:\P4Share\engine\assets\engine\scar\core.scar] (687) 

 Core_GetPlayerName( PlayerID player )
 

返回指定玩家的名称【功能:获取玩家名称】

  Source: [E:\P4Share\engine\assets\engine\scar\core.scar] (557) 

 Core_GetPlayersTableEntry( PlayerID player )
 

返回PLAYERS表中指定条目的表引用【功能:获取玩家表条目引用】

  Source: [E:\P4Share\engine\assets\engine\scar\core.scar] (571) 

 Core_GetPlayersTableEntryFromIndex( Integer playerIndex )
 

返回PLAYERS表中指定索引的表引用【功能:按索引获取玩家表条目引用】

  Source: [E:\P4Share\engine\assets\engine\scar\core.scar] (584) 

 Core_GetPlayerTeamsEntry( PlayerID player )
 

返回玩家TEAMS表中条目的表引用【功能:获取玩家队伍表条目引用】

  Source: [E:\P4Share\engine\assets\engine\scar\core.scar] (611) 

 Core_GetTeamsEntryFromIndex( Integer index )
 

返回Teams表中对应给定teamIndex的条目【功能:按索引获取队伍表条目】

NOTE: Use the teams table's .id entry - not the actual index of the table.

  Source: [E:\P4Share\engine\assets\engine\scar\core.scar] (623) 

 Core_IsModuleRegistered( String name )
 

如果模块已注册用于委托调用则返回true,如果委托调用被禁用则返回false,如果模块不在模块注册表中则返回nil【功能:检查模块注册状态】

  Source: [E:\P4Share\engine\assets\engine\scar\core.scar] (477) 

 Core_IsPlayerEliminated( PlayerID player )
 

如果玩家已被淘汰则返回true【功能:检查玩家淘汰状态】

  Source: [E:\P4Share\engine\assets\engine\scar\core.scar] (969) 

 Core_IsPlayerOnPlayerTeam( )
 

如果两个指定玩家在同一队伍则返回true【功能:检查玩家同队】

  Source: [E:\P4Share\engine\assets\engine\scar\core.scar] (1001) 

 Core_IsPlayersTableEntryValid( PlayerID player )
 

如果PLAYERS表包含指定玩家则返回true【功能:验证玩家表条目有效性】

  Source: [E:\P4Share\engine\assets\engine\scar\core.scar] (597) 

 Core_IsTeamEliminated( Team teams_table )
 

如果队伍已被淘汰则返回true。当队伍中所有玩家都被淘汰时,该队伍被视为淘汰【功能:检查队伍淘汰状态】

  Source: [E:\P4Share\engine\assets\engine\scar\core.scar] (979) 

 Core_IsTeamsEntryIndexValid( Integer index )
 

如果teamIndex是Teams表中的有效索引则返回true【功能:验证队伍索引有效性】

NOTE: Use the teams table's .id entry - not the actual index of the table.

  Source: [E:\P4Share\engine\assets\engine\scar\core.scar] (637) 

 Core_OnGameOver( )
 

调用此函数通知其他模块(通过其***_OnGameOver()回调)比赛即将结束【功能:游戏结束通知】

Modules typically implement this for cleanup purposes (i.e. remove rules and UI elements) prior to the match end UI.

  Source: [E:\P4Share\engine\assets\engine\scar\core.scar] (993) 

 Core_RegisterModule( String name )
 

注册脚本模块用于委托调用。名称应为该模块中所有委托函数使用的前缀。需要在模块脚本的*全局*作用域中调用,使用模块的前缀名称;使用此函数代替Scar_AddInit【功能:注册模块】

For example, if you call Core_RegisterModule("MySystem") then any delegate functions in your script such as "MySystem_OnGameSetup" or "MySystem_OnInit" will be called at the appropriate time during the game initialization process (after the Project delegates but before the Mission delegates).

  Source: [E:\P4Share\engine\assets\engine\scar\core.scar] (445) 

 Core_RemovePlayerFromPlayersTable( PlayerID player )
 

从玩家表和队伍表中移除玩家【功能:移除玩家】

  Source: [E:\P4Share\engine\assets\engine\scar\core.scar] (649) 

 Core_RevealFOWOnEliminationEnabled( )
 

返回"淘汰时显示战争迷雾"比赛选项的值【功能:获取淘汰显示迷雾选项】

  Source: [E:\P4Share\engine\assets\engine\scar\core.scar] (1117) 

 Core_SetDefaultDefeatPresentation( Table presentationTable )
 

设置被淘汰玩家的默认展示表【功能:设置失败展示】

  Source: [E:\P4Share\engine\assets\engine\scar\core.scar] (947) 

 Core_SetDefaultVictoriousPresentation( function presentationFunction )
 

设置获胜玩家的默认展示函数【功能:设置胜利展示】

  Source: [E:\P4Share\engine\assets\engine\scar\core.scar] (866) 

 Core_SetMutualPlayerRelationship( PlayerID player1, PlayerID player2, Integer relationship )
 

设置两个玩家之间的关系【功能:设置玩家关系】

  Source: [E:\P4Share\engine\assets\engine\scar\core.scar] (704) 

 Core_SetMutualRelationship( PlayerID/Table player/teams_table, PlayerID/Table player/teams_table, Relationship relationship )
 

设置两个条目之间的关系【功能:设置条目关系】

NOTE: You should generally be setting Team to Team only. Valid Relationships: R_NEUTRAL, R_ALLY, R_ENEMY, R_UNDEFINED

  Source: [E:\P4Share\engine\assets\engine\scar\core.scar] (717) 

 Core_SetPlayerDefeated( PlayerID player, function presentationFunction, winReason reason )
 

将玩家设置为失败状态【功能:设置玩家失败】

  Source: [E:\P4Share\engine\assets\engine\scar\core.scar] (888) 

 Core_SetPlayerVictorious( PlayerID player, function presentationFunction, winReason reason )
 

将玩家设置为比赛获胜者【功能:设置玩家胜利】

  Source: [E:\P4Share\engine\assets\engine\scar\core.scar] (788) 

 Core_SetTeamDefeated( Team teams_table, Table presentationTable )
 

设置队伍是否失败【功能:设置队伍失败】

  Source: [E:\P4Share\engine\assets\engine\scar\core.scar] (954) 

 Core_SetTeamVictorious( Team teams_table, function presentationFunction, winReason reason )
 

将队伍设置为比赛获胜者【功能:设置队伍胜利】

  Source: [E:\P4Share\engine\assets\engine\scar\core.scar] (874) 

 Core_UnregisterModule( String name )
 

从委托调用系统中移除脚本模块【功能:注销模块】

This is usually used for a module to remove itself if it decided it isn't needed (i.e. a game mode that isn't relevant given the map). Please don't have modules removing each other!

  Source: [E:\P4Share\engine\assets\engine\scar\core.scar] (460) 

 Core_WinnerlessGameOver( function presentationFunction, winReason reason )
 

将游戏设置为没有明确获胜者的游戏结束状态【功能:无胜者结束游戏】

  Source: [E:\P4Share\engine\assets\engine\scar\core.scar] (833) 

 Event_Delay( Real seconds )
 

暂停指定的时间。此函数必须仅在NISlet事件中从CTRL对象调用【功能:事件延迟】

See Event_Start for more information on NISlet events.

  Source: [E:\P4Share\engine\source\runtime\simulation\public\simulation\lua\scar\Scar.cpp] (1684) 

 Event_IsBeingSkipped( )
 

如果事件正在被跳过则返回true【功能:检查事件跳过】

  Source: [E:\P4Share\engine\source\runtime\simulation\public\simulation\lua\scar\Scar.cpp] (1665) 

 Event_Skip( )
 

立即完成事件执行(所有Wait()调用将被忽略)【功能:跳过事件】

  Source: [E:\P4Share\engine\source\runtime\simulation\public\simulation\lua\scar\Scar.cpp] (1659) 

 Event_Start( LuaFunction eventFunction, Integer int )
 

启动事件。事件将在本帧所有规则评估完成后才会启动【功能:启动事件】

We allow saving events in multiplayer so please don't put any non-UI events in multiplayer Running events are not saved at all.

  Source: [E:\P4Share\engine\source\runtime\simulation\public\simulation\lua\scar\Scar.cpp] (1644) 

 Event_StartEx( LuaFunction eventFunction, Integer int, LuaFunction onComplete )
 

以与Event_Start相同的方式启动事件,但在事件结束时调用用户定义的函数【功能:启动事件并回调】

  Source: [E:\P4Share\engine\source\runtime\simulation\public\simulation\lua\scar\Scar.cpp] (1650) 

 Scar_AddInit( LuaFunction f )
 

向SCAR系统注册初始化函数【功能:注册初始化函数】

This init function will be called when scar is started up.\n **Important: Make sure you do not register two functions with the same name; the init function names should be unique.

  Source: [E:\P4Share\engine\source\runtime\simulation\public\simulation\lua\scar\Scar.cpp] (1560) 

 Scar_InitComplete( )
 

让Lua通知游戏初始化已完成【功能:标记初始化完成】

  Source: [E:\P4Share\engine\source\runtime\simulation\public\simulation\lua\scar\Scar.cpp] (1608) 

 Scar_InitExists( LuaFunction f )
 

如果存在初始化函数则返回true【功能:检查初始化函数存在】

  Source: [E:\P4Share\engine\source\runtime\simulation\public\simulation\lua\scar\Scar.cpp] (1599) 

 Scar_RemoveInit( LuaFunction f )
 

注销通过Scar_AddInit注册的初始化函数【功能:注销初始化函数】

  Source: [E:\P4Share\engine\source\runtime\simulation\public\simulation\lua\scar\Scar.cpp] (1587)