hey
ik probeer een soort sessions te maken (soort van party systeem zodanig je enkel jouw team ziet in de stages die je speelt .
nu heb ik wel een probleem
allereerst mijn codes
script on_session_change
//Shows a message to notify the user that the session changed.
//Obviously completely optional.
gms_show_message("Now in session " + string(argument0))
Information about object: obj_controller
Sprite:
Solid: false
Visible: true
Depth: 0
Persistent: false
Parent:
Children:
Mask:
No Physics Object
Create Event:
execute code:
//Setup
gms_debug_enable();
gms_settings(true, 1, obj_player, obj_other_player);
gms_login_set_username(string(irandom(1000)));
gms_login_execute(login_finish);
gms_script_set_session_change(on_session_change)
Draw Event:
execute code:
if(gms_info_isloggedin())
{
draw_set_alpha(1);
draw_set_color(0);
//Draw some general info
draw_text(5, 105,
"Connected: " + string(gms_info_isconnected()) + "#" +
"Number of sessions: " + string(gms_session_count()));
//Enumerate over all sessions.
for(i = 0; i < gms_session_count(); i += 1)
{
draw_text(205, 105 + i * 20,
"Session [" + string(i) + "]: Player Count = " + string(gms_session_player_count(i)) +
" / Type = " + string(gms_session_type(i)) +
" / ID = " + string(gms_session_id(i)));
}
draw_text(5, 205, "Note that all players join a session with type '0', or that a new session with type '0' is#created when a session with type '0' doesn't exist.##Press [N] to create a new session.#Press [J] to join an existing session.");
draw_text(5, 5, "You are currently in the session with session_id = " + string(gms_session_current_id()) + "#(It takes some time for the session_id to update)");
}
Key Press Event for J-key Key:
execute code:
//Ask the player which session to join. (NOTE: this dialog
//asks for an id; If you wish to use the 'i' from the enumeration you
//should use this code:
//server_session_join(server_session_id(get_integer("Enter the number of the session you want to join (starting with 0):", 0)));
gms_session_join(get_integer("ID:", 0));
Key Press Event for N-key Key:
execute code:
//Creates a new session, with the arbitrary type 'st_demo_session'
//(which is a constant, and equals 5)
gms_session_create(st_demo_session)
het probleem ligt volgens mij bij
Key Press Event for N-key Key:
execute code:
//Creates a new session, with the arbitrary type 'st_demo_session'
//(which is a constant, and equals 5)
gms_session_create(st_demo_session)
maar in de example stond dit zo dus ik weet niet wat ik kan doen
verder krijg ik deze error als ik duw op de N key
___________________________________________
############################################################################################
FATAL ERROR in
action number 1
of Key Press Event for N-key Key
for object obj_controller:
Variable obj_controller.st_demo_session(100012, -2147483648) not set before reading it.
at gml_Object_obj_controller_KeyPressed_N_1 (line 3) - gms_session_create(st_demo_session)
############################################################################################
hopelijk kan iemand me helpen het probleem op te lossen verder heb ik ook een aantal vragen over hoe dit nu juist werkt