W
Wild_West
Guest
I've been trying to solve this for the last week and I've tried literally everything I can think of.
Looking at the variable's state in the debugger, using a message to show if I'm making an object duplicate,
removing the code that says to reset the value to false. Nothing is fixing it and I don't know why.
But my problem is I'm trying to make a collectables system where once I grab something I don't have to recollect it again f I die. The problem of course is, this is not working. I grab the items, I die, the variable for tracking if I've collected them is reset to false.
The way I set it up, or tried to is that if the number of items I want to collect is at zero that means I have them all since that's the only way they're ever destroyed. so once the instance number is zero I set the collection variable for that room to true. and this variable gets set in a persistent object so the value shouldn't be getting reset, yet it is. why?
switch( room )
{
case solar_space_section_1 :
if not( instance_exists(bronze_bit_piece) )
{ solar_1_bronze_bit_pieces_collected = true; }
//else
//{ solar_1_bronze_bit_pieces_collected = false; }
if not( instance_exists(copper_bit_piece) )
{ solar_1_copper_bit_pieces_collected = true; }
//else
//{ solar_1_copper_bit_pieces_collected = false; }
if not( instance_exists(silver_bit_piece) )
{ solar_1_silver_bit_pieces_collected = true; }
//else
//{ solar_1_silver_bit_pieces_collected = false; }
if not( instance_exists(gold_bit_piece ) )
{ solar_1_gold_bit_pieces_collected = true; }
//else
//{ solar_1_gold_bit_pieces_collected = false; }
break;
Looking at the variable's state in the debugger, using a message to show if I'm making an object duplicate,
removing the code that says to reset the value to false. Nothing is fixing it and I don't know why.
But my problem is I'm trying to make a collectables system where once I grab something I don't have to recollect it again f I die. The problem of course is, this is not working. I grab the items, I die, the variable for tracking if I've collected them is reset to false.
The way I set it up, or tried to is that if the number of items I want to collect is at zero that means I have them all since that's the only way they're ever destroyed. so once the instance number is zero I set the collection variable for that room to true. and this variable gets set in a persistent object so the value shouldn't be getting reset, yet it is. why?
switch( room )
{
case solar_space_section_1 :
if not( instance_exists(bronze_bit_piece) )
{ solar_1_bronze_bit_pieces_collected = true; }
//else
//{ solar_1_bronze_bit_pieces_collected = false; }
if not( instance_exists(copper_bit_piece) )
{ solar_1_copper_bit_pieces_collected = true; }
//else
//{ solar_1_copper_bit_pieces_collected = false; }
if not( instance_exists(silver_bit_piece) )
{ solar_1_silver_bit_pieces_collected = true; }
//else
//{ solar_1_silver_bit_pieces_collected = false; }
if not( instance_exists(gold_bit_piece ) )
{ solar_1_gold_bit_pieces_collected = true; }
//else
//{ solar_1_gold_bit_pieces_collected = false; }
break;