S
Sardec Xavier
Guest
Can someone help me with this? I am getting a problem where I am trying to save controls to an ini file and load them back in so I can have custom control schemes. This is what I have so far:
scr_default_controls
I am getting an error at Line 25 that says two things
Code:
//Set up player controls lists
var buttonTotal = 12;
global.controlList = array_create(4)
global.controlList[0] = array_create(buttonTotal);
global.controlList[1] = array_create(buttonTotal);
global.controlList[2] = array_create(buttonTotal);
global.controlList[3] = array_create(buttonTotal);
controlNames = script_execute( scr_control_names, buttonTotal );
//Check for a load file for previously saved controls
ini_open("control.sav");
//For every player...
for ( var controlId = 0; controlId < 4; controlId++ )
{
//Go through every button
for( var loc = 0; loc < buttonTotal; loc++ )
{
// Read in the right controls from the button ID off the save file, if they don't exist, it will give the value of the buttone from a default conrol scheme
var buttonId = controlNames[loc];
var readButton = ini_read_real( "Player: " + string(controlId), buttonId, scr_default_controls( loc ) )
// show_debug_message( string(readButton) +" : " + string(loc) );
global.controlList[controlId][loc] = readButton;
ini_write_real( "Player:" + string(controlId), buttonId, global.controlList[controlId][loc] );
}
}
//Glose the save file that is open
ini_close();
//Goto the main menu room
room_goto( rm_title_screen );
Code:
///Default control scheme for the game
var defaultList = array_create(12);
defaultList[0] = gp_shoulderrb; // Shoot = RT
defaultList[1] = gp_shoulderr; // LedgeHang = RB
defaultList[2] = gp_face4; // Toggle = Y
defaultList[3] = gp_face3; // Interact = X
defaultList[4] = gp_face1; // Jump = A
defaultList[5] = gp_axislh; // Move Left = LS
defaultList[6] = gp_axislh; // Move Right = LS
defaultList[7] = gp_axislv; // Aim Up = LS
defaultList[8] = gp_axislv; // Aim Down = LS
defaultList[9] = gp_stickl; // Sprint = LSB
defaultList[10] = gp_shoulderl; // Aim Diup = LT
defaultList[11] = gp_shoulderlb; // Aim Didown = LB
//Set Controls
return defaultList[ argument0 ];
- Assignment operator expected
- Malformed Assignment statement