SOLVED Error Sound in a colision *not set before reading it.*

Z

zarconi

Guest
___________________________________________
############################################################################################
ERROR in
action number 1
of Step Eventobj_point
for object obj_player:

Variable obj_player.snd_comiendo(100026, -2147483648) not set before reading it.
at gml_Object_obj_player_Collision_obj_point (line 4) - audio_play_sound(snd_comiendo,10,0);
############################################################################################
gml_Object_obj_player_Collision_obj_point (line 4)

I've been trying to create a game where the player collides with an object to obtain points and when colliding the object
has to make a sound, but I get the above message.
I'm new to GML and the truth is I haven't found any solution, huh I followed tutorials and I can't find anything, I just have the error with the collisions.

Any help is welcome.
Thank you.
 

Slyddar

Member
Variable obj_player.snd_comiendo(100026, -2147483648) not set before reading it.
One possibility is there is no resource named "snd_comiendo". Have you created the sound file? If so, the name of the sound file may not be the same as the one you are using in this function : audio_play_sound(snd_comiendo,10,0);
 
Z

zarconi

Guest
One possibility is there is no resource named "snd_comiendo". Have you created the sound file? If so, the name of the sound file may not be the same as the one you are using in this function : audio_play_sound(snd_comiendo,10,0);
All the sounds are inside the project's sounds folder, also I have already created the sound files
 
Please show us all the code in that event, and a screenshot of your Resource Tree showing the sounds that you have in your project.
Other than that, have you tried using the broom icon to clean your project cache?
 
Z

zarconi

Guest
Please show us all the code in that event, and a screenshot of your Resource Tree showing the sounds that you have in your project.
Other than that, have you tried using the broom icon to clean your project cache?
This is the code of that event, it is a colision

global.Points += 10;

audio_play_sound(snd_comiendo,10,false);

with(other)
{
instance_destroy();
}

I just used the broom and it still doesn't work

Arbol.png
 

SoapSud39

Member
You should try importing a sound into the snd_comiendo asset before calling it. Right now it shows that there's no actual audio file (note the 0.00/0.00s).

In case you didn't know, it's the three dots next to the name.
 
Z

zarconi

Guest
You should try importing a sound into the snd_comiendo asset before calling it. Right now it shows that there's no actual audio file (note the 0.00/0.00s).

In case you didn't know, it's the three dots next to the name.
I just did it and I keep getting the same error :,(
 

Slyddar

Member
I just did it and I keep getting the same error :,(
Try deleting the snd_comiendo resource from within Gamemaker, and then drag the sound you want to use from Windows Explorer into Gamemaker. Then name it correctly inside of Gamemaker. Ensure the length of the sound file shows correctly.
 
Z

zarconi

Guest
Try deleting the snd_comiendo resource from within Gamemaker, and then drag the sound you want to use from Windows Explorer into Gamemaker. Then name it correctly inside of Gamemaker. Ensure the length of the sound file shows correctly.
I just did it and I get the same error
 
Z

zarconi

Guest
I
Try deleting the snd_comiendo resource from within Gamemaker, and then drag the sound you want to use from Windows Explorer into Gamemaker. Then name it correctly inside of Gamemaker. Ensure the length of the sound file shows correctly.


I could fix it, I did what you told me again and a new window appears where it gives me the option to "Save", apparently I had to click it so that the sound imported correctly

Thank you all very much for your help, really! : , )
 
Top