Blockland Forums > General Discussion
Any way to detect if a player have opened a certian amount of chests?
(1/2) > >>
Paradon:
I want to make a super mario 64-like gamemode and a way of detecting if the player has opened a certian amount of chests (stars) would be really good for levels and stuff. I'm pretty sure I've already figured out how to let the player save his/her game. (persistence player)
Also, is there a command that shows you how many chests you've opened?
Ephialtes:
There's /treasureStatus to show how many chests you've got and how many there are in total but there's no way in the events to detect how many you'd opened unless it was a single player type deal and you decreased a counter each time a chest was opened and used underflow events to trigger actions.
jes00:
You could use VCE and do
registerSpecialVar("GLOBAL", "numChests", "$TreasureChest::NumChests");
registerSpecialVar(GameConnection, "chestsFound", "%player.client.numFoundTreasureChests");
Paradon:

--- Quote from: Ephialtes on September 11, 2013, 12:22:26 PM ---There's /treasureStatus to show how many chests you've got and how many there are in total but there's no way in the events to detect how many you'd opened unless it was a single player type deal and you decreased a counter each time a chest was opened and used underflow events to trigger actions.

--- End quote ---
Yeah that's the first thing I tought of but it wouldn't let people play together and saving your game wouldn't be possible.


After a couple of minutes of thinking, I've come up with something that might work.
Each chest is worth a point (score), and using VCE I could probably detect how many chests a player has opened using <var:cl:score> or something like that.


--- Quote from: jes00 on September 11, 2013, 12:26:36 PM ---You could use VCE and do
registerSpecialVar("GLOBAL", "numChests", "$TreasureChest::NumChests");
registerSpecialVar(GameConnection, "chestsFound", "%player.client.numFoundTreasureChests");

--- End quote ---

I might do this if all else fails.


Does anyone know if persistence player works works in a game mode, and if it does, does it save the amound of chests you've collected?
Ephialtes:

--- Quote from: Paradon on September 11, 2013, 12:37:05 PM ---Does anyone know if persistence player works works in a game mode, and if it does, does it save the amound of chests you've collected?

--- End quote ---

Only if it's enabled by the gamemode, as far as I know.
Navigation
Message Index
Next page

Go to full version