Opening capx files & Putting sounds in arrays

Get help using Construct 2

Post » Thu Jan 10, 2013 1:54 am

Hello there Scirra Community,

I have downloaded some capx files from other posts showing me how to solve some problems, but after saving the capx files I can't seem to run it. I get the Failed to Open Project error. Cannot find object texture file 'GreenFelt.png' in the project texture folder. Check the file has been renamed or removed. Under element: c2project \ object-folder \ object-type Line 21, column 9

I don't think I'm missing anything because I just downloaded it and opened it. Am I missing anything?

I'm also currently want to make a simple game where I click on a sprite (which in this case is Stewie from Family Guy) and it would play a dialogue of his. I want to put these dialogue (which are sound/music files) into an array and have it randomize every time I click on the sprite. I can't seem to find any guides on setting a value on a array that isn't a number or word. I also am not sure on how to randomize the array so that once I have the X value selected it would play the dialogue. The array is only 1 dimensional so there isn't nothing too complex about the game.

Thanks for your help! I really appreciate it.
B
6
S
3
G
3
Posts: 9
Reputation: 2,425

Post » Thu Jan 10, 2013 7:44 am

array's only take number and words. however the word is enought. keep in mind that the word can match a file name.

stewarray(name of sound file references inside)
insult1
smarmycomment
funnysound


on sprite clicked -> playaudio(floor(random(0,3))
B
87
S
18
G
9
Posts: 2,455
Reputation: 14,834

Post » Fri Jan 11, 2013 12:01 am

Thank you for your assistance Jayderyu I was wondering the action playaudio(floor(random(0,3)) is playaudio under Audio or is playaudio the name of the array?   
B
6
S
3
G
3
Posts: 9
Reputation: 2,425

Post » Fri Jan 11, 2013 12:31 am

I think he was just using pseudo code to refer to the audio object. Audio -> play (by name) I think it is.
B
15
S
5
G
7
Posts: 877
Reputation: 5,650

Post » Fri Jan 11, 2013 12:39 am

There's no value I could set there it only requests Audio file name and tag. I put in floor(random(0,3)) in both of those one at a time and it doesn't seem work so I don't think it's Audio -> play(by name).
B
6
S
3
G
3
Posts: 9
Reputation: 2,425

Post » Fri Jan 11, 2013 2:57 am

Ahh I think I was thinking of Construct Classic then. Haven't used audio in C2 yet. I'll see tomorrow what I can come up with if no one else has.
B
15
S
5
G
7
Posts: 877
Reputation: 5,650

Post » Fri Jan 11, 2013 3:26 am

Import your sounds. Put the names in an array. Reference the array for the names.


SoundNameInArray.capxblackhornet2013-01-11 03:29:58
ImageImageImage
B
67
S
19
G
121
Posts: 3,196
Reputation: 72,879

Post » Fri Jan 11, 2013 6:43 am

[QUOTE=blackhornet] Import your sounds. Put the names in an array. Reference the array for the names.


SoundNameInArray.capx[/QUOTE]

@blackhornet i went this page but not found.
B
95
S
25
G
20
Posts: 3,052
Reputation: 22,613

Post » Fri Jan 11, 2013 7:10 am

Alternate: SoundNameInArray.ZIP

Just change .ZIP to .CAPX
ImageImageImage
B
67
S
19
G
121
Posts: 3,196
Reputation: 72,879


Return to How do I....?

Who is online

Users browsing this forum: Lof, totoe and 2 guests