How to make flags and are there global flags?

Basically, how do I add a flag to my objects, for example, whether or not the player has wings, doesn't have wings or has wings that are made of a different material? And is there a way to make global flags that can effect everything in the game?

For example, the "night" flag gets activated and now the "if" script for night runs for everything in the game as well as move objects to other rooms while it is active. Once it isn't active all changes and the objects move back.

I'm not good with code, quite bad even, so I would appreciate if it could be answered step by step in the editor without code.

There are multiple ways:

SetObjectFlagOn (object, "flag name" )
// or
SetObjectFlagOff (object, "flag name")


SetObjectFlagOff(game, "night")
SetObjectFlagOn(player, "wings")

it's the same as:

game.night = false
player.wings = true

Asking for it with an If() script:

if (player.has_wings = true) {

It's the same as:

if (player.has_wings) {

Asking if something is false.

if (player.has_wings = false) {

Is the same as:

if (not player.has_wings) {

There are still more ways to return a true or false value...

Log in to post a reply.