Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Someone give me something to script (https://forums.graalonline.com/forums/showthread.php?t=73305)

PrinceOfKenshin 04-05-2007 08:19 PM

Someone give me something to script
 
Someone give me something to script i don't know what to make right now and i want to sharpen my skills

Chandler 04-05-2007 08:21 PM

A radio.

godofwarares 04-05-2007 09:06 PM

Quote:

Originally Posted by Chandler (Post 1297157)
A radio.

Check that. And make it with volume alteration options :]

PrinceOfKenshin 04-05-2007 09:33 PM

is it possible to adjust the sound?? i used the setmusicvolume command and it just muted it

PrinceOfKenshin 04-05-2007 10:03 PM

NPC Code:

//Made by Xaxen
// Breakdown of Script
//Commands volume 0, volume 1, volume 2, volume 3, Radio Off
//
if (created) {

toweapons Radio;
}
if (weaponfired){
set radio_enabled;

if (radio_enabled)
say2 You can adjust which speaker you
#bwant music to come out of.
#b---------------------------
#bIf you say "volume 0" it will mute
#bthe radio.
#bIf you say "volume 1" the music
#bwill come out of the right speaker
#bIf you say "volume 2" the music
#bwill come out of the left speaker
#bIf you say "volume 3" it will
#bplay normally and Radio off to
#bturn off the radio;
}
if (playersays(Volume 0)){
play yohokiworld.mid;
setmusicvolume 0,0;
}
if (playersays(Volume 1)){
play yohokiworld.mid;
setmusicvolume 1,0;
}
if (playersays(Volume 2)){
play yohokiworld.mid;
setmusicvolume 0,1;
}
if (playersays(Volume 3)){
play yohokiworld.mid;
setmusicvolume 1,2;
}
if (playersays(Radio Off)){
stopsound yohokiworld.mid;
}



-------------------------------------

thats what i got its nothing amazing

Inverness 04-05-2007 10:25 PM

Dude...
#1. you need to learn GScript2
#2. playersays() was deprecated even when I started scripting with GS1
#3. toweapons() is also deprecated with the introduction of the NPC Server.

Offline scripting is a simple waste of time.
PHP Code:

function onCreated() {
  
// do not use toweapons.
  // even if you did use it, it would be under onPlayerTouchsMe()
}
function 
onWeaponFired() {
  
say2("text");
}
function 
onPlayerChats() {
  if (
player.chat == "volume 0") {
    
// stuff
  
}
  else if (
player.chat == "volume 1") {
    
// stuff
  
}


Learning to use tokens would also be a good thing.

PrinceOfKenshin 04-05-2007 10:45 PM

well i want to learn gscript2 but there isn't a server i can go to. I don't have a gold or vip account

Inverness 04-05-2007 10:49 PM

Quote:

Originally Posted by PrinceOfKenshin (Post 1297229)
well i want to learn gscript2 but there isn't a server i can go to. I don't have a gold or vip account

Well I don't know what to say then, you'll need to get a vip at least if you want to be able to work with GS2.
Learning GS1 will just be a waste of effort. It would probably be more beneficial for you to go learn Java or some C++ to get the object-oriented mentality needed for good GS2 scripting.

PrinceOfKenshin 04-05-2007 10:54 PM

yea i just got to look at it for a while because i Know visual basics and im taking Java in the summer. Thanks for the advice

Angel_Light 04-06-2007 06:14 AM

Make script to find the answer to pi. :P How about make an awesome particle engine effect. :D

Twinny 04-06-2007 06:16 AM

Quote:

Originally Posted by Angel_Light (Post 1297348)
Make script to find the answer to pi. :P

PHP Code:

function onCreated()
  echo(
pi); 

^^

DustyPorViva 04-06-2007 06:21 AM

22/7+hugeassnon-obtainablepc

Rapidwolve 04-06-2007 07:08 PM

A script that tells you what to script. o_O

Kristi 04-06-2007 07:57 PM

Script some tigers.

Rapidwolve 04-09-2007 11:03 PM

A complex mudlib :) yay


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

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