Holding attributes
Matheus Vilaça
Member Posts: 2
Hi, I'm having some issues with the custom attributes I'm creating...
I created an int attribute so I could control the text I'm displaying (i.e. if my char do certain things this attribute will change therefore another kind of text will be given to him).
I tried testing first, to see how it works, but I can't get it to do absolutely nothing... I created a rule within an actor to hold "if the key 'space' is pressed then change attribute to +1" and another actor that is supposed to spawn if this same attribute is 1, but nothing spawns, I tried "display text" so I could see the attribute as it works, but it stays 0 anyways...
So my question is what am I doing wrong? I just want an attribute to hold a number and once in a while add +1 to it.
thank you
I created an int attribute so I could control the text I'm displaying (i.e. if my char do certain things this attribute will change therefore another kind of text will be given to him).
I tried testing first, to see how it works, but I can't get it to do absolutely nothing... I created a rule within an actor to hold "if the key 'space' is pressed then change attribute to +1" and another actor that is supposed to spawn if this same attribute is 1, but nothing spawns, I tried "display text" so I could see the attribute as it works, but it stays 0 anyways...
So my question is what am I doing wrong? I just want an attribute to hold a number and once in a while add +1 to it.
thank you
Best Answer
-
TradingFourDesigns Posts: 5The logic overall seems fine. One question though. What function are you using in the Expression Editor to add 1 to your integer attribute? If you're just typing in (without quotation marks) "+1", it will not change your attribute. What you must do is select your attribute in the left box, and then put into the expression editor (again without quotation marks): "game.yourattribute +1". The game.yourattribute you get by clicking the little down arrow in the Expression Editor, and navigating to your attribute, and double-clicking it. It will go into the Expression Editor like this: "game.yourattributename". Then, without spaces or anything in between, type +1. This is kind of funky, and it tripped me up for a while. Maybe it's not your problem, but if it is, try this, and it may help. Cheers!