Here's the code I have for the objects in question.
Obj_Save is clicked on to save the game.
Information about object: obj_save Sprite: spr_save1 Solid: true Visible: true Depth: 3 Persistent: false Parent: <no parent> Mask: spr_dense Create Event: align position to a grid with cells of 16 by 16 pixels Mouse Event for Left Pressed: if obj_cursor.cooldown is equal to 0 if global.menu is equal to 0 if obj_cursor.mode is equal to 0 execute code: if instance_number(obj_armour2text) > 0 then object_delete(obj_armour2text); if instance_number(obj_smith2text) > 0 then object_delete(obj_smith2text); save the game in the file save
Obj_Sound runs in the background, the very first thing to boot up in the game before the title screen where the game can be loaded. My code is very, very sloppy in this section, as I was trying to get transition of music between areas via alarms.
Information about object: obj_sound
Sprite: spr_womans
Solid: false
Visible: false
Depth: 0
Persistent: true
Parent: <no parent>
Mask: <same as sprite>
Create Event:
execute script SS_Init with arguments (0,0,0,0,0)
execute code:
toshadone = 0;
fadeout = 0;
handle = SS_LoadSound("town.ogg", 1);
itemjing = SS_LoadSound("gotitem.ogg", 1);
donehere = SS_LoadSound("finishedhere.ogg", 1);
forest = SS_LoadSound("forest.ogg", 1);
area1 = SS_LoadSound("area1.ogg", 1);
hector = SS_LoadSound("hector.ogg", 1);
Alarm Event for alarm 0:
execute code:
SS_LoopSound(donehere);
SS_SetSoundVol(donehere, 6000);
SS_ResumeSound(donehere);
alarm[1]=10;
Alarm Event for alarm 1:
execute code:
SS_SetSoundVol(donehere, 7000);
alarm[2]=10;
Alarm Event for alarm 2:
execute code:
SS_SetSoundVol(donehere, 8000);
alarm[3]=10;
Alarm Event for alarm 3:
execute code:
SS_SetSoundVol(donehere, 9000);
alarm[4]=10;
Alarm Event for alarm 4:
execute code:
SS_SetSoundVol(donehere, 10000);
Alarm Event for alarm 5:
execute code:
if global.music = 2 and global.area=0 then SS_SetSoundVol(donehere, 9000);
if global.music = 2 and global.area=3 then SS_SetSoundVol(hector, 9000);
if global.music = 1 and global.area=1 then SS_SetSoundVol(donehere, 6000);
if global.music = 1 and global.area=1 then SS_SetSoundVol(forest, 9000);
if global.music = 4 and global.area=4 then SS_SetSoundVol(forest, 9000);
if global.music = 3 and global.area=1 then SS_SetSoundVol(forest, 9000);
if global.music = 2 and global.area=2 then SS_SetSoundVol(area1, 9000);
alarm[6]=10;
Alarm Event for alarm 6:
execute code:
if global.music = 2 and global.area=0 then SS_SetSoundVol(donehere, 8000);
if global.music = 2 and global.area=3 then SS_SetSoundVol(hector, 8000);
if global.music = 1 and global.area=1 then SS_SetSoundVol(donehere, 7000);
if global.music = 1 and global.area=1 then SS_SetSoundVol(forest, 8000);
if global.music = 1 and global.area=1 then SS_SetSoundVol(forest, 8000);
if global.music = 4 and global.area=1 then SS_SetSoundVol(forest, 8000);
if global.music = 3 and global.area=1 then SS_SetSoundVol(forest, 8000);
if global.music = 2 and global.area=2 then SS_SetSoundVol(area1, 8000);
alarm[7]=10;
Alarm Event for alarm 7:
execute code:
if global.music = 2 and global.area=0 then SS_SetSoundVol(donehere, 7000);
if global.music = 2 and global.area=3 then SS_SetSoundVol(hector, 7000);
if global.music = 1 and global.area=1 then SS_SetSoundVol(donehere, 8000);
if global.music = 1 and global.area=1 then SS_SetSoundVol(forest, 7000);
if global.music = 1 and global.area=1 then SS_SetSoundVol(forest, 7000);
if global.music = 4 and global.area=1 then SS_SetSoundVol(forest, 7000);
if global.music = 3 and global.area=1 then SS_SetSoundVol(forest, 7000);
if global.music = 2 and global.area=2 then SS_SetSoundVol(area1, 7000);
alarm[8]=10;
Alarm Event for alarm 8:
execute code:
if global.music = 2 and global.area=0 then SS_SetSoundVol(donehere, 6000);
if global.music = 2 and global.area=3 then SS_SetSoundVol(hector, 6000);
if global.music = 4 and global.area=1 then SS_SetSoundVol(hector, 10000);
if global.music = 2 and global.area=0 then SS_SetSoundVol(forest, 10000);
if global.music = 1 and global.area=1 then SS_SetSoundVol(donehere, 10000);
if global.music = 2 and global.area=2 then SS_SetSoundVol(forest, 10000);
if global.music = 2 and global.area=3 then SS_SetSoundVol(forest, 10000);
if global.music = 1 and global.area=1 then SS_SetSoundVol(forest, 6000);
if global.music = 1 and global.area=1 then SS_SetSoundVol(forest, 6000);
if global.music = 4 and global.area=1 then SS_SetSoundVol(forest, 6000);
if global.music = 3 and global.area=1 then SS_SetSoundVol(forest, 6000);
if global.music = 2 and global.area=2 then SS_SetSoundVol(area1, 6000);
alarm[9]=10;
Alarm Event for alarm 9:
execute code:
if global.music = 2 and global.area=0 then SS_StopSound(donehere);
if global.music = 4 and global.area=1 then SS_StopSound(forest);
if global.music = 3 and global.area=1 then SS_StopSound(forest);
if global.music = 1 and global.area=1 then SS_StopSound(forest);
if global.music = 2 and global.area=3 then SS_StopSound(hector);
if global.music = 3 and global.area=1 then SS_StopSound(forest);
if global.music = 2 and global.area=2 then SS_StopSound(area1);
if global.music = 2 and global.area=0
{
SS_LoopSound(forest);
global.area = 1;
}
if global.music = 1 and global.area=1
{
SS_LoopSound(donehere);
global.area = 0;
}
if global.music = 2 and global.area=0
{
SS_LoopSound(forest);
global.area = 1;
}
if global.music = 2 and global.area=3
{
SS_LoopSound(forest);
global.area = 1;
}
if global.music = 2 and global.area = 2
{
SS_LoopSound(forest);
global.area = 1;
}
if global.music = 3 and global.area = 1
{
SS_SetSoundVol(area1, 10000);
SS_LoopSound(area1);
global.area = 2;
}
if global.music = 4 and global.area = 1
{
SS_LoopSound(hector);
global.area = 3;
}
Step Event:
execute code:
if instance_number(obj_chief) > 0
{
if obj_chief.stoptown1 = 1 then SS_SetSoundVol(handle, 9000);
if obj_chief.stoptown1 = 2 then SS_SetSoundVol(handle, 8000);
if obj_chief.stoptown1 = 3 then SS_SetSoundVol(handle, 7000);
if obj_chief.stoptown1 = 4 then SS_SetSoundVol(handle, 6000);
if obj_chief.stoptown1 = 5
{
SS_StopSound(handle);
fadeout = 1;
}
if obj_chief.jingle = 1
{
SS_PlaySound(itemjing);
obj_chief.jingle = 0;
}
}
if room = town_tosha
{
if global. chief = 0
{
if fadeout = 0
{
if SS_IsSoundPlaying(handle) !=true then SS_LoopSound(handle);
}
}
}
Other Event: Game End:
execute script SS_Unload with arguments (0,0,0,0,0)Finally, the Obj_title, which holds the basic interface for the title screen.
Information about object: obj_title Sprite: spr_title Solid: false Visible: true Depth: 0 Persistent: false Parent: <no parent> Mask: <same as sprite> Create Event: execute code: image_speed = 0.5; select = 0; Step Event: execute code: if image_index = 14 then image_speed = 0; Keyboard Event for <Left> Key: execute code: select = 0; Keyboard Event for <Right> Key: execute code: select = 1; Key Press Event for <Enter> Key: if select is equal to 0 go to next room with transition effect Fade out and in if select is equal to 1 load the game from the file save
Thanks for reading this, sorry if my format of quoting the code is laid out incorrectly D:.











