Make actor spawn every time i 'level up'?

hey guys.
so id like to spawn an actor every time i level up saying 'LEVEL UP'. I've set it so that when my Level Number integer on my Table is 'greater or equal to' 2, it spawns actor 'LEVEL UP', by constraining the integer to another integer called 'level up' on the actor. The actor will spawn as intended when i level from Level 1 to Level 2, but when i level from Level 2 to Level 3 and upwards, the actor doesn't spawn. anyone know how to remedy this? any help will be massively appreciated. :)

Comments

  • MarpCarkMarpCark Member Posts: 121

    Ok while messing around to solve this problem i clicked 'reset' on the Preview while i had just grown to level 6. the level stayed at 6 as intended, but the LEVEL UP image appeared too, which means that GS is recognising the level being 'greater or equal to' 2, but its not recognising the transition from level to level above level 2. any thoughts?

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    Rule conditions in GameSalad only trigger when the state of the condition changes. This can be hard to grasp (it was hard for me!) but essentially this means that if your condition is game.level ≥ 2, the state of that condition is false initially when game.level is 1 and then changes to true when game.level is 2. However, when game.level is 3, the state of the condition is still true... it hasn't changed so it doesn't trigger the rule and therefore gets ignored.

    One way around this is to change a boolean each time the level changes. So you might start with game.passedLevel false (unchecked) and then when a level gets completed, you would change game.passedLevel to true and in a timer set to after 0.1 seconds, change game.passedLevel back to false. In your spawner actor, have a rule that says When game.passedLevel is true, spawn an actor.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • MarpCarkMarpCark Member Posts: 121

    ah ok i get you, that makes a lot more sense. think I'm on the right track now. one quick question though:
    the levels that I'm unlocking are an integer that I've put into a table, and goes up by 1 every time you gain 100 exp, so you're growing levels, not unlocking new levels to play. how would i get gs to spawn the actor whenever the integer goes up +1?
    thankyou for responding :)

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    This demo might be helpful.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • MarpCarkMarpCark Member Posts: 121

    thats really useful, i really appreciate you sending me that demo. I'm definitely a lot closer to what I'm trying to get. however while i thought that problem was completely solved, when i was in Preview every time i level up now the LEVEL UP flashes on screen, which is what i wanted. but sometimes when i hit Reset, the exp bar carries on growing and you can't level up anymore, and the LEVEL UP appears straight away, even though you havent levelled up. id like to attach the file so can see for yourself, but for some reason when i try to it says '"level up.proj" is not allowed.' again I'm really grateful for your help :)

  • MarpCarkMarpCark Member Posts: 121

    ok so I've also noticed that after hitting reset, the LEVEL UP appears for every level that you've grown. so if you've grown from level 1 to 5, the LEVEL UP will appear/destroy itself 4 times.

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    To attach a file, first compress it as a .zip file.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • MarpCarkMarpCark Member Posts: 121

    ah yes there we go, thank you. i managed to fix the problem where the bar continues to grow without levelling up after resetting by doing Save Table on the exp bar. will saving the Table every click affect the memory use/smoothness of the game? i feel like it will. sorry if thats a noob question, still kinda new at this :s

Sign In or Register to comment.