Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   JKL's Scripting Questions (https://forums.graalonline.com/forums/showthread.php?t=134258195)

xAndrewx 03-05-2010 10:43 PM

Quote:

Originally Posted by jkldogg (Post 1560718)
Where exactly does that go? Would you mind copying the script and placing it in there and posting it for me?

Look in your script for
HTML Code:

  new GuiWindowCtrl(this.gName @ "Window0") {
and put it in there

jkldogg 03-12-2010 10:50 PM

!
 
I figured it out, with the help of a nice guy named PowerPronL :)

PHP Code:

//#CLIENTSIDE
function onCreated() {
  
message Grab Me!;
}
function 
onActionGrab() {
  
openUrl("http://www.google.com");



fowlplay4 03-12-2010 10:57 PM

You're mixing GS1 and GS2 there.

message Grab me!; in GS2 is basically

this.chat = "Grab me!"; OR

message("Grab me!");

jkldogg 03-12-2010 11:13 PM

!?!
 
Quote:

Originally Posted by fowlplay4 (Post 1562096)
You're mixing GS1 and GS2 there.

message Grab me!; in GS2 is basically

this.chat = "Grab me!"; OR

message("Grab me!");

Why does that matter? Yeah, it says error, but it seems to work fine. You grab it and the link opens and the message is always on top of the image.

jkldogg 03-12-2010 11:20 PM

Jukebox (Chris Vimes)
 
SORRY FOR DOUBLE POSTING (this is my one thread for all my questions)

Having a little problem with this jukebox Chris Vimes made a while back. I personally love this script. I like to be able to listen to music in game rather than having Graal and Internet open. So that there's slightly less lag. ^^

Anyways, the probably is when you start to play a song, if someone shoots a gun the song goes off. Help is appreciated, thanks in advance.

Here's the code

PHP Code:

////NO ONE TOUCH THIS, ask jkldogg to add songs
//#CLIENTSIDE
function onCreated() 

  
showJukebox(); 

function 
onKeyPressedcodekey 

  if ( 
key == "r" 
  { 
    
setTimer0.05 ); 
    
Jukebox_Window.visible Jukebox_Window.visible 1
    
GraalControl.makeFirstRespondertrue ); 
  } 

function 
onWeaponFired() 

  
say2"Press 'r' to toggle jukebox!" ); 

function 
showJukebox() 

  
playing this.playing
  
Jukebox_Window.destroy(); 
  new 
GuiWindowCtrl"Jukebox_Window" 
  { 
    
profile "GuiBlueWindowProfile"
    
width 280
    
height 120
    
screenwidth width
    
screenheight height
    
canClose canMinimize true
    
canMaximize canResize false
    
visible false
    
text "Jukebox -"SPC servername
    
useownprofile true
    
profile.transparency .9
    new 
GuiMLTextCtrl"Jukebox_Text" 
    { 
      
profile "GuiBlueTextProfile"
      
10
      
30
      
width 270
      
height 20
      
useownprofile true
      
profile.align "center"
      
text "<center>Now playing:" SPC playing
    } 
    new 
GuiPopUpMenuCtrl"Jukebox_List" 
    { 
      
profile "GuiBluePopUpMenuProfile"
      
width 260
      
height 20
      
10
      
50
      
textprofile "GuiBlueTextListProfile"
      
scrollprofile "GuiBlueScrollProfile"
      
clearRows(); 
      
temp.music = { 
      { 
"Young Jeezy - My President Is Black""http://dump.ninjapirat.org/files/18%20My%20President.mp3" },
      { 
"Eminem - Stay Wide Awake""http://www.downloads.nl/cgi-bin/mp3get.cgi?u=http%3A%2F%2Fbetruger.wrzuta.pl%2Fsr%2Ff%2F4dEUI3jrj34%2Feminem_-_stay_wide_awake.mp3&n=3" }, 
      { 
"Lil Wayne & Gucci Mane - We Be Steady Mobbin ""http://yoraps.com/music/lil_wayne-mobbin.mp3" }, 
      { 
"Gucci Mane - Lemonade""http://www.downloads.nl/cgi-bin/mp3get.cgi?u=http%3A%2F%2Fwww.djbobbytrends.com%2Fblog%2Fwp-content%2Fuploads%2F2009%2F11%2F03-Lemonade.mp3&n=2" }, 
      { 
"Iyaz - Replay""http://www.downloads.nl/cgi-bin/mp3get.cgi?u=http%3A%2F%2Fdoris9403.wrzuta.pl%2Fsr%2Ff%2F1IdqekCNy32%2Fiyaz_-_replay.mp3&n=10" }, 
      { 
"Eminem - The Way I Am ""http://cd04.static.jango.com/music/03/40/87/0340874277.mp3" }, 
      { 
"Eminem - When I'm Gone ""http://www.downloads.nl/cgi-bin/mp3get.cgi?u=http%3A%2F%2Fwww.myotherdrive.com%2Ffile%2F850.472605.02022008.03344.0067fi%2FEminem%2520-%2520When%2520Im%2520Gone%2520(dirty).mp3&n=5" },
      { 
"Eminem - Must Be The Ganja""http://www.downloads.nl/cgi-bin/mp3get.cgi?u=http%3A%2F%2Fkrwawy80.wrzuta.pl%2Fsr%2Ff%2F3QdmGxuaqDV%2Feminem_-_must_be_the_ganja_produced_by_dr._dre_and_mark_batson.mp3&n=7" },
      { 
"Eminem - Medicine Ball ""http://www.downloads.nl/cgi-bin/mp3get.cgi?u=http%3A%2F%2Fkrwawy80.wrzuta.pl%2Fsr%2Ff%2F20r1DvaoDFV%2Feminem_-_medicine_ball_produced_by_dr._dre_and_mark_batson.mp3&n=1" },
      { 
"Gucci Mane - Stupid Wild""http://www.downloads.nl/cgi-bin/mp3get.cgi?u=http%3A%2F%2Fwww.hilkoo.com%2Fwp-content%2Fuploads%2F2009%2F11%2FGucci-Mane-Ft-Lil-Wayne-Camron-Stupid-Wild-www.hilkoo.com.mp3&n=4" },
      { 
"Gucci Mane & Usher - Spotlight""http://c.wrzuta.pl/wa3958/5522c5c9001f5ff94ae34d6e/0/gucci%20mane%20ft.%20usher%20-%20spotlight.mp3?523.187163341582" },
      { 
"insane""http://www.mp3-center.org/download_mp3/Eminem/Insane/8109489" },
      { 
"song""http://www.yoraps.com/audios1.php?subaction=showfull&id=1267696186&archive=&start_from=&ucat=13&" },
      { 
"song""http://www.jamglue.com/tracks/9611377/popout" },
      { 
"Rihanna - Hard (Featuring Young Jeezy)""http://c.wrzuta.pl/wa3247/227e7f5b00031adb4b0ea70a/0/rihanna%20-%20hard%20%28featuring%20jeezy%29.mp3?743.254980545283" },
      { 
"Plies (Featuring Neyo) - Bust It Baby Remix""http://c.wrzuta.pl/wa793/13199862002be4fc484b789c/0/plies%20ft%20neyo-bust%20it%20baby%20remix.mp3?996.453801590508" },
      { 
"song""url!" },
      { 
"song""url!" },
      { 
"song""url!" },
      { 
"song""url!" },
      { 
"song""url!" },
      { 
"song""url!" },
      { 
"song""url!" },
      { 
"song""url!" },
      { 
"song""url!" },
      { 
"Eminem - Stan""http://images.mmosite.com/bbs/upload/temp/Stan.mp3" }};       
      for ( 
temp.0temp.temp.music.size(); temp.++ ) 
      { 
        
withaddRow0temp.music[temp.i][0] ) ) 
        { 
          
this.var = temp.music[temp.i][1]; 
        } 
      } 
      
setSelectedRow); 
      
sort(); 
    } 
    new 
GuiButtonCtrl"Jukebox_Stop" 
    { 
      
profile "GuiBlueButtonProfile"
      
width 75
      
height 30
      
Jukebox_Window.width - ( width ); 
      
Jukebox_Window.height 40
      
text "Stop Music"
    } 
  } 
  
stopmidi(); 
  
this.playing "[None]"
  
Jukebox_Text "Now playing: [None]"

function 
onTimeOut() 

  
this.time += .05;; 
  
setTimer0.05 ); 

function 
Jukebox_Stop.onAction() 

  
stopmidi(); 
  
this.playing "[None]"
  
Jukebox_Text "Now playing: [None]"

function 
Jukebox_List.onSelect() 

  if ( 
this.time 
  { 
  
this.playing params[1]; 
  
Jukebox_Text.text "Now playing:" SPC params[1]; 
  
playJukebox_List.rows[params[2]].var ); 
  } 

function 
onPlaytitlesong 

  
this.playing title
  
Jukebox_Text.text "Now playing:" SPC title
  
playsong ); 



Mark Sir Link 03-12-2010 11:31 PM

Quote:

Originally Posted by jkldogg (Post 1562101)
SORRY FOR DOUBLE POSTING (this is my one thread for all my questions)

Having a little problem with this jukebox Chris Vimes made a while back. I personally love this script. I like to be able to listen to music in game rather than having Graal and Internet open. So that there's slightly less lag. ^^

Anyways, the probably is when you start to play a song, if someone shoots a gun the song goes off. Help is appreciated, thanks in advance.

Here's the code

when guns are fired, do they call the play() function rather than making the sound through a GANI?

jkldogg 03-12-2010 11:35 PM

Quote:

Originally Posted by Mark Sir Link (Post 1562102)
when guns are fired, do they call the play() function rather than making the sound through a GANI?

My gun sounds are in the actual fire gani, i put the little yellow sound icon thingy :confused:

xAndrewx 03-12-2010 11:41 PM

Go top Options (F1) > Audio > Turn them all down other than radio?

jkldogg 03-12-2010 11:47 PM

Quote:

Originally Posted by xAndrewx (Post 1562108)
Go top Options (F1) > Audio > Turn them all down other than radio?

Same effect, except I couldn't hear the bullet lol...

Any other ideas? This is making me mad !pissed!

xAndrewx 03-12-2010 11:50 PM

ois- Era has them built in to ganis (last time I worked there...), if you open the gani and look right near the bottom you'll see a

HTML Code:

ANI
[WEIRD STUFF HERE]
PLAYSOUND sound.wav
[WEIRD STUFF HERE]

Try deleting that line? =o (PLAYSOUND)

An alternative would be to find an empty sound file and to replace the Era effects... :[

jkldogg 03-13-2010 12:11 AM

no work :(
 
1 Attachment(s)
Quote:

Originally Posted by xAndrewx (Post 1562112)
ois- Era has them built in to ganis (last time I worked there...), if you open the gani and look right near the bottom you'll see a

HTML Code:

ANI
[WEIRD STUFF HERE]
PLAYSOUND sound.wav
[WEIRD STUFF HERE]

Try deleting that line? =o (PLAYSOUND)

An alternative would be to find an empty sound file and to replace the Era effects... :[

hmmm hold on

EDIT: I don't know what you're talking about.

See Attachment

fowlplay4 03-13-2010 01:00 AM

Mixing GS1 and GS2 is just another sign you have no interest in learning how to actually script. The only acceptable case for me personally is the character npcs created by the level editor but everything else is just a no-no.

Also, you have to open the Gani in a text editor.

jkldogg 03-13-2010 01:05 AM

Quote:

Originally Posted by fowlplay4 (Post 1562128)
Mixing GS1 and GS2 is just another sign you have no interest in learning how to actually script. The only acceptable case for me personally is the character npcs created by the level editor but everything else is just a no-no.

Also, you have to open the Gani in a text editor.

What do you mean? I didn't make this script, chris did,; and he realeased it to the Code Gallery. I do want to learn scripting but, I don't have the patience for it.

How do I make the gun not turn off the song?

cbk1994 03-13-2010 01:37 AM

The jukebox isn't the problem, the problem is with your GANIs (or other sounds on the server).

Quote:

Originally Posted by jkldogg (Post 1562099)
Why does that matter? Yeah, it says error, but it seems to work fine. You grab it and the link opens and the message is always on top of the image.

If you really want to become a scripter, you can't settle for what works. You have to go the extra mile and make it correct.

jkldogg 03-13-2010 02:06 AM

helpt?
 
Quote:

Originally Posted by cbk1994 (Post 1562136)
The jukebox isn't the problem, the problem is with your GANIs (or other sounds on the server).



If you really want to become a scripter, you can't settle for what works. You have to go the extra mile and make it correct.

Okay, will you explain to me how to fix it? Or just come on the server and do it? Please and thank you.


All times are GMT +2. The time now is 02:17 PM.

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