Hello, first post here, so I want to congratulate Scirra for their amazing work, and the construct 2 community to gave me a lot of answer with having to post here. But this time I can't find a solution by myself.
I'm making a game that is a kind of tower defense/shoot'em up/beat'em up where you choose (1-4) heroes from a selection of 10, and can switch from one to another in game.
What I want to do is to use a variable as an object in expressions, for exemple, in my game I have a variables that contain the name of the Hero the player choose for the A slot, another with the chosen Hero for the B slot (etc for C and D). So one variable per slot : ChoixHeroA / ChoixHeroB / ChoixHeroC / ChoixHeroD
It would make me earn a lot of event, especially on the smooth HP bar system that use an "every tick" event to use them in expression to remplace the Hero name by the name contained in the variable. But I can't do it so I must make every scenario possible, that is a long thing to do (not a problem , i can deal with it), but also CPU consummating .
Here what I want to do ( would make 4 events only : one per slot) :
lerp(self.width, (ChoixHeroA.POWER/ChoixHeroA.POWER_MAX)*BarrePOWER_A.LargeurInitiale, 5*dt)
Here what i have to do ( make 40 events : 4 slots x 10 hero) :
lerp(self.width, (HardcoreGirl.POWER/HardcoreGirl.POWER_MAX)*BarrePOWER_A.LargeurInitiale, 5*dt)
Sorry if it's a noob question (I'm more into graphics stuff than development), and thanks you for your responses.
If it's can help here's a link to the very alpha of a level, the expression talks about the red bar to the left : http://alphatest.freeteknodefense.com/
(arrow for moving, "E" to switch between heroes - or gamepad and "B" to switch)