can't access game.attributes from pause
forklift
Member Posts: 386
I am not able to access game.attributes from a pause screen. Can anyone else confirm this?
Example:
I am changing the size of an actor based on (integer) game.size. Game.size can be either a 1, 2, or 3.
I have a button on the pause screen with the following rules:
(all conditions) if actor touched and game.size = 1, change game.size to 2
(all conditions) if actor touched and game.size = 2, change game.size to 3
(all conditions) if actor touched and game.size = 3, change game.size to 1
This doesn't work. It doesn't actually change the number, even when it's a prototype.
Example:
I am changing the size of an actor based on (integer) game.size. Game.size can be either a 1, 2, or 3.
I have a button on the pause screen with the following rules:
(all conditions) if actor touched and game.size = 1, change game.size to 2
(all conditions) if actor touched and game.size = 2, change game.size to 3
(all conditions) if actor touched and game.size = 3, change game.size to 1
This doesn't work. It doesn't actually change the number, even when it's a prototype.
Comments
If actor touched then gamesize = gamesize+1
OR
if touched
Change gamesize to (gamsize+1)%3
Hope that helps,
QS
Dr. Sam Beckett never returned home...
Twitter: https://twitter.com/Quantum_Sheep
Web: https://quantumsheep.itch.io
Works like a charm now.
It's a very handy function. You can even change that number at the end to a variable.
For example:
Let''s use two variables:
Weapon type = 0
Weapons unlocked = 0
If you unlock a new weapon, it would change to:
Weapon type = 0 (as you haven't changed the default weapon a character holds)
Weapons unlocked = 1
You could then, in-game, have the following:
Change attribute weapon type to (weapon type+1)%Weapons unlocked
This would then allow you to cycle through available weapons that had been unlocked.
Hope that makes sense,
QS
Dr. Sam Beckett never returned home...
Twitter: https://twitter.com/Quantum_Sheep
Web: https://quantumsheep.itch.io
*edit*
Awesome, QS. You rock! (and have earned a lifetime subscription of promo codes from me)