Item collecting problem

harlin36harlin36 Member Posts: 101
edited November -1 in Working with GS (Mac)
Hi all,

I have a game where you go around collecting keys, the problem is that when you collect just one key they all disappear when you reload. However when you don't collect any it remembers
this and they all remain when you reload.

The keys seem to be acting in a collectivist way even though they all have seperate names and
save/load keys.

Any Ideas?

Comments

  • harlin36harlin36 Member Posts: 101
    Help!
  • harlin36harlin36 Member Posts: 101
    Could this be a load save attribute bug?
  • GuaveMediaGuaveMedia Member, PRO Posts: 1,262
    Hey man,

    I would it do like that:

    When collide with your object set attribute collect to collect +1, when you reload the scene change attribute collect back to 0.

    In your key 1 just say, when attribute collect = 1 destroy,
    attribute collect = 2, destroy key 2
    and so on...

    Hope that helps ;)
  • harlin36harlin36 Member Posts: 101
    I do have separate destroy attributes on all the keys ie. when key 1 is collected =true then if

    true destroy this actor. So what I dont understand is why they all destroy on reload when I only

    collect one or two keys.
  • harlin36harlin36 Member Posts: 101
    If I do the self.color.alpha thing won't the keys still be there but just invisible? Only I would be

    going over the same area a few times and I don't want to be collecting lots of invisible keys.

    Cheers
  • harlin36harlin36 Member Posts: 101
    Thank's for your help,but this didn't work. what I need is for the individual keys to remember

    if they have been collected or not when I reload the game.

    They are still acting in a collectivist manner and all disappear when any one is collected.

    Help!
  • mynameisacemynameisace Hull, UKMember Posts: 2,484
    @Harlin36 - Re-read Tshirt's explanation a few times and make you're doing it to the letter. That is the exact way to do it and do it efficiently with no destroy/spawn/etc.

    Make sure you do the same for all keys but create game.key2, game.key3 etc. and that you load them all.

    Ace
  • harlin36harlin36 Member Posts: 101
    Hi Ace,

    It's probably me but this is all very confusing with having save/load keys and actual keys!

    This is how my rules are set out, they are probably in the wrong order or something!

    KEY 1

    Rule1
    when overlaps etc.
    change att. game.key1 to true
    save att. game.key1. key; image1

    Rule2
    when overlaps...
    attribute self.self.active is true
    change self.self.active to;false

    Rule3
    When all conditions valid;
    attribute game.key1 is true
    change attribute self.color to 0
    otherwise
    change attribute self.color to1

    Does this make any sense?
  • harlin36harlin36 Member Posts: 101
    I should add game.key1 starts off false and self.active starts off true.
  • harlin36harlin36 Member Posts: 101
    It still collects the invisible key on reload.
  • harlin36harlin36 Member Posts: 101
    Hi Tshirtbooth,

    Sorry about this.

    1)I'm testing on ipod device

    2)The load is on the first scene (menu)
  • harlin36harlin36 Member Posts: 101
    It was better when i had the destroy attribute because at least when they got collected they stayed collected!
    Can anyone explain why when all the keys have separate names and load keys they would all
    decide to go true when one is collected.
    If I could understand why this might happen I might be able to find a solution.

    Cheers
Sign In or Register to comment.