The item default_tone is actually a variable and not a constant. You can only initialize variables (using init) to constants not to other variables.
The default_tone and default_toneerror variables have another purpose. If you leave the objects tone and tone_error properties as default they end up using the the default_tone and default_toneerror variables values via the function that our standard objects call named _PlayTone. Here is the code for that function to understand how this works:
Code:
func _PlayTone (tone as _Note, duration as integer, err as boolean)
if tone == Note_UseDefault then
if err then
if default_toneerror == Note_UseDefault then
PlayNote (Note_High, duration)
elseif default_toneerror <> Note_None then
PlayNote(default_toneerror, duration)
endif
else
if default_tone == Note_UseDefault then
PlayNote(Note_Medium, duration)
elseif default_tone <> Note_None then
PlayNote(default_tone, duration)
endif
endif
elseif tone <> Note_None then
PlayNote (tone, duration)
endif
endfunc
Having given a brief explanation of how default_tone and default_toneerror work let me show you how to create a couple constants you could initialize your tone variable to. Here is some code for example you can put in globals:
Code:
const my_def_tone := note_medium
const my_def_tone_error := note_high
Now you can use these constants to initialize tone and/or tone_error properties.
Code:
init tone := my_def_tone
init tone_error := my_def_tone_error
Of course your other option is to not change the objects tone or tone_error properties at all from defaults and change the default_tone and default_toneerror properties found in globals.