Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting > New Scripting Engine (GS2)
FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 01-20-2011, 06:44 PM
Diablo1 Diablo1 is offline
Registered User
Join Date: Jan 2011
Posts: 5
Diablo1 is on a distinguished road
song only heard by me

here is what i scripted but why am i the only one to hear it?
is there a prob?
I just want it to be heard from all peepz thx

//#CLIENTSIDE
function onCreated(){
timeout=.1;
}
function onTimeout(){
play stef12.mid;
timeout=.1;
}
Reply With Quote
  #2  
Old 01-20-2011, 06:50 PM
Fulg0reSama Fulg0reSama is offline
Extrinsical Anomaly
Fulg0reSama's Avatar
Join Date: Sep 2009
Location: Ohio
Posts: 3,049
Fulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant future
Quote:
Originally Posted by Diablo1 View Post
here is what i scripted but why am i the only one to hear it?
is there a prob?
I just want it to be heard from all peepz thx

//#CLIENTSIDE
function onCreated(){
timeout=.1;
}
function onTimeout(){
play stef12.mid;
timeout=.1;
}

Big issue of GS1 and GS2 mixup
Now if you want everyone to hear it a simple way to do this is by a class(not the best but its simple) (I try to give simple answers not most efficient. Someone feel free to correct me)

Put this in a level.
PHP Code:
function onPlayerEnters()
{
join "classname";

Class:
PHP Code:
//#CLIENTSIDE
function onCreated()
{
  
setTimer(0.01);
  
onTimeOut();
}
function 
onTimeOut()
{
  
play ("stef12.mid");
  
setTimer(0.01);

The better way though would to be a tokenized serverflag but I don't have the experience to show proper use of it xP
__________________

Careful, thoughts and opinions here scare people.
Reply With Quote
  #3  
Old 01-20-2011, 07:01 PM
smirt362 smirt362 is offline
Tee Hee
smirt362's Avatar
Join Date: Feb 2005
Location: Texas
Posts: 2,101
smirt362 has a brilliant futuresmirt362 has a brilliant futuresmirt362 has a brilliant futuresmirt362 has a brilliant futuresmirt362 has a brilliant futuresmirt362 has a brilliant futuresmirt362 has a brilliant future
Send a message via AIM to smirt362 Send a message via MSN to smirt362
You might be crazy
__________________

Don Hertzfeldt <3
Reply With Quote
  #4  
Old 01-20-2011, 07:16 PM
Liberated Liberated is offline
not doing alot
Liberated's Avatar
Join Date: Feb 2008
Posts: 1,366
Liberated has a spectacular aura about
or you just make it serverside instead of clientside?
__________________
Quote:
Originally Posted by Tigairius View Post
I promise when I get rich I'll send you an iPhone. I'll send everyone an iPhone.
Reply With Quote
  #5  
Old 01-20-2011, 07:17 PM
Fulg0reSama Fulg0reSama is offline
Extrinsical Anomaly
Fulg0reSama's Avatar
Join Date: Sep 2009
Location: Ohio
Posts: 3,049
Fulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant future
Quote:
Originally Posted by Liberated View Post
or you just make it serverside instead of clientside?
That works too.
__________________

Careful, thoughts and opinions here scare people.
Reply With Quote
  #6  
Old 01-20-2011, 07:26 PM
ffcmike ffcmike is offline
Banned
Join Date: Jul 2004
Location: London
Posts: 2,029
ffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond repute
Send a message via AIM to ffcmike Send a message via MSN to ffcmike
What's wrong with:

PHP Code:
//#CLIENTSIDE
function onPlayerEnters(){
  
playlooped("stef12.mid");



(though I'd personally use a class to handle stuff such as whether the player has chosen an option to disable music or prefers an MP3 to be played instead where applicable)
Reply With Quote
  #7  
Old 01-20-2011, 07:27 PM
Liberated Liberated is offline
not doing alot
Liberated's Avatar
Join Date: Feb 2008
Posts: 1,366
Liberated has a spectacular aura about
I knew you were messing with him, xD
__________________
Quote:
Originally Posted by Tigairius View Post
I promise when I get rich I'll send you an iPhone. I'll send everyone an iPhone.
Reply With Quote
  #8  
Old 01-20-2011, 07:29 PM
Fulg0reSama Fulg0reSama is offline
Extrinsical Anomaly
Fulg0reSama's Avatar
Join Date: Sep 2009
Location: Ohio
Posts: 3,049
Fulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant future
Quote:
Originally Posted by ffcmike View Post
What's wrong with:

PHP Code:
//#CLIENTSIDE
function onPlayerEnters(){
  
playlooped("stef12.mid");



(though I'd personally use a class to handle stuff such as whether the player has chosen an option to disable music or prefers an MP3 to be played instead where applicable)
nodda thing and better than what I said

I'd prefer a tokenized serverflag for optimization of music.
__________________

Careful, thoughts and opinions here scare people.
Reply With Quote
  #9  
Old 01-20-2011, 09:58 PM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by Fulg0reSama View Post
Big issue of GS1 and GS2 mixup
Now if you want everyone to hear it a simple way to do this is by a class(not the best but its simple) (I try to give simple answers not most efficient. Someone feel free to correct me)

Put this in a level.
PHP Code:
function onPlayerEnters()
{
join "classname";

This is incorrect. The proper way to do it is:

PHP Code:
function onCreated() {
  
this.join("classname");

The way you were using join was a weird mixture of GS1 and GS2 that probably wouldn't have worked in either language, and there's no reason to join it in the onPlayerEnters function.

Quote:
PHP Code:
//#CLIENTSIDE
function onCreated()
{
  
setTimer(0.01);
  
onTimeOut();
}
function 
onTimeOut()
{
  
play ("stef12.mid");
  
setTimer(0.01);

There is no excuse for using a timeout here. Also, don't put spaces before functions like you did with play.

Quote:
Originally Posted by Liberated View Post
or you just make it serverside instead of clientside?
play and playlooped are clientside functions.

Quote:
Originally Posted by ffcmike View Post
What's wrong with:

PHP Code:
//#CLIENTSIDE
function onPlayerEnters(){
  
playlooped("stef12.mid");

This is the proper way to do it.
__________________
Reply With Quote
  #10  
Old 01-21-2011, 02:30 AM
MrOmega MrOmega is offline
One More Time
MrOmega's Avatar
Join Date: Aug 2010
Location: TN, USA
Posts: 631
MrOmega is an unknown quantity at this point
Send a message via AIM to MrOmega Send a message via MSN to MrOmega Send a message via Yahoo to MrOmega
Also, remember not all (if any?) mac and linux users can hear midi files.
__________________
Time is the fire in which we burn...
Up, Up, Down, Down, Left, Right, Left, Right, B, A, Select, Start! Now I got 99 LIVES!!!
Reply With Quote
  #11  
Old 01-29-2011, 06:05 PM
Diablo1 Diablo1 is offline
Registered User
Join Date: Jan 2011
Posts: 5
Diablo1 is on a distinguished road
mhm thx fro correting my scipt but i don't get it when you talk about the 'class'. should i put

function onCreated() {
this.join("classname");
}
in the level or in the 'class' folder in the rc?
Reply With Quote
  #12  
Old 01-29-2011, 06:20 PM
callimuc callimuc is offline
callimuc's Avatar
Join Date: Nov 2010
Location: Germany
Posts: 1,015
callimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to behold
The
PHP Code:
function onCreated() {
this.join("classname");

You put into a level.
The other part is the class which you have to put into the Script Editor.
Reply With Quote
  #13  
Old 01-29-2011, 06:21 PM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by Diablo1 View Post
mhm thx fro correting my scipt but i don't get it when you talk about the 'class'. should i put

function onCreated() {
this.join("classname");
}
in the level or in the 'class' folder in the rc?
Just use this:

PHP Code:
//#CLIENTSIDE 
function onPlayerEnters(){ 
  
playlooped("stef12.mid"); 

__________________
Reply With Quote
  #14  
Old 01-29-2011, 10:26 PM
Diablo1 Diablo1 is offline
Registered User
Join Date: Jan 2011
Posts: 5
Diablo1 is on a distinguished road
thx cbk1994 you were right and for all the others you don't need to create a class.
PHP Code:
//#CLIENTSIDE
function onPlayerEnters(){
playlooped("stef12.mid");
}

is the easier way to have it. but if it doesnt work just go on folderconfig then allow the server to read .mid and .mp3 files
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 02:34 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.