|
on sound playing
#386628
11/06/11 19:08
11/06/11 19:08
|
Joined: Feb 2006
Posts: 124 Dallas,TX
Delirium
OP
Member
|
OP
Member
Joined: Feb 2006
Posts: 124
Dallas,TX
|
This is really embarrassing....I know, I know, read the manual. I have been. I don't want to bother an expert, perhaps another newbie to lite-c who has gotten this to work can help.
I'm making an action where when you impact an object, it makes a sound. Once. The impact part is correct. the function the impact calls just needs to play a sound. before the level will run it tells me undeclared variable, so i tried declaring it first half a dozen ways, sound ="noise.wav"; Ent noise="noise.wav", or <noise.wav> etc sometimes with asteriks like it shows. I tried it using media handle. I did read the manual and studied it's multitudinous sound commands, for loops, for checking if it's playing etc. What is the right and simplist way to play a sound from a function? I have been trying, but after an hour of trying it different ways.. how do you do it in lite_C? Please. Some beginner tell me quick before a senior expert sees I've asked another embarrassing question. I really think they should add another catefory in the forum, lite-c for dummies.
Learning to write lite-C -- A8 commercial
|
|
|
Re: on sound playing
[Re: Pappenheimer]
#386631
11/06/11 19:40
11/06/11 19:40
|
Joined: Sep 2003
Posts: 6,861 Kiel (Germany)
Superku
Senior Expert
|
Senior Expert
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
|
You can use Pappenheimer's snd_create and/ or stay with global sounds:
SOUND* snd_event = "event.wav";
void object_event() { snd_play(snd_event,100,0); }
action object() { my.emask |= ENABLE_IMPACT; my.event = object_event; // <- EDIT forgot this line }
Last edited by Superku; 11/06/11 19:48.
"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual Check out my new game: Pogostuck: Rage With Your Friends
|
|
|
case sensitive
[Re: Pappenheimer]
#386633
11/06/11 19:44
11/06/11 19:44
|
Joined: Feb 2006
Posts: 124 Dallas,TX
Delirium
OP
Member
|
OP
Member
Joined: Feb 2006
Posts: 124
Dallas,TX
|
case sensitive? That could explain a lot of my problem with lite-C. Somewhere in C I had hearn case doesn't matter. Okay and thanks, I know something else to watch. And the example you sent to read...
Learning to write lite-C -- A8 commercial
|
|
|
Re: case sensitive
[Re: Delirium]
#386634
11/06/11 19:54
11/06/11 19:54
|
Joined: Feb 2006
Posts: 124 Dallas,TX
Delirium
OP
Member
|
OP
Member
Joined: Feb 2006
Posts: 124
Dallas,TX
|
Oh, I just saw SuperKu's response. Thank you as well for helping. With my lame questions it must sound like I'm not getting anywhere, but in about twenty four hours and using the manuals and the forum I've gotten to the point where I can create a level, get a player moving around with the keys I want, with a great shadow, sky, and am getting into making interactions do things. I appreciate your help. I'll try to read first and ask only as a last resort.
Learning to write lite-C -- A8 commercial
|
|
|
Moderated by mk_1, Perro, rayp, Realspawn, Rei_Ayanami, rvL_eXile, Spirit, Superku, Tobias, TSG_Torsten, VeT
|