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
2 registered members (TipmyPip, AndrewAMD), 14,540 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 2 of 3 1 2 3
Re: Play wav file [Re: Xarthor] #122794
04/11/07 18:10
04/11/07 18:10
Joined: Oct 2000
Posts: 113
L
Lawrence Offline OP
Member
Lawrence  Offline OP
Member
L

Joined: Oct 2000
Posts: 113
I tried using plbiped it causes errors, such as parameter unknown plbiped, etc.

Lawrence

Re: Play wav file [Re: Lawrence] #122795
04/11/07 18:22
04/11/07 18:22
Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
Xarthor Offline
Expert
Xarthor  Offline
Expert

Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
Ok maybe you should do a search in the templates forum or ask there.
Sorry I have no clue about the template scripts.

Re: Play wav file [Re: Xarthor] #122796
04/11/07 19:54
04/11/07 19:54
Joined: Sep 2003
Posts: 733
Whitefish, Montana
JazzDude Offline
User
JazzDude  Offline
User

Joined: Sep 2003
Posts: 733
Whitefish, Montana
If I understand your problem then this would work:

Code:
sound statue_talk = <talk.wav>;
action statue
{
while(me != null)
{
if(vec_dist(my.x,player.x) < 80)
{
snd_play(statue_talk,100,0);
while(vec_dist(my.x,player.x) < 80)
{ sleep(3); } //wait until the player goes out of range
}
wait(1);
}
}



Re: Play wav file [Re: JazzDude] #122797
04/12/07 13:26
04/12/07 13:26
Joined: Oct 2000
Posts: 113
L
Lawrence Offline OP
Member
Lawrence  Offline OP
Member
L

Joined: Oct 2000
Posts: 113
Hi JazzDude,

This gives me a

Malfunction W1501
Empty pointer in Statue: (vec_dist(my.x,player.x)<80)

This the error Thunder was talking about when you don't set the pointer for player. We are getting an empty pointer for player.

Lawrence

Re: Play wav file [Re: Lawrence] #122798
04/12/07 13:42
04/12/07 13:42

A
Anonymous
Unregistered
Anonymous
Unregistered
A



Hi!

write the line player=me; topmost of your models action.


If "player" is used by an other model you have to create an own pointer for your model, e.g.: entity* my_player; write the line my_player=me; topmost of your models action and replace all "player" with "my_player" in the music-scripts above.


The best is you learn to understand how to work with pointer/handles/entities/...


Re: Play wav file [Re: ] #122799
04/12/07 13:46
04/12/07 13:46
Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
Xarthor Offline
Expert
Xarthor  Offline
Expert

Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
@Mercuryus:
He is using the templates, so the easiest thing would be to find out what entity pointer the templates_6 movement uses for the player entity.

Re: Play wav file [Re: Xarthor] #122800
04/12/07 17:28
04/12/07 17:28
Joined: Oct 2000
Posts: 113
L
Lawrence Offline OP
Member
Lawrence  Offline OP
Member
L

Joined: Oct 2000
Posts: 113
Looking at the plbiped01 it seems to be using "my" as the player entity. But I am not sure.

I am trying to learn and understand the pointer/handles/entity and how they work, which is why I am having this problem. Now Mercurvus I am not sure where you want me to place these entity pointers. The player model is attached to plbiped01.wdl.

When I created my script file I used _A6_template_project.

Re: Play wav file [Re: Lawrence] #122801
04/12/07 17:33
04/12/07 17:33
Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
Xarthor Offline
Expert
Xarthor  Offline
Expert

Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
No the pointer is actually:
plBiped01_entity

At least thats what I see from looking at the plBiped01.wdl file.

Edit:
Code:

// set global player biped entity pointer to this object
plBiped01_entity = me;


Thats the important line in the PlBiped01 action, as you can see it uses the entity pointer plBiped01_entity to refer to itself on a global level.

Last edited by Thunder; 04/12/07 17:34.
Re: Play wav file [Re: Xarthor] #122802
04/12/07 17:41
04/12/07 17:41
Joined: Oct 2000
Posts: 113
L
Lawrence Offline OP
Member
Lawrence  Offline OP
Member
L

Joined: Oct 2000
Posts: 113
So do I set player = me or player = plBiped01_entity and where do I set it.

Thanks

Lawrence

Re: Play wav file [Re: Lawrence] #122803
04/12/07 17:43
04/12/07 17:43
Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
Xarthor Offline
Expert
Xarthor  Offline
Expert

Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
No just use plBiped01_entity instead of player:
Code:

sound snd_hello = <hello_player.wav>; // your wav (adjust)

action statue {
var lv_snd_dist = 100; // 100 quants for play (adjust)
var lv_snd_hdl; // sound handle

// wait for player...
while(!plbiped01_entity){wait(1);}

// statue loop
while(1){
// play when approaching
if(vec_dist(plbiped01_entity.x,my.x)<lv_snd_dist && !snd_playing(lv_snd_hdl)){
lv_snd_hdl=snd_loop(snd_hello, 100, 0); // play the sound
}

// stop loop
if(vec_dist(plbiped01_entity.x,my.x)>lv_snd_dist && snd_playing(lv_snd_hdl)){
snd_stop(lv_snd_hdl);
}
wait(1);
}
}



Page 2 of 3 1 2 3

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

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