Help with a project

Discussion and feedback on Construct 2

Post » Thu Oct 13, 2011 9:12 am

Okay, I thought this would be easy enough to figure out, but I am stuck in a silly part. I am trying to make a little player thing, which I want to use to play my games OST. The problem, is that I made it, so that when you click on the play icon, it plays the song and sets a variable called "Playing" to 1, and it also changes the play icon to a stop one. Problem is, things are happening too fast I think, and only one of the blocks happen, whichever is beneath the other one. So if the "play" block is under the the "stop" block, only the play block will happen, and vice-versa. I have tried using, trigger only once, but it is not working... I am clearly missing something.

Here is the project with capx included.VampyricalCurse2011-10-13 09:12:54
B
47
S
10
G
6
Posts: 455
Reputation: 8,326

Post » Thu Oct 13, 2011 4:34 pm

here is my take on it.
link to .capx

sprite now has two animations. play and stop. and a Boolean variable "active" that toggles when its events trigger.

It seemed like before it was doing all the events , so each click was starting the song, and also stopping it in the same tick. I'm also unclear if invisible will keep a sprite from being clicked. I've never tried.

Others I'm sure will have a more elegant solution but hey I'm still learning     onzephyr2011-10-13 16:34:40
B
84
S
12
G
9
Posts: 99
Reputation: 9,508

Post » Thu Oct 13, 2011 4:58 pm

@onzephyr: You provided an already elegant solution enough. Well done.
Apparently it looked to me that Both sprites were clicked, since if you moved sprite2 away from sprite, the code of VampyricalCurse's capx worked.
It maybe had to see with the z-order, I'm not sure though.

Anyway, good job.
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 6,998
Reputation: 57,791

Post » Thu Oct 13, 2011 10:39 pm

I see! I've tried the Boolean option before, but it wasn't working. I thought about animations, but I didn't think it would make a difference. The biggest difference I see, is that you used Sub-Events effectively, which I am not used to at all (I was an MMF2 user), I am gonna have to get around that sometime. =\

This solution is great and I do not think it needs anymore "elegance", it was clean and easy to understand. Superbly done, onzephyr.

Now onto figuring out how to do this with 26+ songs.
B
47
S
10
G
6
Posts: 455
Reputation: 8,326

Post » Sat Oct 15, 2011 10:40 pm

Okay, since this issue has to do with this same project, I will post here.

All is working well, the project works while in the editor and also after import... problem is, it will not work after uploading it to my server... Not only will the songs not play, but the code itself will not work either. It will work for the play part, but after stopping it, the sprites do not work anymore. O____O

This is kind of weird, I cannot imagine why this is happenning??

Here's the link.VampyricalCurse2011-10-15 22:42:18
B
47
S
10
G
6
Posts: 455
Reputation: 8,326

Post » Sat Oct 15, 2011 11:56 pm

Your link gives an error 404.
Also where did you upload your sprites and medias ?

It has probably something to see with your host, not giving access to the files, or the files sitting in the wrong place (not in the right folder or something), else all should be fine.
Pay attention, online, "Player" is not the same as "player" (case-sensitive).
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 6,998
Reputation: 57,791

Post » Mon Oct 17, 2011 12:57 am

[QUOTE=Kyatric] Your link gives an error 404.
Also where did you upload your sprites and medias ?

It has probably something to see with your host, not giving access to the files, or the files sitting in the wrong place (not in the right folder or something), else all should be fine.
Pay attention, online, "Player" is not the same as "player" (case-sensitive).[/QUOTE]

Could be, but this is the process I go through:
Export app./game.
Zip the folder, named by C2 itself (I never renamed anything)
Upload to my Public folder on my server.
Unzip the contents to its own folder, all names, folders, etc. have been kept, no names have be changed.
I try the app. and it behaves extremely erratic.

=\VampyricalCurse2011-10-17 00:58:08
B
47
S
10
G
6
Posts: 455
Reputation: 8,326


Return to Construct 2 General

Who is online

Users browsing this forum: anty21ro, nimos100, Yahoo [Bot] and 9 guests