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
3 registered members (AndrewAMD, Ayumi, NewbieZorro), 14,141 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
how do you add sound without it repeating itself?? #69453
04/02/06 15:50
04/02/06 15:50
Joined: Mar 2006
Posts: 43
J
jamesk85 Offline OP
Newbie
jamesk85  Offline OP
Newbie
J

Joined: Mar 2006
Posts: 43
Hey I've recorder some stuff I want to put into my game. I was just wondering how do you make it so the sound doesnt repeat over and over....or how do you add sound to a model so that when it the avatar touches the model the sound will begin.
I know how to bring up panels with text etc when the models touch but not sound. any help soon would be much appreciated!!

Re: how do you add sound without it repeating itself?? [Re: jamesk85] #69454
04/02/06 17:37
04/02/06 17:37
Joined: Dec 2005
Posts: 490
Germany/Berlin-Velten
kasimir Offline
Senior Member
kasimir  Offline
Senior Member

Joined: Dec 2005
Posts: 490
Germany/Berlin-Velten
try this:

string misc_snd = <misc.wav>; //misc = name of sound

function event_touched
{
if(event_type == event_impact)
{
ent_playsound(my,misc_wav,50);
}
}

action touch_me
{
my.enable_impact = on;
my.event = event_touched;
...

Re: how do you add sound without it repeating itself?? [Re: kasimir] #69455
04/02/06 18:09
04/02/06 18:09
Joined: Mar 2006
Posts: 43
J
jamesk85 Offline OP
Newbie
jamesk85  Offline OP
Newbie
J

Joined: Mar 2006
Posts: 43
Thanks for the reply..
Am I tried that (I think)...but this is my code so far...
entity* cyborg_h2_mdl_008;

Panel informationpanel5
{
Layer 2;
bmap = intro1;
flags = refresh,d3d;//,transparent
}

Panel informationpanel6
{
layer 2;
bmap = intro2;
flags = refresh, d3d;//transparent
}

text you_did3
{
pos_x = 300;
pos_y = 40;
//font = arial_font;
layer = 10;
flags = d3d, center_x, center_y, narrow;


}

function text3()
{
//cyborg_h2_mdl_008 = ent_playsound(my, introduction,100);



informationpanel5.visible = on; //make the panel b seen
you_did3.visible = on; //position the panel at the top right hand corner of the screen
wait(50);
while (key_c == 0) {wait (1);} // wait until the "C" key is pressed
while (key_c == 1) {wait (1);} // wait until the "C" key is released
informationpanel5.visible = off; //once c is pressed take away the panel
you_did3.visible = off;

informationpanel6.visible = on; //call the next panel once the first is closed and apply the same
you_did3.visible = on;
while (key_c == 0) {wait (1);} // wait until the "space" key is pressed
while (key_c == 1) {wait (1);} // wait until the "space" key is released
informationpanel6.visible = off;
you_did3.visible = off;
wait(1);


}

function event_playerstouch()
{
if(event_type == event_impact)
{
cyborg_h2_mdl_008 = ent_playsound(my, introduction,100);
}
}

action displayinfo3
{
MY.ENABLE_IMPACT = ON;
MY.EVENT = text3;
MY.EVENT = event_playerstouch;

}

I've got.....sound introduction = <robIntro.wav>; defined at the top of the script. Here it compiles and runs fine but when you touch of cybourg the sound is all dragged out and you can understand it at all. Do you know what wrong.

Re: how do you add sound without it repeating itself?? [Re: jamesk85] #69456
04/02/06 18:16
04/02/06 18:16
Joined: Mar 2006
Posts: 43
J
jamesk85 Offline OP
Newbie
jamesk85  Offline OP
Newbie
J

Joined: Mar 2006
Posts: 43
sorry that code was indented in the comment box.....

Re: how do you add sound without it repeating itself?? [Re: jamesk85] #69457
04/02/06 20:10
04/02/06 20:10
Joined: Dec 2005
Posts: 490
Germany/Berlin-Velten
kasimir Offline
Senior Member
kasimir  Offline
Senior Member

Joined: Dec 2005
Posts: 490
Germany/Berlin-Velten
yes i know... event_playerstouch is called many times because the player is touching him a longer time.
try something like this:

my.skill1 = 0;

function event_playerstouch
{
event_type == event_impact && my.skill1 == 0)
{
my.skill1 = 1;
cyborg_h2_mdl_008 = ent_playsound(my, introduction,100);
wait(320);
my.skill1 = 0;
}
...

//not fine but works!!!


Moderated by  HeelX, rvL_eXile 

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