Jump to content


Photo
- - - - -

Classic Pause


  • Please log in to reply
46 replies to this topic

#41 NameDollars

NameDollars

    GMC Member

  • GMC Member
  • 5 posts
  • Version:GM8

Posted 29 December 2012 - 05:15 AM


When I put it in my object's Step event and try running my game to see it work, I get this message:

___________________________________________
COMPILATION ERROR in Script: pause
Error in code at line 6:
                           pause=1;
                                ^
at position 31: Variable name expected.
How can I fix this?


Did you follow exact the implementation explained in the 1st post? Because, if you put the pause code into a script, or make some changes to it, it might not work as intended.


I followed the instructions exactly, and only removed optional stuff I did not want. I did not add nor remove anything not optional and it is the only thing in its script.

EDIT: When I run your downloadable example with the changes I made, it runs normally. When I run my game after a copy/paste to make sure they are exactly the same, it has the same error come up.

Edited by NameDollars, 29 December 2012 - 08:27 AM.

  • 0

#42 pixeltao

pixeltao

    GMC Member

  • GMC Member
  • 92 posts

Posted 30 December 2012 - 10:41 PM



When I put it in my object's Step event and try running my game to see it work, I get this message:

___________________________________________
COMPILATION ERROR in Script: pause
Error in code at line 6:
                           pause=1;
                                ^
at position 31: Variable name expected.
How can I fix this?


Did you follow exact the implementation explained in the 1st post? Because, if you put the pause code into a script, or make some changes to it, it might not work as intended.


I followed the instructions exactly, and only removed optional stuff I did not want. I did not add nor remove anything not optional and it is the only thing in its script.

EDIT: When I run your downloadable example with the changes I made, it runs normally. When I run my game after a copy/paste to make sure they are exactly the same, it has the same error come up.


I can't easily tell you what's wrong in your implementation without having more details. Did you make sure that all of your objects have the pause variable initialized in their respective create event?

EDIT: Is it possible that you have an object named "pause" like the pause variable? This can create a conflict in your GM project. If that's the case, simply rename your pause object (or the variable).

Edited by pixeltao, 30 December 2012 - 10:45 PM.

  • 0

#43 NameDollars

NameDollars

    GMC Member

  • GMC Member
  • 5 posts
  • Version:GM8

Posted 31 December 2012 - 08:53 AM




When I put it in my object's Step event and try running my game to see it work, I get this message:

___________________________________________
COMPILATION ERROR in Script: pause
Error in code at line 6:
                           pause=1;
                                ^
at position 31: Variable name expected.
How can I fix this?


Did you follow exact the implementation explained in the 1st post? Because, if you put the pause code into a script, or make some changes to it, it might not work as intended.


I followed the instructions exactly, and only removed optional stuff I did not want. I did not add nor remove anything not optional and it is the only thing in its script.

EDIT: When I run your downloadable example with the changes I made, it runs normally. When I run my game after a copy/paste to make sure they are exactly the same, it has the same error come up.


I can't easily tell you what's wrong in your implementation without having more details. Did you make sure that all of your objects have the pause variable initialized in their respective create event?

EDIT: Is it possible that you have an object named "pause" like the pause variable? This can create a conflict in your GM project. If that's the case, simply rename your pause object (or the variable).


Thanks.

Hopefully unrelated, but may be, so still posting it here: Now my experience and HP bars aren't drawing when unpaused, but are when paused (using different objects for each) and the opponent HP still draws above them when unpaused. The codes are nearly exactly the same, but with changes for where they are drawn (EXP under the current/max, HP under current when paused, EXP 0,0, HP directly right of it when not). Again, not sure if related, but may be, so posting here to be safe.

EDIT: Never mind. Just a mistake in the coding by a guy too lazy to proof read.

Edited by NameDollars, 31 December 2012 - 10:25 AM.

  • 0

#44 Alphanumerai

Alphanumerai

    GMC Member

  • GMC Member
  • 16 posts
  • Version:GM8.1

Posted 16 March 2013 - 03:34 PM

Just wanted to say I'm using your pause system in my NES/SMS inspired project.
It originally appealed to me as it doesn't blank the screen of obscure it with a horrible dialogue box, so you can have your own menus.
I'm also going to use it for screen transitions, pausing everything and moving the view and player, while altering their recorded variables. To give the same affect as when you cross the screen in games like Mega Man.
Just have to add something to determine whether it was paused by the player or the game, to allow control or not ^_^

Best pause system I've found.
  • 0

#45 pixeltao

pixeltao

    GMC Member

  • GMC Member
  • 92 posts

Posted 17 March 2013 - 12:53 AM

Just wanted to say I'm using your pause system in my NES/SMS inspired project.
It originally appealed to me as it doesn't blank the screen of obscure it with a horrible dialogue box, so you can have your own menus.
I'm also going to use it for screen transitions, pausing everything and moving the view and player, while altering their recorded variables. To give the same affect as when you cross the screen in games like Mega Man.
Just have to add something to determine whether it was paused by the player or the game, to allow control or not ^_^

Best pause system I've found.


Awesome, glad you like it ^_^ I'm a fan of NES/SMS style games. I'd be curious to try it when it's ready.
  • 0

#46 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • Global Moderators
  • 14446 posts
  • Version:GM:Studio

Posted 18 March 2013 - 08:42 PM

Please dont name the function the same as a variable. I think that is the problem here.

 

COMPILATION ERROR in Script: pause

 

pause=1;


  • 0

#47 Ruub

Ruub

    GMC Member

  • GMC Member
  • 442 posts
  • Version:GM:Studio

Posted 22 March 2013 - 09:34 AM

hey pixeltoa,

 

I figured, isn't it easier to have one control that puts in all the variables instead of having to put it in every create event?

 

//Roomstart event because persistent ;D
with (all)
{
if object_index=obj_controller
or object_index=obj_smoothbackground
or object_index=obj_megafox
or object_index=obj_cursor
{pause_able=0; exit;}

pause_able=1;
}

Edited by Ruub, 22 March 2013 - 09:36 AM.

  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users