My 'Help Me' Thread

For questions about using Classic.

Post » Fri Jan 30, 2009 1:39 pm

It allows you to jump higher the longer you hold the jump key.
Scirra Founder
B
359
S
214
G
72
Posts: 22,949
Reputation: 178,534

Post » Fri Jan 30, 2009 10:32 pm

4) I'm trying to understand the resources tab now. Basically, that's where all the content is being stored if we're exporting to the .exe, right? So this is where I store sounds and stuff.

I'm not sure I understand the structure though. Do I just add all the resources I need under 'Binary'? Would I add the sounds to Binary? I can't add a submenu there, which means that it'd be quite messy after a while.

Also, if I rmb on the 'Font' Resource, nothing at all happens. Does that mean that I can't add my own fonts?
B
6
S
2
G
3
Posts: 520
Reputation: 2,690

Post » Fri Jan 30, 2009 11:53 pm

5) Can't seem to find out how to do this:

I want to have a global variable called 'Gold'. Whenever the player picks up a gold coin, I'll add +1 to this global variable - I can do that. Here's the tricky part:

I want to display the Gold Global Variable on top of the screen, in the hud - so that the player always knows how much gold he has already collected.

So how do I tell a text object to simply display the number in the gold variable?
B
6
S
2
G
3
Posts: 520
Reputation: 2,690

Post » Sat Jan 31, 2009 12:24 am

Set the text to global('Gold').

Resources bar: parts of it are not yet implemented. Hopefully it'll all be done by 1.0.
Scirra Founder
B
359
S
214
G
72
Posts: 22,949
Reputation: 178,534

Post » Sat Jan 31, 2009 12:47 am

Awesome, thanks a lot! :)
B
6
S
2
G
3
Posts: 520
Reputation: 2,690

Post » Sat Jan 31, 2009 6:09 pm

6) Pause:

Dunno if I got that logic right. What I did was:

On "Pause" pressed - System: Set Time Scale to 0

That works. Then I want to set the Time back to 1 if I hit "Pause" again. So my thought was:

On "Pause" pressed, Timer is equal to 0 - System: Set Time Scale to 1

I guess my thought process is wrong in that case, right?

2) The 'GoldValueField' - I have a HUD with a Text called 'Gold' - underneath it, I wanted to create a text object (called 'GoldValueField') that displays the Gold value from the 'Gold' global variable that I set. So I created a:

Start of Layout - goldValueField: Set text to global('Gold')

Now, it seems to work, since it displays that global variables initial value (0)

Then I created a 'coin' object and wanted to add '10' to the Gold global variable whenever a coin is collected, so I created this event:

Player overlaps Coin - System: Add 10 to global variable 'Gold'

Didn't work. I grab the coin, but the goldValueField doesn't update. It still says '0'

The curious thing is that the same event works for private variables.

I have a 'heart' object and created the following event:

Player overlaps Heart - Player: Set 'Hearts' to 1

And I have a heart icon in the hud that has 2 animation frames. If the 'Hearts' Private Variable is set to 0, it displays the EmptyHeart Frame. If the 'Hearts' variable is at 1, it displays the full heart.

This works. It's the same logic behind both events, it works for private variables, but doesn't seem to work for global variables. What am I missing here?
B
6
S
2
G
3
Posts: 520
Reputation: 2,690

Post » Sun Feb 01, 2009 12:43 am

[quote="thomasmahler":r751qiqn]On "Pause" pressed - System: Set Time Scale to 0

That works. Then I want to set the Time back to 1 if I hit "Pause" again. So my thought was:

On "Pause" pressed, Timer is equal to 0 - System: Set Time Scale to 1

I guess my thought process is wrong in that case, right?[/quote:r751qiqn]

You're changing your TimeScale from 1 to 0 and back to 1 in the same tick. Use Else:

[code:r751qiqn]
+On "Pause" pressed
+TimeScale is equal to 1
->Set TimeScale to 0
+Else
->Set TimeScale to 1
[/code:r751qiqn]

As for this...

[quote="thomasmahler":r751qiqn]Start of Layout - goldValueField: Set text to global('Gold')[/quote:r751qiqn]

Look at that trigger there. It says "Start of layout." So when do you think it will perform that action?

Try "Always" insead ;)
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Sun Feb 01, 2009 10:05 am

Oh man, that makes so much sense now :)

My thought process was that 'Start of Layout' means that the event starts as soon as the layout starts and then just keeps going.

Thanks a lot for the constant help, deadeye, you rock!
B
6
S
2
G
3
Posts: 520
Reputation: 2,690

Post » Sun Feb 01, 2009 12:53 pm

A slightly simplified version of doing the TimeScale is..

- On pause pressed
+ Set TimeScale to 1 - TimeScale
B
3
S
2
G
5
Posts: 1,777
Reputation: 5,529

Post » Sun Feb 01, 2009 3:51 pm

[quote="Rich":2wghmt8b]- On pause pressed
+ Set TimeScale to 1 - TimeScale[/quote:2wghmt8b]

Could you elaborate on that? Not quite sure how I'd set that up.
B
6
S
2
G
3
Posts: 520
Reputation: 2,690

PreviousNext

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 3 guests