Use a bank, and check if theres any sections in the bank at game start. If theres none, chances are its the players first time. Unfortunately this would also trigger if the players bank resets.. So be careful.
If its the players first time, be sure to add something into the bank to keep track of who's played and who hasn't
Thanks for this! It worked nicely, but is there any way for it to be able to check a Key of a Section in a key? I'm doing Achievements and if I make a separate bank that only checks if the Bank exists, I can see it being easily hackable.
AFAIK, yes there is a way to check with specific keys. Wiki should have some information on that. If you don't want it to be hackable, you're doing to need to do some encryption. But any anti-hack will eventually get hacked.. true story
If you make a condition (compare) and select "Bank" under Label, you can see the whole list of checks you can perform. In case of the Key check, which you're asking for, there are:
When you open a bank you open it for a specific player, thus you cannot check if a key exists "for a specific player". However, you can check for a key in the opened bank so you just open the bank one player at a time, using the same loop as before.
See example:
MeleeInitializationEventsGame-MapinitializationLocalVariablesGOLIATH_NATIONAL_BANK=NoBank<Bank>THE_KEY_TO_AWESOMENESS="THE_KEY_TO_AWESOMENESS"<String(Constant)>ConditionsActionsGeneral-Pickeachintegerfrom1to5,anddo(Actions)ActionsGeneral-If(Conditions)thendo(Actions)elsedo(Actions)If(Statusofplayer(Pickedinteger))==PlayingThenGeneral-If(Conditions)thendo(Actions)elsedo(Actions)If(Bank"GOLIATH_NATIONAL_BANK"existsforplayer(Pickedinteger))==falseThen------- Player does NOT have a bank and has NEVER played this map before------- - Create a new bank for the player------- - Initialize the bank contents for the new player------- - Save the bankElseBank-Openbank"GOLIATH_NATIONAL_BANK"forplayer(Pickedinteger)Variable-SetGOLIATH_NATIONAL_BANK=(Lastopenedbank)------- The bank is now opened for the SPECIFIC player.------- Everything you check for below this point in this bank is tied to this player.General-If(Conditions)thendo(Actions)elsedo(Actions)If(BankGOLIATH_NATIONAL_BANKhasTHE_KEY_TO_AWESOMENESSinsection"whatever_section_you_want")==falseThen------- No keyElse------- Key!Else
How do I check if it's a player's first time playing?
Thanks
@kenxftw: Go
Use a bank, and check if theres any sections in the bank at game start. If theres none, chances are its the players first time. Unfortunately this would also trigger if the players bank resets.. So be careful.
If its the players first time, be sure to add something into the bank to keep track of who's played and who hasn't
@FuzzYD: Go
How can I specify which player? If you look at the action, it goes to All Players.
Here is my Condition using "Bank Key Exists": (Bank (Last opened bank) has "First Timer" in section "Achievements") == false
Here is the Action: Sound - Play UI_Achievement for (All players) (at 100.0% volume, skip the first 0.0 seconds)
@kenxftw: Go
Thanks for this! It worked nicely, but is there any way for it to be able to check a Key of a Section in a key? I'm doing Achievements and if I make a separate bank that only checks if the Bank exists, I can see it being easily hackable.
@kenxftw: Go
AFAIK, yes there is a way to check with specific keys. Wiki should have some information on that. If you don't want it to be hackable, you're doing to need to do some encryption. But any anti-hack will eventually get hacked.. true story
@kenxftw: Go
If you make a condition (compare) and select "Bank" under Label, you can see the whole list of checks you can perform. In case of the Key check, which you're asking for, there are:
and:
The problem I have is that the “Bank Key Exists” is coded differently than “Bank Exists”
(Bank "GOLIATH_NATIONAL_BANK" exists for player (Picked integer)) == false
If you check “Bank Key Exists”, there isn’t a For Player part.
@kenxftw: Go
When you open a bank you open it for a specific player, thus you cannot check if a key exists "for a specific player". However, you can check for a key in the opened bank so you just open the bank one player at a time, using the same loop as before.
See example:
Thank you Kafoso! You are awesome!