Added constructs for checking player movement

Also fixed the "<player.velocity>" construct and reset the player's movement speed in the teacher script in violet city
This commit is contained in:
JappaWakka 2022-06-11 15:01:16 +02:00
parent c6c7ef236d
commit 7eb7805dcf
4 changed files with 9 additions and 3 deletions

View File

@ -25,7 +25,7 @@ Public Class OverworldCamera
Private _scrollSpeed As Single = 0F
Private _scrollDirection As Integer = 1
Private _moved As Single = 0F
Public _moved As Single = 0F
Public LastStepPosition As Vector3 = New Vector3(0, -2, 0)
Public YawLocked As Boolean = False

View File

@ -47,7 +47,11 @@
Case "skin"
Return Core.Player.Skin
Case "velocity"
Return 0F
Return CInt(CType(Screen.Camera, OverworldCamera)._moved)
Case "speed"
Return Screen.Camera.Speed / 0.04F
Case "isrunning"
Return ReturnBoolean(Core.Player.IsRunning)
Case "ismoving"
Return ReturnBoolean(Screen.Camera.IsMoving())
Case "facing"

View File

@ -489,7 +489,9 @@ Namespace ScriptVersion2
r(New ScriptCommand("player", "hasbadge", "bool", {New ScriptArgument("badgeID", ScriptArgument.ArgumentTypes.Int)}.ToList(), "Returns if the player owns a specific Badge.", ",", True))
r(New ScriptCommand("player", "skin", "str", "Returns the current skin the player wears.", ",", True))
r(New ScriptCommand("player", "velocity", "sng", "Returns the player's velocity (steps until the player movement ends).", ",", True))
r(New ScriptCommand("player", "ismoving", "bool", "Returns if the player moves.", ",", True))
r(New ScriptCommand("player", "speed", "sng", "Returns the player's movement speed (divided by 0.04F).", ",", True))
r(New ScriptCommand("player", "isrunning", "bool", "Returns if the player is currently running.", ",", True))
r(New ScriptCommand("player", "ismoving", "bool", "Returns if the player is currently moving.", ",", True))
r(New ScriptCommand("player", "facing", "int", "Returns the direction the player is facing.", ",", True))
r(New ScriptCommand("player", "compass", "str", "Returns ""north"", ""east"", ""south"" or ""east"" depending on the direction the player is facing.", ",", True))
r(New ScriptCommand("player", "money", "int", "Returns the player's money.", ",", True))