The Daily Click ::. Forums ::. Klik Coding Help ::. Saving and Loading problems
 

Post Reply  Post Oekaki 
 

Posted By Message

vinicio



Registered
  11/04/2015 21:20:09
Points
  142
4th August, 2015 at 04/08/2015 00:40:10 -

so i was changing some of the programing on a enemy, when i tested the game and went through the level i died and i noticed that i went back at the start, so that means checpoints dont work like they used too, i dont know if the enemy coding messed the programing or something. does anyone have a way to fix this.
the events go like this (im using the Ini object):

Start of frame
-"CheckPoint" . set alterable value A = ItemValue( "Ini", "Check1" )

Start of frame
-"CheckPoint" alterable value A = 1 . Load position of "Player"

Collision between "Player" and "CheckPoint"
-"CheckPoint" . set alterable value A = 1
-"Ini" . Save position of "Player"
. set ItemValue( "Ini", "Check1" ) = "CheckPoint" alterable value A

 
n/a

UrbanMonk

BRING BACK MITCH

Registered
  07/07/2008
Points
  49667

Has Donated, Thank You!Little Pirate!ARGH SignKliktober Special Award TagPicture Me This Round 33 Winner!The Outlaw!VIP MemberHasslevania 2!I am an April FoolKitty
Picture Me This Round 32 Winner!Picture Me This Round 42 Winner!Picture Me This Round 44 Winner!Picture Me This Round 53 Winner!
5th August, 2015 at 05/08/2015 15:37:06 -

This code seems a bit convoluted for a simple checkpoint system.

Why not do this:

Start of frame
-Spread value 1 for alterable value A("CheckPoint")

Start of frame
and Alterable value A("CheckPoint") = ItemValue("ini", "LastCheckpoint")
-Set position("Player") to (0,0) of ("CheckPoint")

Collision between "Player" and "CheckPoint"
-set ItemValue("Ini, "LastCheckpoint") = "CheckPoint" alterable value A


You might have to tweak the position of the player relative to the check point for the 2nd event, but other than that this should work fine.

 
n/a

vinicio



Registered
  11/04/2015 21:20:09
Points
  142
5th August, 2015 at 05/08/2015 16:49:15 -

hey thanks a lot, but i tried it and it doesn't seem to work for some reason.
i dont know if i screwed it but heres a picture if something is wrong tell me:
<http://vinixiow.deviantart.com/art/Trouble-1-551406726

Edited by vinicio

 
n/a

UrbanMonk

BRING BACK MITCH

Registered
  07/07/2008
Points
  49667

Has Donated, Thank You!Little Pirate!ARGH SignKliktober Special Award TagPicture Me This Round 33 Winner!The Outlaw!VIP MemberHasslevania 2!I am an April FoolKitty
Picture Me This Round 32 Winner!Picture Me This Round 42 Winner!Picture Me This Round 44 Winner!Picture Me This Round 53 Winner!
6th August, 2015 at 06/08/2015 16:50:52 -

The code looks correct. In fact I just tested it and it worked perfectly.

Here's mine:
https://mega.nz/#!dohGSD6Z!JTmOk0snMC_Ura4LF046-4JhLdjRnhzmvDdDePJsZcE

Make sure you have the latest version of fusion too.

 
n/a

vinicio



Registered
  11/04/2015 21:20:09
Points
  142
7th August, 2015 at 07/08/2015 20:01:41 -

hey thanks a lot UrbanMonk, after repeating the code plenty of times i managed to make it realizing i had to set group and values, so thanks for helping a noob here.

 
n/a

UrbanMonk

BRING BACK MITCH

Registered
  07/07/2008
Points
  49667

Has Donated, Thank You!Little Pirate!ARGH SignKliktober Special Award TagPicture Me This Round 33 Winner!The Outlaw!VIP MemberHasslevania 2!I am an April FoolKitty
Picture Me This Round 32 Winner!Picture Me This Round 42 Winner!Picture Me This Round 44 Winner!Picture Me This Round 53 Winner!
8th August, 2015 at 08/08/2015 23:13:57 -

Ah I didn't even notice that you were missing that in your screenshot!
Glad you got it working!

 
n/a
   

Post Reply



 



Advertisement

Worth A Click