ID:274503
 
Lol,I was just wondering if you can make to MASTER KEYS.I put:

var/const/MASTER_KEY = "Kappa the Imp" || "Chibi"

No errors.But it didn't work.This is a question I suggest Spuzzum should know.

-Kappa the Imp
umm maybe replace the || with ,? does that work?
No.Goot idea though.

-Kappa the Imp
In response to Kappa the Imp
You sure? I don't know if it works but DM isnt giving errors

var/const/MASTER_KEY = "Kappa the Imp, Chibi"

that should be good
Yes you can, I have done it. Take a look at this

The gm var section:

var/const/MASTER_KEY = "Jotdaniel"
var/const/MASTER_KEY2 = "(SOMEONE ELSE NOT ME)"

Now here is the gm check down near the bottom, ive taken out the original check becuase i wanted all my gms to be chosen by me and coded in and ive also taken out the add gm and temp gm verbs.

Gm check:

mob/proc/GMCheck()

return 0

mob/proc/AdminGMCheck()

return 0

mob/proc/MasterGMCheck()
if(key == MASTER_KEY) return 1
if(key == MASTER_KEY2) retrn 1
return 0

Do you see what i did there?

If so then you can see how you could use this to easily code the key's in instead of adding them on each server like you do when you use the add gm verb.

Hope this helped.
Kappa the Imp wrote:
Lol,I was just wondering if you can make to MASTER KEYS.I put:

> var/const/MASTER_KEY = "Kappa the Imp" || "Chibi"
>

No errors.But it didn't work.This is a question I suggest Spuzzum should know.

-Kappa the Imp

That Spuzzum should know what? That the BYOND compiler works fine but doesn't read minds and interpret symbols the way you think they should be interpreted?

Variables (especially constants) have to be initialized with a constant value. A condition (like an "or" question) is not a constant.

Quick lesson in logical operators:

|| means "logical or". It returns a value of 1 (true) if either the condition on the left side is true or the condition on the right side is true. When you say:

var/const/MASTER_KEY = "Kappa the Imp" || "Chibi"

You're saying

MASTER_KEY equals 1 if "Kappa the Imp" isn't 0, null, or "" and/or "Chibi" isn't 0, null, or "" at the time the game is compiled.

Since "Kappa the Imp" definitely isn't 0, null, or "", the compiler goes no further and reads your statement as:

var/const/MASTER_KEY = 1

It doesn't turn up an error because there's nothing wrong with setting a const to 1. The error is not in the code... it is in the coder.
In response to Jotdaniel
:) Thanks Jot!

-Kappa the Imp