Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
1 registered members (TipmyPip), 18,633 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 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 | 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