You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/EmmyLua/core-games-api.def.lua
+109-5Lines changed: 109 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -186,7 +186,7 @@ function AbilityTarget.New() end
186
186
--- @classAnimatedMesh:CoreMesh @AnimatedMesh objects are skeletal CoreMeshes with parameterized animations baked into them. They also have sockets exposed to which any CoreObject can be attached.
187
187
--- @fieldanimationEventEvent @Some animations have events specified at important points of the animation (e.g. the impact point in a punch animation). This event is fired with the animated mesh that triggered it, the name of the event at those points, and the name of the animation itself.
188
188
--- @fieldanimationStancestring @The stance the animated mesh plays.
189
-
--- @fieldanimationStancePlaybackRatenumber @The playback rate for the animation stance being played. Negative values will play the animation in reverse.
189
+
--- @fieldanimationStancePlaybackRatenumber @The playback rate for the animation stance being played.
190
190
--- @fieldanimationStanceShouldLoopboolean @If `true`, the animation stance will keep playing in a loop. If `false` the animation will stop playing once completed.
191
191
--- @fieldplaybackRateMultipliernumber @Rate multiplier for all animations played on the animated mesh. Setting this to `0` will stop all animations on the mesh.
192
192
--- @fieldtypestring
@@ -1513,6 +1513,27 @@ NetReference = {}
1513
1513
--- @classNetworkContext:CoreObject @NetworkContext is a CoreObject representing a special folder containing client-only, server-only, or static objects.. . They have no properties or functions of their own, but inherit everything from CoreObject.
1514
1514
--- @fieldtypestring
1515
1515
localNetworkContextInstance= {}
1516
+
--- Spawns an instance of an asset into the world as a child of a networked Static Context, also spawning copies of the asset on clients without the overhead of additional networked objects. Any object spawned this way cannot be modified, as with other objects within a Static Context, but they may be destroyed by calling `DestroySharedAsset()` on the same `NetworkContext` instance. Raises an error if called on a non-networked Static Context or a Static Context which is a descendant of a Client Context or Server Context. Optional parameters can specify a transform for the spawned object.
1517
+
---
1518
+
--- Supported parameters include:
1519
+
---
1520
+
--- `position (Vector3)`: Position of the spawned object, relative to the parent NetworkContext.
1521
+
---
1522
+
--- `rotation (Rotation or Quaternion)`: Local rotation of the spawned object.
1523
+
---
1524
+
--- `scale (Vector3 or number)`: Scale of the spawned object, may be specified as a `Vector3` or as a `number` for uniform scale.
1525
+
---
1526
+
--- `transform (Transform)`: The full transform of the spawned object. If `transform` is specified, it is an error to also specify `position`, `rotation`, or `scale`.
1527
+
--- @overloadfun(assetId: string): CoreObject
1528
+
--- @paramassetIdstring
1529
+
--- @paramoptionalParameterstable
1530
+
--- @returnCoreObject
1531
+
functionNetworkContextInstance:SpawnSharedAsset(assetId, optionalParameters) end
1532
+
1533
+
--- Destroys an object that was spawned using `SpawnSharedAsset()`. Raises an error if `coreObject` was not created by this `NetworkContext`.
1534
+
--- @paramcoreObjectCoreObject
1535
+
functionNetworkContextInstance:DestroySharedAsset(coreObject) end
1536
+
1516
1537
--- @paramtypeNamestring
1517
1538
--- @returnboolean
1518
1539
functionNetworkContextInstance:IsA(typeName) end
@@ -1971,6 +1992,10 @@ function PlayerInstance:GetPrivateNetworkedData(key) end
1971
1992
--- @returntable
1972
1993
functionPlayerInstance:GetPrivateNetworkedDataKeys() end
1973
1994
1995
+
--- Returns the number of bytes used by private networked data on this player. Returns 0 if private networked data is not available.
1996
+
--- @returnnumber
1997
+
functionPlayerInstance:GetPrivateNetworkedDataSize() end
1998
+
1974
1999
--- @paramtypeNamestring
1975
2000
--- @returnboolean
1976
2001
functionPlayerInstance:IsA(typeName) end
@@ -3234,6 +3259,7 @@ VoiceChatChannel = {}
3234
3259
--- @fieldspreadDecreaseSpeednumber @Speed at which the spread contracts back from its current value to the minimum cone size.
3235
3260
--- @fieldspreadIncreasePerShotnumber @Amount the spread increases each time the Weapon attacks.
3236
3261
--- @fieldspreadPenaltyPerShotnumber @Cumulative penalty to the spread size for successive attacks. Penalty cools off based on `spreadDecreaseSpeed`.
3262
+
--- @fieldattackSoundTemplateIdstring @Asset reference for a sound effect to be played each time the Weapon attacks.
3237
3263
--- @fieldtypestring
3238
3264
localWeaponInstance= {}
3239
3265
--- Informs whether the Weapon is able to attack or not.
@@ -3629,7 +3655,7 @@ function Game.IsAcceptingPlayers() end
functionGame.TransferAllPlayersToGame(gameCollectionEntry) end
3631
3657
3632
-
--- Similar to `Player:TransferToGame()`, transfers the specified list of players to the game specified by the passed in game ID. Note that if a party leader is included in the list of players to transfer, the "Play as Party" party setting is ignored, and other party members will only be transfered if also included in the list of players. Does not work in preview mode or in games played locally.
3658
+
--- Similar to `Player:TransferToGame()`, transfers the specified list of players to the game specified by the passed in game ID. Note that if a party leader is included in the list of players to transfer, the "Play as Party" party setting is ignored, and other party members will only be transferred if also included in the list of players. Does not work in preview mode or in games played locally.
@@ -3646,7 +3672,7 @@ function Game.TransferPlayersToGame(gameCollectionEntry, players) end
3646
3672
--- @paramoptionalParamstable
3647
3673
functionGame.TransferAllPlayersToScene(sceneName, optionalParams) end
3648
3674
3649
-
--- Similar to `Player:TransferToScene()`, transfers the specified list of players to the scene specified by the passed in scene name. Note that if a party leader is included in the list of players to transfer, the "Play as Party" party setting is ignored, and other party members will only be transfered if also included in the list of players. Does not work in preview mode or in games played locally.
3675
+
--- Similar to `Player:TransferToScene()`, transfers the specified list of players to the scene specified by the passed in scene name. Note that if a party leader is included in the list of players to transfer, the "Play as Party" party setting is ignored, and other party members will only be transferred if also included in the list of players. Does not work in preview mode or in games played locally.
3650
3676
---
3651
3677
--- The following optional parameters are supported:
3652
3678
---
@@ -3661,6 +3687,10 @@ function Game.TransferPlayersToScene(sceneName, players, optionalParams) end
3661
3687
--- @returnstring
3662
3688
functionGame.GetCurrentSceneName() end
3663
3689
3690
+
--- Returns the ID of the current game. When called in preview mode, returns `nil` if the game has not been published, otherwise returns the published game ID.
3691
+
--- @returnstring
3692
+
functionGame.GetCurrentGameId() end
3693
+
3664
3694
--- @classInput
3665
3695
localInputInstance= {}
3666
3696
--- @classGlobalInput
@@ -3744,6 +3774,76 @@ function Storage.GetPlayerData(player) end
3744
3774
--- @returnStorageResultCode|string
3745
3775
functionStorage.SetPlayerData(player, data) end
3746
3776
3777
+
--- Requests the concurrent player data associated with the specified player. This function may yield until data is available. Returns the data (`nil` if not available), a result code, and an optional error message if an error occurred.
3778
+
--- @paramplayerIdstring
3779
+
--- @returntable|StorageResultCode|string
3780
+
functionStorage.GetConcurrentPlayerData(playerId) end
3781
+
3782
+
--- Updates the concurrent player data associated with the specified player. This function retrieves the most recent copy of the player's data, then calls the creator-provided `callback` function with the data table as a parameter. `callback` is expected to return the player's updated data table, which will then be saved. This function yields until the entire process is complete, returning a copy of the player's updated data (`nil` if not available), a result code, and an optional error message if an error occurred.
3783
+
--- @paramplayerIdstring
3784
+
--- @paramcallbackfunction
3785
+
--- @returntable|StorageResultCode|string
3786
+
functionStorage.SetConcurrentPlayerData(playerId, callback) end
3787
+
3788
+
--- Requests the concurrent player data associated with the specified player and storage key. The storage key must be of type `CONCURRENT_SHARED_PLAYER_STORAGE`. This function may yield until data is available. Returns the data (`nil` if not available), a result code, and an optional error message if an error occurred.
3789
+
--- @paramnetReferenceNetReference
3790
+
--- @paramplayerIdstring
3791
+
--- @returntable|StorageResultCode|string
3792
+
functionStorage.GetConcurrentSharedPlayerData(netReference, playerId) end
3793
+
3794
+
--- Updates the concurrent player data associated with the specified player and storage key. The storage key must be of type `CONCURRENT_SHARED_PLAYER_STORAGE`. This function retrieves the most recent copy of the player's data, then calls the creator-provided `callback` function with the data table as a parameter. `callback` is expected to return the player's updated data table, which will then be saved. This function yields until the entire process is complete, returning a copy of the player's updated data (`nil` if not available), a result code, and an optional error message if an error occurred.
3795
+
--- @paramnetReferenceNetReference
3796
+
--- @paramplayerIdstring
3797
+
--- @paramcallbackfunction
3798
+
--- @returntable|StorageResultCode|string
3799
+
functionStorage.SetConcurrentSharedPlayerData(netReference, playerId, callback) end
3800
+
3801
+
--- Requests the concurrent data associated with the given storage key. The storage key must be of type `CONCURRENT_CREATOR_STORAGE`. This data is player- and game-agnostic. This function may yield until data is available. Returns the data (`nil` if not available), a result code, and an optional error message if an error occurred.
3802
+
--- @paramnetReferenceNetReference
3803
+
--- @returntable|StorageResultCode|string
3804
+
functionStorage.GetConcurrentCreatorData(netReference) end
3805
+
3806
+
--- Updates the concurrent data associated with the given storage key. The storage key must be of type `CONCURRENT_CREATOR_STORAGE`. This data is player- and game-agnostic. This function retrieves the most recent copy of the creator data, then calls the creator-provided `callback` function with the data table as a parameter. `callback` is expected to return the updated data table, which will then be saved. This function yields until the entire process is complete, returning a copy of the updated data (`nil` if not available), a result code, and an optional error message if an error occurred.
3807
+
--- @paramnetReferenceNetReference
3808
+
--- @paramcallbackfunction
3809
+
--- @returntable|StorageResultCode|string
3810
+
functionStorage.SetConcurrentCreatorData(netReference, callback) end
3811
+
3812
+
--- Listens for any changes to the concurrent data associated with `playerId` for this game. Calls to `Storage.SetConcurrentPlayerData()` from this or other game servers will trigger this listener. The listener function parameters should be: `string` player ID, `table` player data. Accepts any number of additional arguments after the listener function, those arguments will be provided, in order, after the `table` argument. Returns an EventListener which can be used to disconnect from the event or check if the event is still connected.
3813
+
--- @paramplayerIdstring
3814
+
--- @paramcallbackfunction
3815
+
--- @returnEventListener
3816
+
functionStorage.ConnectToConcurrentPlayerDataChanged(playerId, callback, ...) end
3817
+
3818
+
--- Listens for any changes to the concurrent shared data associated with `playerId` and `concurrentSharedStorageKey`. Calls to `Storage.SetConcurrentSharedPlayerData()` from this or other game servers will trigger this listener. The listener function parameters should be: `NetReference` storage key, `string` player ID, `table` shared player data. Accepts any number of additional arguments after the listener function, those arguments will be provided, in order, after the `table` argument. Returns an EventListener which can be used to disconnect from the event or check if the event is still connected.
3819
+
--- @paramnetReferenceNetReference
3820
+
--- @paramplayerIdstring
3821
+
--- @paramcallbackfunction
3822
+
--- @returnEventListener
3823
+
functionStorage.ConnectToConcurrentSharedPlayerDataChanged(netReference, playerId, callback, ...) end
3824
+
3825
+
--- Listens for any changes to the concurrent data associated with `concurrentCreatorStorageKey`. Calls to `Storage.SetConcurrentCreatorData()` from this or other game servers will trigger this listener. The listener function parameters should be: `NetReference` storage key, `table` creator data. Accepts any number of additional arguments after the listener function, those arguments will be provided, in order, after the `table` argument. Returns an EventListener which can be used to disconnect from the event or check if the event is still connected.
3826
+
--- @paramnetReferenceNetReference
3827
+
--- @paramcallbackfunction
3828
+
--- @returnEventListener
3829
+
functionStorage.ConnectToConcurrentCreatorDataChanged(netReference, callback, ...) end
3830
+
3831
+
--- Returns `true` if this server has a pending call to `Storage.SetConcurrentPlayerData()` either waiting to be processed or actively running for the specified player ID.
3832
+
--- @paramplayerIdstring
3833
+
--- @returnboolean
3834
+
functionStorage.HasPendingSetConcurrentPlayerData(playerId) end
3835
+
3836
+
--- Returns `true` if this server has a pending call to `Storage.SetConcurrentSharedPlayerData()` either waiting to be processed or actively running for the specified player ID and shared storage key.
3837
+
--- @paramnetReferenceNetReference
3838
+
--- @paramplayerIdstring
3839
+
--- @returnboolean
3840
+
functionStorage.HasPendingSetConcurrentSharedPlayerData(netReference, playerId) end
3841
+
3842
+
--- Returns `true` if this server has a pending call to `Storage.SetConcurrentCreatorData()` either waiting to be processed or actively running for the specified creator storage key.
3843
+
--- @paramnetReferenceNetReference
3844
+
--- @returnboolean
3845
+
functionStorage.HasPendingSetConcurrentCreatorData(netReference) end
3846
+
3747
3847
--- Returns the shared player data associated with `player` and `sharedStorageKey`. This returns a copy of the data that has already been retrieved for the player, so calling this function does not incur any additional network cost. Changes to the data in the returned table will not be persisted without calling `Storage.SetSharedPlayerData()`.
3748
3848
--- @paramsharedStorageKeyNetReference
3749
3849
--- @paramplayerPlayer
@@ -3982,11 +4082,11 @@ function World.FindObjectsByType(typeName) end
3982
4082
---
3983
4083
--- `rotation (Rotation or Quaternion)`: Rotation of the spawned object.
3984
4084
---
3985
-
--- `scale (Vector3)`: Scale of the spawned object.
4085
+
--- `scale (Vector3 or number)`: Scale of the spawned object, may be specified as a `Vector3` or as a `number` for uniform scale.
3986
4086
---
3987
4087
--- `transform (Transform)`: The full transform of the spawned object. If `transform` is specified, it is an error to also specify `position`, `rotation`, or `scale`.
3988
4088
---
3989
-
--- `networkContext (NetworkContext)`: Overrides the network context of the spawned object. This may be used, for example, to spawn networked or static objects from a server only context, or client-only objects from a client script running in a static context, but it cannot spawn client only objects from a server script or networked objects from a client script. If an invalid context is specified, an error will be raised.
4089
+
--- `networkContext` ([NetworkContextType](../api/enums#networkcontexttype)): Overrides the network context of the spawned object. This may be used, for example, to spawn networked or static objects from a server only context, or client-only objects from a client script running in a static context, but it cannot spawn client only objects from a server script or networked objects from a client script. If an invalid context is specified, an error will be raised.
3990
4090
---
3991
4091
--- `name (string)`: Set the name of the spawned object.
3992
4092
---
@@ -4247,6 +4347,9 @@ MovementMode = {
4247
4347
NetReferenceType= {
4248
4348
LEADERBOARD=1,
4249
4349
SHARED_STORAGE=2,
4350
+
SHARED_PLAYER_STORAGE=2,
4351
+
CONCURRENT_SHARED_PLAYER_STORAGE=4,
4352
+
CONCURRENT_CREATOR_STORAGE=5,
4250
4353
CREATOR_PERK=3,
4251
4354
UNKNOWN=0,
4252
4355
}
@@ -4323,6 +4426,7 @@ StorageResultCode = {
4323
4426
FAILURE=2,
4324
4427
STORAGE_DISABLED=1,
4325
4428
EXCEEDED_SIZE_LIMIT=3,
4429
+
REQUEST_ALREADY_QUEUED=4,
4326
4430
}
4327
4431
--- @classTaskStatus @Indicates the status of a script `Task`.
0 commit comments