=========== GMDiz Engine actions list =======================
================ for engine 1.04 ============================



--------- Contents ------------------------------------------

[01] Basic information
[02] General actions
[03] General variables
[04] Special objects
[05] GM61 - GM81 windows version actions



--------- [01] Basic information ----------------------------

Item -> Detector -> Unlockable   structure:
	Item       - you collect them and have in inventory
	Detector   - activates item object ("use" action) and serves as active drop zone
	Unlockable - object that appears (or disappears) after item use

script switchbox() changes compatibility with other game maker versions:
global.StudioMode
	"gm6" -> game maker 6.1 mode
	"gm81" -> game maker 7,8,8.1 mode
	"win", "html5", "droid" -> studio windows/HTML5/android modes

global.StartNewAudioEngine
	'true' -> (try to) use new audio engine (studio only!)

global.GameSaveMode
	1 -> use gamemaker saving functions (windows exe only, 1 saveslot)
	2 -> saving to ini file (any system, 3+ saveslots)
	mode 2 is very primitive and is not very flexible. In some complex situations items
	may "stick" to some positions, levers-reset themselves (only happens when using one
	item on many detectors and may happen when transporting item from other actions)
	on some game maker 8.1 versions mode 2 may not work correctly (ord() problem)

global.UseSaveExport
	'true' -> allow player to copy/paste savegame information (by pressing E)
		  this works only with slot1 !

global.debugmode
	true -> debug mode (also shows word "DEBUG" in upper right game window corner)

Debug mode enables:
. Mouse teleporter (point with mouse then press T) (works with F and V)
. Full room zoom (press F)
. Block viewer (press Y)
. Item magnet (press I)
. Mouse room viewer (press V)

[GM61-81 only] When in graphics menu selected "interpolation off" you may get graphics glitches.
Apparently not all computers handle surfaces with no problems and even if they usually do, if the video memory is messed up, it'll glitch until the computer is being restarted.
More:
http://gmc.yoyogames.com/index.php?showtopic=411965

When finishing game you can hide yellow room lines by making invisible background0

Object Ob_Controller must be in title room!

variable Ob_Controller.compiler holds text  shown when pressed F3
	set to "" to disable "compiled with...." text

It is recommended not to delete resources from game but rename, change or duplicate

run_obs() script:
	when compiler shows error (studio) -> delete all text in this script or
	make it comment (these actions unused in HTML5)

get_string_async_alt(string, default)
	when compiler shows error (gm6-gm81) -> delete all text in this script or
	make it comment (used in HTML5(studio) only)

url_open_adv(helpfilename)
	when compiler shows error: make adjustments or make it comment



--------- [02] General actions ------------------------------

optimise_instances()
	instance number optimiser (disabler)
	(left 9 rooms around character + frame (upper) zone + outside the room(location))
	make sure instances you need always are in this zone
	it is recommended to not let moving instances get out of "their" room or
	they may get "lost"

goto_next_location()
	this moves player to next location (GM room) and preserves items in inventory
	player will stay at current position or moves to Ob_DizzyStart position 
	this is simplified room_goto_complex(room) version for use with item-detector collision
	it also waits for opened dialogs to close
	ALWAYS use this instead of room_goto()

goto_other_location(location,room_save_index,x_start,y_start)
	this script moves player to 'location' (any GM room except Start room)
	room_save_index is used in gamesave mechanism and for Location1 is 1, for Location2 is 2
	save_index cannot be bigger than 127
	x_start,y_start can be used when returning 'one(some) location(s) back' with different
	starting position. Use -1,-1 to not change position (or use Ob_DizzyStart position)
	this script  preserves items in inventory


game_restart_complex()
	always use this instead of room_restart()

Dontdrop(itemID)
	this script has list of items that you cannot drop on clouds
	and returns true or false

System_texts_init()
	this script has texts used in system (useful for translation)

Show_Dialog("text",color,centered)
	shows talk text:
	color -> frame color (text color -> variable global.text_color)
	centered=0 -> random position on screen(around center), 1 -> use centering
	static text (centered): max 24 characters, 12 lines
	talk text(random position): max 22 characters, 10 lines

Show_Dialog(data,type,0)
	shows other texts:
	type=c_action() -> opens twocolored action textbox (data=>text) [always centered]
	type=c_option() -> opens options window (data=menu number in
			   scripts 'Menu' and 'MAction') [always centered]
	type=c_inventory() -> opens inventory (data=0) [fixed size and position]

Show_Question(menu)
	this is simplified Show_Dialog() version for use when talking
	still you have to define question structure in scripts Menu() and MAction()
	question text must fit in 1 line
	you can use Show_Question() after Show_Dialog()
	but question will appear when all other texts will be closed

Menu(number)	and Question(number)
	this script has texts for menus and questions
	generates menu contents (texts)
	Menu()->for system, Question()->for user

MAction(number)	and QAction(number)
	this script has actions for menus and questions
	menu actions executed after pressing ENTER

option_add(id,name,enabled,visible)
	adds one slot to menu:
	id -> Action index (first option=1)
	name -> option text
	enabled -> 1=enabled, 0=option will be unselectable (blue)
	visible -> 1=visible, 0=option will be hidden

menu_destroy()
	restores screen state before menu was opened (closes menu or question)

freeze_ready()
	put this script in End_Step event of object to freeze it when game paused

play_fx(sound)
	plays sound when global.mute, global.bequiet and global.muteall are false

play_music(sound)
	loops sound when global.mutemusic and global.muteall are false

restart_music()
	restarts current music when global.mutemusic and global.muteall are false

ItemName("name")
	defines item text in inventory

print_message(text,x,y,blendcolor)
	this creates new Ob_Message object with message

install_bfont(slot,Background,width,height,gap)
	registers new bfont:
	gap - gap between characters, default=0
	width and height - bfont character dimensions
	when height=0 -> character heigh is all bfont graphics heigh

set_bfont(slot,gap)
	used for more than one bfont
	if slot=0 -> all defaults taken from install_bfont()
 script

print(text,x,y,blendcolor,centertext)
	when x=0 or y=0 -> continue last line (doesnt draw text at x=0 or y=0)
	centertext centers multiline text inside 'bounding box':
	   =0 -> align left, =1 -> center text(center of longest string),
	   =2 -> "invisible" text mode(not drawing)

key_check(key)
key_check_down(key)
key_press(key)
key_press_down(key)
key_release(key)
key_resetall()
	are used instead normal keyboard checks when using mouse control

Transform1()
	this script changes main character Ob_Dizzy (all) graphics
	change graphics -> fill assign list in script
	defaults in script game_init01()



--------- [03] General variables ----------------------------

global.heighscale
	scales bfont text: 1-> normal heigh, 2 -> double height

global.TextOn
	shows now opened dialog: "t_talk", "t_action", "t_options", "t_inventory"
	or "" when no dialogs are opened

global.freeview
	true - view follows Ob_Dizzy object
	false - fixed to current room

Ob_Controller.title_music
	define music to play in start room (default in script game_init01)

Ob_Controller.ambient_music	
	define music to play in any location room

global.Va_Coins
global.Va_Health
global.Va_Aqua
global.Va_Lives
global.Va_Score
	these hold information about Coins, Health, Air, Lives, Score

global.framegraphics
	background resource for talk frame graphic

global.textfont
	system texts (menus) font from installed bfonts

global.talkfont
	talk texts (and questions) font from installed bfonts

global.text_color
	textbox text color (define before using print() script)

global.scale
	game window scale size (1 -> original size)

global.inerpolation
	when 1 -> do not use Pixel Perfect Resizing

global.fullscreen
	[read only] fullscreen status variable

Ob_Lives.style
	changes Ob_Lives draw style: 1-"eggs" style, 2-shows 1 egg and number

Ob_Coin_Counter.style
	changes Ob_Coin_Counter draw style: 1-number only, 2-coinX and number

global.bequiet
	when=1 -> Dizzy: no steps/jump sounds and no health decrease(no shock)
	mostly used with Rob_Freewalk object in start room



--------- [04] Special objects ------------------------------

Ob_Controller
	this object controls most of game and defines many in-game variables in
	creation, game_start events (calls scripts game_init01 and game_init02)

Ob_DizzyStart
	this object defines where main character (Ob_Dizzy object) will be when game starts
	(Start room does not need it, but it can be used)

Ob_Dizzy
	you control this object (everything in step actions)

Ob_Message
	this object shows static text
	(can be created using print_message() script)
	put following code in Ob_Message creation code (in room editor)
	to show text (with other color) from creation moment:
	______________________
	textovr='TEXT';
	colorovr=(your color);
	fontovr=(your font);
	alarm[0]=1;
	______________________

Ob_BlockEnemies
	enemies will bounce when meeting this object
	(this object will be excluded in script optimise_instances() and
		big amount of them in room may reduce game speed)
Ob_EndGame
	this object waits then restarts game when no texts are displayed

Inv_slot
	Number of objects Inv_slot (placed in start room) define inventory size
	(Ob_Controller object will create one for you in case you forgot)

Inv_style
	this object defines inventory style (and position):
	has variable Inv_style.style
	style=0 -> default inventory (Dizzy 3 style) (same if no Inv_style object in room)
	style=1 -> dizzy 2 inventory (1-3 slots) (at Inv_style.x Inv_style.y)
	style=2 -> item_images_only version (at Inv_style.x Inv_style.y)

Ob_TalkObject
Ob_ItemObject
Ob_LeverObject
Ob_SwitchObject
	are base(parent) objects for all their families (talks, items, levers, switches)
	and they must be selected as parent for correct operation

Lever vs Switch: Lever is used alone and may be used once. Switches are used in sets and they
	reset each other. Set must be defined in room editor->creation code (with every
	child object of set) (variable: set )

Rob_GoLeft
Rob_GoRight
Rob_JumpForwards
Rob_JumpUp
	these objects take up all Ob_Dizzy control (becomes non-playable character) and
	they generate one action

Rob_Action  
	this object forces Ob_Dizzy to interact with talk scripts and levers.
	Items, collectables, inventory actions are not triggered!

Rob_Wait
	this object forces Ob_Dizzy to wait:
	put following code in Rob_Wait creation code (in room editor)
	Dizzy will be idle for this period, then continues last action:
	_____________________________
	waitmore=(your waiting time);
	alarm[0]=1;
	_____________________________

Rob_Freewalk
	this object forces Ob_Dizzy to walk on his own (make sure there are no deadly
	objects in that place)

Rob_TurnBack
	stops dizzy walking "into wall" (mostly used in Freewalk mode)

Rob_End
	this object exits NPC mode

Ob_Room_Name
	put this object in upper left corner of every room cell to show room name
	then put following code in Ob_Room_Name creation code (in room editor)
	(object without this code shows error!)
	____________________
	caption='ROOM NAME';
	____________________

Ob_ResurrectHere
and
Ob_LetResurrect
	After death (loses life) Ob_Dizzy appears at Ob_ResurrectHere.x and Ob_ResurrectHere.y
	this happens only when  Ob_Dizzy_Die gets colision with Ob_LetResurrect



--------- [05] GM61 - GM81 windows version actions ----------

apply_ink()
	used from object Ob_Inkomat
	sets colors(by blending) from depth 10000(ink) to tiles at depth 1000000(target)
	one "ink tile" can blend only 1 target tile
	and only if target tile(any part of it) is at x,y of ink tile
	does not work in HTML5 (you can do transformations in room editor instead)
