Sound2

Non-platform specific questions.

Sound2

Postby Marko » Wed Nov 01, 2006 10:03 pm

I've got a big problem.

if I add events "CREATE ACTOR" and add action PLAYSOUND2 then when the actor creates it plays

music. But if instead PLAYSOUND2 I add a script in which I put the order playsound2 nothing is

heard?!

Shouldn't it be the same?

Marko
Marko
 
Posts: 17
Joined: Sun Oct 09, 2005 9:44 am
Score: 0 Give a positive score

Postby makslane » Thu Nov 02, 2006 12:48 am

Yes, is the same thing.
What's your code?
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score

Postby Marko » Thu Nov 02, 2006 9:32 pm

A code?

If you mean the code that is in the script actorcreate - that is for now only an order that plays sound2. Later I would put the "if" logic, but first it has to play the sound.

To explain the code (since these are the final phases)

There is an actor that is created. When it is created, sound2 is used from the script, and everything is ok then. After a few seconds that actor is being destroyed. In event "destroy actor" a script is opened that calls different functions and creates new actors.

The actor I have problems with is created through such a function, and, depending on a level, gives an animation saved in that actor. It works fine, but if I put on that actor "on create" and the sound from the script, it doesn't work, and the other one does???

Marko
Marko
 
Posts: 17
Joined: Sun Oct 09, 2005 9:44 am
Score: 0 Give a positive score

Postby makslane » Fri Nov 03, 2006 1:05 pm

Please, post the script that doesn't work.
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score

Postby Marko » Sat Nov 04, 2006 5:26 pm

Code: Select all
void NewMission(){
 if(level==0){

 DestroyActor("selector");
 DestroyActor("Where_move");
 CreateActor("StartMission", "Helo_in_game", "Game", "no path", 0, 0, true);
 CreateActor("SelectorMission", "kursor_1", "no parent", "no path",xmouse,ymouse, true);
 PlaySound2("data/CompletedMission.wav",Volume, 1, Volume);
 };
 
 if(level==1){
 
 
 DestroyActor("selector");
 DestroyActor("Where_move");
CreateActor("StartMission", "Mission1", "Game", "no path", 0, 0, false);
 CreateActor("SelectorMission", "kursor_1", "no parent", "no path",xmouse,ymouse, true);
 PlaySound2("data/CompletedMission.wav",Volume, 1, Volume);
 };
 
 
 if(level==4){
 
 DestroyActor("selector");
 DestroyActor("Where_move");
CreateActor("StartMission", "ahoy", "Game", "no path", 0, 0, false);

CreateActor("SelectorMission", "kursor_1", "no parent", "no path",xmouse,ymouse, true);
 PlaySound2("data/CompletedMission.wav",Volume, 1, Volume);};
          if(level==lastlevel){

 
 DestroyActor("selector");
 DestroyActor("Where_move");

 CreateActor("StartMission", "demo_podloga", "(none)", "(none)",250, 0, false);
 CreateActor("SelectorMission", "kursor_1", "no parent", "no path",xmouse,ymouse, true);
 PlaySound2("data/CompletedMission.wav",Volume, 1, Volume);
 };
 };


In the Actor "StartMission" the same as the levels change, so does the animations change but nothing can be heard?

THNX!
Marko
 
Posts: 17
Joined: Sun Oct 09, 2005 9:44 am
Score: 0 Give a positive score

Postby makslane » Sat Nov 04, 2006 7:43 pm

Are you calling the NewMission() function in some script?
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score

Postby Marko » Sun Nov 05, 2006 5:08 pm

In script Destroy Actor

Code: Select all
int xx;
for(xx=0;xx<64;xx++){vidim[xx]=0;atack[xx]=0;}


destroy_all();
level++;


newlevel();
zbraja();

amo+=3;

px=4;
py=7;
MoveTo("Player", 36.000000,255.000000, 1000.000000, "Game");

CreateActor("selector", "kursor2", "no parent", "no path", 0, 0, false);
NewMission();



THNX
Marko
 
Posts: 17
Joined: Sun Oct 09, 2005 9:44 am
Score: 0 Give a positive score

Postby makslane » Sun Nov 05, 2006 7:30 pm

I can't see what's wrong.
Can you send me the game?
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score

Postby Marko » Sun Nov 05, 2006 8:18 pm

I Can,but the game is too complex,and I think that it isn't
the GM-BUG but it's some my stupid mistake that I hope I could avoid.

Marko
Marko
 
Posts: 17
Joined: Sun Oct 09, 2005 9:44 am
Score: 0 Give a positive score

Postby Game A Gogo » Mon Nov 06, 2006 12:29 am

Marko wrote:I Can,but the game is too complex,and I think that it isn't
the GM-BUG but it's some my stupid mistake that I hope I could avoid.

Marko

Nothing is too complex for makslane, hes the that created GE after all!
Programming games is an art,
    Respect it.
User avatar
Game A Gogo
 
Posts: 3466
Joined: Wed Jun 29, 2005 10:49 pm
Location: French Canada *laughs*
Score: 181 Give a positive score

Postby Marko » Mon Nov 06, 2006 7:02 pm

Game A Gogo,I believe it is so, but since I think that it isn't the GE-bug it would be a waste of time for makslane to try to solve my bug problem, which, considering the code (I've got a lot of codes and actors), is not easy to find in five minutes.

Although, I would be very happy if someone would do this instead of me. :roll:

Marko
Marko
 
Posts: 17
Joined: Sun Oct 09, 2005 9:44 am
Score: 0 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest