Added command @Player.RemoveItemData()

@Player.RemoveItemData(LevelPath,ItemIndex)
Makes the specified item index of the specified map spawn again after it has been found.
LevelPath (str) - Path to the map file (including .dat) relative to "Content\Maps\"
ItemIndex (int) - Index of the ItemObject on the map (first argument in the object's AdditionalValue)
This commit is contained in:
JappaWakka 2024-07-14 17:29:13 +02:00
parent facfbc9f4e
commit b53ee169e5
2 changed files with 14 additions and 0 deletions

View File

@ -451,6 +451,19 @@
Dim doWalkAnimation As Boolean = CBool(argument)
Core.Player.DoWalkAnimation = doWalkAnimation
IsReady = True
Case "removeitemdata"
Dim IDs() As String = Core.Player.ItemData.Split(CChar(","))
Dim LevelPath As String = argument.GetSplit(0, ",")
Dim LevelItemIndex As String = argument.GetSplit(1, ",")
If IDs.Contains((LevelPath.ToLower() & "|" & LevelItemIndex).ToLower()) = True Then
If Core.Player.ItemData.Split(",").Count = 1 Then
Core.Player.ItemData = ""
Else
Core.Player.ItemData = Core.Player.ItemData.Replace(("," & (LevelPath.ToLower() & "|" & LevelItemIndex).ToLower()).ToString, "")
End If
End If
IsReady = True
Case "quitgame"
'Reset VoltorbFlipScreen's Variables
VoltorbFlip.VoltorbFlipScreen.CurrentLevel = 1

View File

@ -535,6 +535,7 @@ Namespace ScriptVersion2
r(New ScriptCommand("player", "setopacity", {New ScriptArgument("opacity", ScriptArgument.ArgumentTypes.Sng)}.ToList(), "Sets the player entity's opacity."))
r(New ScriptCommand("player", "QuitGame", {New ScriptArgument("doFade", ScriptArgument.ArgumentTypes.Bool, True, "")}.ToList(), "Quits the game and goes back to the Main Menu (with optionally a fade out and in)."))
r(New ScriptCommand("player", "DoWalkAnimation", {New ScriptArgument("walkAnimation", ScriptArgument.ArgumentTypes.Bool)}.ToList(), "Enables or disables the player's walking animation when walking or during a @player.move command."))
r(New ScriptCommand("player", "RemoveItemData", {New ScriptArgument("levelPath", ScriptArgument.ArgumentTypes.Str), New ScriptArgument("itemIndex", ScriptArgument.ArgumentTypes.Str)}.ToList(), "Makes the specified item index of the specified map spawn again after it has been found."))
' Constructs:
r(New ScriptCommand("player", "position", "sngarr", {New ScriptArgument("coordinate", ScriptArgument.ArgumentTypes.StrArr, {"x", "y", "z"}, True, "")}.ToList(), "Returns the position of the player. The normal coordinate combination is ""X,Y,Z"".", ",", True))