How do I Display Level in Real time

Get help using Construct 2

Post » Wed Mar 19, 2014 3:37 am

Hello C2's

I come here cause i need a little help ^^,

The level of my player was stocked on an Array Experience ( at Level ),
I wish to display him on my HUD in Real time,
for doing that i've created a text object called level and get him with the event Evry Tick -- > level Set text to Experience.level.

That's working but only for the first level i always see 1 the level don't update when i UP.

( For be sure the player level up i have add a visual effect on the screen when you up and that's work, i'm sure the problem come from the calling method for the level array. )

If someone can help me thank you =D
B
17
S
6
G
1
Posts: 63
Reputation: 1,306

Post » Wed Mar 19, 2014 5:26 am

Every Tick -- > level Set text to Experience.at(level)
Not sure if it was just a typo or if your event is wrong. But showing an image of the event or posting a .capx makes it much easier for us to help
B
83
S
22
G
15
Posts: 1,039
Reputation: 15,219

Post » Wed Mar 19, 2014 6:45 am

Thanks 7Soul,

That's don't work but thank you =)

Anyone else ?
B
17
S
6
G
1
Posts: 63
Reputation: 1,306

Post » Wed Mar 19, 2014 10:12 am

Anybody have a solution please ?
B
17
S
6
G
1
Posts: 63
Reputation: 1,306

Post » Wed Mar 19, 2014 10:34 am

@oOScuByOo
You're not doing enough for people to help you.

As 7Soul suggest, either post your .capx or a snapshot of your events or people will have a difficult time understanding your problem.
If your vision so exceeds your ability, then look to something closer.
Moderator
B
131
S
29
G
81
Posts: 5,328
Reputation: 56,630

Post » Wed Mar 19, 2014 10:41 am

Thanks Zenox and 7Soul, This is the .capx : https://mega.co.nz/#!csx3lQDC!X26Y60RC5zA6p3liO4qpuSaOrs4w3bbYVNVaJG0ty8w

The level was on the left-bottom of the screen.
B
17
S
6
G
1
Posts: 63
Reputation: 1,306

Post » Wed Mar 19, 2014 11:42 am

you use an Array same as a Sprite with instance variables, why ?
B
38
S
13
G
4
Posts: 152
Reputation: 5,142

Post » Wed Mar 19, 2014 12:44 pm

You are using R164 beta version
i cant help you sorry :(
B
17
S
7
Posts: 360
Reputation: 2,202

Post » Wed Mar 19, 2014 4:04 pm

Ok i've found a new thing ...

I have try to get the experience bar progress like the LifeBar,
Then i make a Set with with the mathematic code ( Self.InitialWidth +( Experience.experience - Experience.nextlevel ) * ( Self.InitialWidth/Experience.nextlevel ) ) ( I think it's not good ^^' ... ) But nothing happens ... Then i think it's the same problem as the Level i can't take the information of array, if someone can help me =D
B
17
S
6
G
1
Posts: 63
Reputation: 1,306

Post » Wed Mar 19, 2014 6:03 pm

That's not how you use Arrays... an array is like a table, and you should access its X and Y values. You aren't supposed to give it instance variables, and you're not supposed to use the command "create" as the array is a global object
Check the manual for arrays here
B
83
S
22
G
15
Posts: 1,039
Reputation: 15,219


Return to How do I....?

Who is online

Users browsing this forum: JaredX, MadSpy and 6 guests