Fangames > Programming Questions

Player Start object is not working, need help. Again.

(1/2) > >>

MatthewRPG:
It appears as if every single time I  press 'R' in my fangame, I reset to where  the "playerStart" object is, no matter where I saved. (in the first room, at least.)

"playerStart"'s "Room Start" Code:

--- Code: --- if(!instance_exists(player)){
  instance_create(x+17,y+23,player);
}
--- End code ---

Which I did not change in the slightest. So I honestly have no idea what's going on.

lawatson:
That's the same code that I have for my playerStart object, it sounds like the problem is that the room keeps restarting instead of just the game. Look in the world's Press R event and tell me what is in there.

MatthewRPG:

--- Quote from: lawatson on March 28, 2015, 11:32:38 AM ---That's the same code that I have for my playerStart object, it sounds like the problem is that the room keeps restarting instead of just the game. Look in the world's Press R event and tell me what is in there.

--- End quote ---


--- Code: --- if(room != rInit && room != rMatthewRPG && room != rTitle){
  sound_stop_all();
  loadGame();
}
--- End code ---
"rMatthewRPG" is the intro screen, by the by.
Oh, and I'm using Minwa engine, in case you were wondering.

lawatson:
What's in your loadGame script?

MatthewRPG:

--- Quote from: lawatson on March 28, 2015, 01:04:41 PM ---What's in your loadGame script?

--- End quote ---

--- Code: --- var f;

if !instance_exists(player){
  instance_create(0,0,player);
}

f = file_bin_open("temp",1);
file_bin_write_byte(f,global.savenum);
file_bin_close(f);
saveExe();
tempExe();
--- End code ---

Navigation

[0] Message Index

[#] Next page

Go to full version