Graal Forums  

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

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
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
  #2  
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
  #3  
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
Reply


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 08:39 AM.


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