Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 08-24-2011, 04:55 AM
papajchris papajchris is offline
Zeus Condero
papajchris's Avatar
Join Date: Jan 2006
Location: Michigan
Posts: 1,600
papajchris is a splendid one to beholdpapajchris is a splendid one to beholdpapajchris is a splendid one to beholdpapajchris is a splendid one to behold
Era's Radio

Not sure if this issue has been known and resolved by someone (Chris, Crow, Salesman, whoever else worked here), but its bugging me that it hasn't been fixed in the years that issue has been occuring. As many of you know, our radio system works fine until a player crosses over level links (on a gmap). The sound cuts out and a player is forced to open and close the radio again. We had someone briefly look over it, and he couldn't find any issues with it. So im just looking for suggestions on why this is occurring and how I can fix it.
__________________
Reply With Quote
  #2  
Old 08-24-2011, 06:02 AM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
A script or class being calling onPlayerEnters which resuilts playlooped() or stopmusic() or stopmidi() being called.

Could possibly relate to ganis as well.
__________________
Quote:
Reply With Quote
  #3  
Old 08-24-2011, 06:25 AM
papajchris papajchris is offline
Zeus Condero
papajchris's Avatar
Join Date: Jan 2006
Location: Michigan
Posts: 1,600
papajchris is a splendid one to beholdpapajchris is a splendid one to beholdpapajchris is a splendid one to beholdpapajchris is a splendid one to behold
Hmm well with the script below the sound goes out about 40 seconds-90 seconds into the song.

This is a test script Chris Vimes used to attempt to try resolve the problem:


PHP Code:
findPlayer("DRAGON551").addWeapon(this.name);
//#CLIENTSIDE
function onCreated() {
  
stopmusic();
  
play("http://GraalEra.com/personal/LoveMyGang.mp3");
}

function 
onPlayerChats() {
  if (
player.chat == "start"this.onCreated();
  
  if (
player.chat "db") {
    
stopmusic();
  }
}

/*
function onTimeOut() {
  for (temp.pl : players) {
    if (pl == player) continue;
    
    pl.x = (- 100);
    pl.y = (- 100);
    pl.setAni("idle", null);
  }
  
  this.setTimer(0.05);
}*/

function onKeyPressed(codekey) {
  if (
key == "f") {
    
temp.0;
    
temp.oldnpc null;
    for (
temp.npc npcs) {
      if (! 
ismusicplaying()) {
        
//oldnpc.x = player.x;
        //oldnpc.y = player.y;
        
player.oldnpc.x;
        
player.oldnpc.y;
        
TheBadNPC oldnpc;
        return 
oldnpc.chat "MEEEEEE";;
      }
      
      
oldnpc=npc;
      
npc.trigger("playerenters"null);
      
msgs.addMessage("/" npcs.size());
      
++;
      
sleep(0.2);
    }
  }

I took out the stopmusic line under the onCreated function and yet the sound still stopped.
__________________
Reply With Quote
  #4  
Old 08-24-2011, 06:43 AM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
What happens when you use playlooped instead of play?

That script identifies what NPC is stopping it from playing. Might benefit from echo'ing the NPCs id, name and joinedclasses if it has any as well.

Can also try this test:

PHP Code:
//#CLIENTSIDE
function onCreated() {
  
music();
  
test();
}

function 
music() {
  
stopmusic();
  
play("http://GraalEra.com/personal/LoveMyGang.mp3");
  
sleep(1);
}

function 
test() {
  for (
temp.wepplayer.weapons) {
    if (
temp.wep != this) {
      
temp.wep.trigger("PlayerEnters""");
      
sleep(0.2);
      if (!
ismusicplaying()) {
        echo(
"music stopped playing after onPlayerEnters was called in " temp.wep.name);
        
music();
      }
    }
  }

__________________
Quote:
Reply With Quote
  #5  
Old 08-24-2011, 07:27 AM
papajchris papajchris is offline
Zeus Condero
papajchris's Avatar
Join Date: Jan 2006
Location: Michigan
Posts: 1,600
papajchris is a splendid one to beholdpapajchris is a splendid one to beholdpapajchris is a splendid one to beholdpapajchris is a splendid one to behold
Playlooped seemed to make no difference.

Using Chris's tool, i can't understand why its choosing one NPC over another.

A window with

PHP Code:
// NPC made by Rachel (Working)
if (created) {
}
if (
playertouchsme) {

was selected.

Then a flower with this was selected

PHP Code:
this.itemnum=5;
join flower-bunch

and then
PHP Code:
//#CLIENSIDE
if (created) {
  
dontblock;
drawoverplayer;} 
And a fourth example:
PHP Code:
//#CLIENTSIDE
function onCreated() {
dontblock();
drawoverplayer();
setimgpart("era_lcgaragedoor4.gif",0,0,80,32);


With your script im getting this error:

Quote:
Script: Function stopmusic not found at line 9 in script of Chris/Why the **** aren't radios working on Era?
Script: Function play not found at line 10 in script of Chris/Why the **** aren't radios working on Era?
(Thank CV for the clever name)

My only scripting experience is from what i learned from trial/error over the years, so sorry if this is fairly easy fix, but i looked over your code and cant seem to understand why the lines would work in CV's script, but not yours.
__________________

Last edited by papajchris; 08-24-2011 at 07:48 AM..
Reply With Quote
  #6  
Old 08-24-2011, 11:20 AM
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
If it's choosing random NPCs, there's probably a GANI stopping the music rather than an NPC calling it in onPlayerEnters. Before I left last time, radios were working flawlessly, so it's a recent addition.

Quote:
Originally Posted by papajchris View Post
With your script im getting this error:
Sounds like you either forgot to copy the //#CLIENTSIDE or there's a space at the end of the line you need to remove.
__________________
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 06:07 PM.


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