Gamestudio Links
Zorro Links
Newest Posts
Newbie Questions
by fairtrader. 12/06/23 11:29
Zorro Trader GPT
by TipmyPip. 12/04/23 11:34
Square root rule
by Smallz. 12/02/23 09:15
RTest not found error
by TipmyPip. 12/01/23 21:43
neural function for Python to [Train]
by TipmyPip. 12/01/23 14:47
Xor Memory Problem.
by TipmyPip. 11/28/23 14:23
Training with command line parameters
by TipmyPip. 11/26/23 08:42
Combine USD & BTC Pairs In Asset Loop
by TipmyPip. 11/26/23 08:30
AUM Magazine
Latest Screens
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Who's Online Now
7 registered members (fairtrader, Quad, miwok, Martin_HH, AndrewAMD, alibaba, dpn), 581 guests, and 0 spiders.
Key: Admin, Global Mod, Mod
Newest Members
fairtrader, hus, Vurtis, Harry5, KelvinC
19019 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
about media again *-* #102025
12/13/06 13:30
12/13/06 13:30
Joined: Nov 2006
Posts: 47
V
viva Offline OP
Newbie
viva  Offline OP
Newbie
V

Joined: Nov 2006
Posts: 47
i use media_play for my level but when the level change, song doesn't change. If i want song stop when level change. What code do i have to use?? Thanks

Re: about media again *-* [Re: viva] #102026
12/13/06 22:08
12/13/06 22:08
Joined: Aug 2005
Posts: 1,185
Ukraine
Lion_Ts Offline
Serious User
Lion_Ts  Offline
Serious User

Joined: Aug 2005
Posts: 1,185
Ukraine
you have to handle the media handle
like this:
Code:

var curr_song;
...
curr_song=media_play(...);
...
//somewhere in your code:
media_stop(curr_song);
level_load(...);
wait(3);
curr_song=media_play(...);



Re: about media again *-* [Re: Lion_Ts] #102027
12/14/06 12:16
12/14/06 12:16
Joined: Nov 2006
Posts: 47
V
viva Offline OP
Newbie
viva  Offline OP
Newbie
V

Joined: Nov 2006
Posts: 47
thanks

Re: about media again *-* [Re: viva] #102028
12/14/06 13:14
12/14/06 13:14
Joined: Nov 2006
Posts: 47
V
viva Offline OP
Newbie
viva  Offline OP
Newbie
V

Joined: Nov 2006
Posts: 47
var curr_song;
...
curr_song=media_play(...song in current level...);
...
//somewhere in your code:
media_stop(curr_song);
level_load(...next level....);
wait(3);
curr_song=media_play(...song in next level...);


am i right?? and can i put this in main function

media_stop(curr_song);
level_load(...next level....);
wait(3);
curr_song=media_play(...song in next level...);

Thanks very much

Re: about media again *-* [Re: viva] #102029
12/15/06 02:48
12/15/06 02:48
Joined: Aug 2005
Posts: 1,185
Ukraine
Lion_Ts Offline
Serious User
Lion_Ts  Offline
Serious User

Joined: Aug 2005
Posts: 1,185
Ukraine
yes, you got it.
but viva, you HAVE TO put any your code in a function (main or any other), don't place commands (except declarations) outside functions! It's possible with old syntax, but this is 'unwelcome' style
next step, after you learn more about snd_... and media_... is to write a sound manager function for your project (function or group of functions to control sound in your game. this manager can check some vars and skills and plays needed sound with fading, etc. That vars (skills) you assign in other place in your code). this is the common technique - splitting project for a manageable blocks.

Re: about media again *-* [Re: Lion_Ts] #102030
12/15/06 18:34
12/15/06 18:34
Joined: Nov 2006
Posts: 47
V
viva Offline OP
Newbie
viva  Offline OP
Newbie
V

Joined: Nov 2006
Posts: 47
thanks again Lion_Ts. anyway i have new question about media *-*. Can 3d GameStudio/A6 Standard and GameStudio/A6 Extra play .avi and .mp3 files?

Re: about media again *-* [Re: viva] #102031
12/17/06 06:29
12/17/06 06:29
Joined: Aug 2005
Posts: 1,185
Ukraine
Lion_Ts Offline
Serious User
Lion_Ts  Offline
Serious User

Joined: Aug 2005
Posts: 1,185
Ukraine
you can read about it on 3dgs main page http://www.conitec.net/english/gstudio/3dgs2.htm#editionen or in the manual

in short: NO, with A6comm, at least, you can do that. may be i'm wrong about avi (i have A6comm), may be not.

Re: about media again *-* [Re: Lion_Ts] #102032
12/18/06 14:55
12/18/06 14:55
Joined: Nov 2006
Posts: 47
V
viva Offline OP
Newbie
viva  Offline OP
Newbie
V

Joined: Nov 2006
Posts: 47
i try to use your code but when level change song doesn't change. This is my code. please check it. thx.

function main()
{
var curr_song;
curr_song=media_play("song_game1.wma",null,100);
{
media_stop(curr_song);
level_load("tst2.wmb");
wait(3);
curr_song=media_play("song_game2.mp3",null,100);

Re: about media again *-* [Re: viva] #102033
12/19/06 22:08
12/19/06 22:08
Joined: Aug 2005
Posts: 1,185
Ukraine
Lion_Ts Offline
Serious User
Lion_Ts  Offline
Serious User

Joined: Aug 2005
Posts: 1,185
Ukraine
viva, look at your code once more.
you start first song, then stop it, load level and start next song. All these steps in one frame. as result, your second song plays only.
if you want to play first song before level loaded (while splashscreen visible, for example), make some delay with while() loop.

Re: about media again *-* [Re: Lion_Ts] #102034
12/20/06 12:23
12/20/06 12:23
Joined: Nov 2006
Posts: 47
V
viva Offline OP
Newbie
viva  Offline OP
Newbie
V

Joined: Nov 2006
Posts: 47
i want an example. thanks

Page 1 of 2 1 2

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1