I Wanna Community

Fangames => Game Design => Programming Questions => Topic started by: MatthewRPG on March 28, 2015, 09:57:30 AM

Title: Player Start object is not working, need help. Again.
Post by: MatthewRPG on March 28, 2015, 09:57:30 AM
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: [Select]
if(!instance_exists(player)){
  instance_create(x+17,y+23,player);
}

Which I did not change in the slightest. So I honestly have no idea what's going on.
Title: Re: Player Start object is not working, need help. Again.
Post by: 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.
Title: Re: Player Start object is not working, need help. Again.
Post by: MatthewRPG on March 28, 2015, 12:02:52 PM
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.

Code: [Select]
if(room != rInit && room != rMatthewRPG && room != rTitle){
  sound_stop_all();
  loadGame();
}
"rMatthewRPG" is the intro screen, by the by.
Oh, and I'm using Minwa engine, in case you were wondering.
Title: Re: Player Start object is not working, need help. Again.
Post by: lawatson on March 28, 2015, 01:04:41 PM
What's in your loadGame script?
Title: Re: Player Start object is not working, need help. Again.
Post by: MatthewRPG on March 28, 2015, 01:16:34 PM
What's in your loadGame script?
Code: [Select]
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();
Title: Re: Player Start object is not working, need help. Again.
Post by: lawatson on March 28, 2015, 02:52:31 PM
And in your tempExe script?
Title: Re: Player Start object is not working, need help. Again.
Post by: MatthewRPG on March 28, 2015, 03:50:45 PM
And in your tempExe script?
Code: [Select]
var f;
f = file_bin_open("temp",0);
global.savenum = file_bin_read_byte(f);
file_bin_close(f);
saveExe();
(Sorry for the late response, internet kinda died.)
Title: Re: Player Start object is not working, need help. Again.
Post by: MatthewRPG on March 29, 2015, 01:47:11 AM
Okay. For whatever reason, the Player object was not persistent. The problem is now resolved. Sorry for wasting your time.  :FailFish: