Author Topic: Any way to detect if a player have opened a certian amount of chests?  (Read 1327 times)

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?

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.

You could use VCE and do
registerSpecialVar("GLOBAL", "numChests", "$TreasureChest::NumChests");
registerSpecialVar(GameConnection, "chestsFound", "%player.client.numFoundTreasureChests");

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.
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.

You could use VCE and do
registerSpecialVar("GLOBAL", "numChests", "$TreasureChest::NumChests");
registerSpecialVar(GameConnection, "chestsFound", "%player.client.numFoundTreasureChests");


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?
« Last Edit: September 11, 2013, 11:41:42 AM by Paradon »

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?

Only if it's enabled by the gamemode, as far as I know.

<var:cl:score> doesn't seem to work for me, is there any certian addon I need for it to work?

You can use a points system, that adds one point to a specific variable that you created, when you click each brick. Not minigame score, just a variable that is for a specific player.

I don't do VCE but obviously there are variables you can make that store data, basic coding, lol.

use the onchestopened event and have onchestopened > client > modvariable > world1Chests + 1