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
  #61  
Old 05-04-2011, 12:08 AM
iBeatz iBeatz is offline
Kavan
iBeatz's Avatar
Join Date: Dec 2010
Location: Northern Ireland, UK
Posts: 154
iBeatz will become famous soon enough
Send a message via Yahoo to iBeatz
I've been scripting for a while on Graal now, but there are quite a few things that I feel I still do not understand fully, so sign me.

[email protected]
__________________

Intelligence without ambition is like a bird without wings.

Reply With Quote
  #62  
Old 05-04-2011, 12:08 AM
iBeatz iBeatz is offline
Kavan
iBeatz's Avatar
Join Date: Dec 2010
Location: Northern Ireland, UK
Posts: 154
iBeatz will become famous soon enough
Send a message via Yahoo to iBeatz
*sign me up
__________________

Intelligence without ambition is like a bird without wings.

Reply With Quote
  #63  
Old 05-04-2011, 12:25 AM
Devil_Lord2 Devil_Lord2 is offline
David K?
Devil_Lord2's Avatar
Join Date: Apr 2011
Location: PA, MD.
Posts: 643
Devil_Lord2 can only hope to improve
Quote:
Originally Posted by Tricxta View Post
Whats peoples on thoughts as far as readability goes if I did:
NPC Code:
function onCreated()echo "Hello world!";



I think it improves readability as its a smaller area to focus on however some might argue it decreases readability, can someone please clarify this?
I hate that! My first script I decided to work on was learning Dustys hammer and he did things sort of like that.. the missing brackets are the only reason I couldn't understand the parts I wanted to learn were
level.tiles[x,y];
and
updateboard(x,y,L,W);

I went through the script so many times trying to figure out the part of the script that did it only to realize it was two commands..

Then I made a beach. ^.^
But I've asked so many people to help me get what was doing it and no one could tell me..

Quote:
Originally Posted by cbk1994 View Post
GScript is object-oriented, so you want to get away from thinking of it as command-based. To disable the chat bar, you need to act on its GUI object, named ChatBar.

There is a list of server functions here, and a list of client functions here. These are not completely up-to-date, so use scripthelp as well.
Is this better then commands.rtf? / the new GS2 server cammands file that was floating around somewhere on the forum?

Quote:
Originally Posted by Emera View Post
No pressure...
But i agree lol. I am looking forward to this!
i hope to see a lot of people there!
It's already up, you should go to:
http://scriptingschool.forumotion.com/.


Quote:
Originally Posted by IaMnOtAnEwB2_red38 View Post
This seems interesting, a few years ago I was in the middle of learning GS1 and I seemed to catch on quickly, but never gave myself a chance to pick it back up after the GS2 conversion. Count me in.

Email: [email protected]
I know exactly what you mean! It took me 2-3 months ago to start learning GS2 after learning GS1 about five years ago.. after Babylon died 'in my head apparently it carried on for a good amount of time' along with GS1, I gave up on trying to learn too.

Quote:
Originally Posted by fowlplay4 View Post
Sorry but that forum is just dreadful.

Couldn't you just use the Group (Moderated) functionality on these forums, and Thread posts for assignments/challenges?
I agree.. It would be nice to have him as a moderator and our own thing on the forum.. I like the PHP system on here with the nice colors. ;o

Quote:
Originally Posted by papajchris View Post
I was going through a few themes so hopefully you took a look while I was adjusting things. I personally like having it on a different website as all scripting things are in one place. Once a thread dies I plan to adjust the title to what the thread may be about (such as functions) and make it easy to search. I like the ability to make changes, but if it ends up not working we can come here
But I also agree with this... if he does do it on here, there is a chance it could 'die' and a lot of people would not want to post on it because of the so called 'proper etiquette' of this forum. I know I wouldn't want to be yelled at again for posting on a 'dead' thread that interests me and can annoy a whole lot of other people.. I think if he could manage his own subject / thread where we could post subforums inside of it, it could go well on here.

It would get all messy in only one or two threads..

Again, I'd rather post on here.. and greatly like the PHP system on here, but as he said, he'd at least be able to manage it on there. Perhaps this could be worked out?
__________________

Digital Media Artist - David K? </3 (UnLoved)
www.davidkrout.com
www.twitch.com/DavidKkz



Reply With Quote
  #64  
Old 05-04-2011, 02:22 AM
MattKan MattKan is offline
the KattMan
Join Date: Aug 2010
Location: United States
Posts: 1,325
MattKan is a splendid one to beholdMattKan is a splendid one to beholdMattKan is a splendid one to beholdMattKan is a splendid one to beholdMattKan is a splendid one to behold
Send a message via AIM to MattKan
Quote:
Originally Posted by iBeatz View Post
so sign me.
*engraves initials on head*
Reply With Quote
  #65  
Old 05-04-2011, 02:27 AM
oo_jazz_oo oo_jazz_oo is offline
Jazz teh Awesome
oo_jazz_oo's Avatar
Join Date: Jul 2006
Location: California
Posts: 596
oo_jazz_oo is a jewel in the roughoo_jazz_oo is a jewel in the rough
Send a message via MSN to oo_jazz_oo
Quote:
Originally Posted by Devil_Lord2 View Post
I hate that! My first script I decided to work on was learning Dustys hammer and he did things sort of like that.. the missing brackets are the only reason I couldn't understand the parts I wanted to learn were
level.tiles[x,y];
and
updateboard(x,y,L,W);
Actually, having single like script blocks within if() or loops is common.

The problem in this case is he was asking about a function without brackets.

PHP Code:
function onCreated() {
  if (
foo == bar) return true;
}
function 
onPlayerEnters() {
  for (
pl:players)
    
pl.chat "Welcome!";

Both of which are used commonly. At that point, I think its a matter of preference whether you include brackets for 1 line codes.
__________________

Reply With Quote
  #66  
Old 05-04-2011, 02:51 AM
MattKan MattKan is offline
the KattMan
Join Date: Aug 2010
Location: United States
Posts: 1,325
MattKan is a splendid one to beholdMattKan is a splendid one to beholdMattKan is a splendid one to beholdMattKan is a splendid one to beholdMattKan is a splendid one to behold
Send a message via AIM to MattKan
I always script stuff like this...

PHP Code:
//instead of doing this:

function onCreated() {
  
commands
}

//I do this..

function onCreated()
{
  
commands

I've always done it, that's just the way I script, but do you think should get in the habit of doing it the first way?
Reply With Quote
  #67  
Old 05-04-2011, 03:26 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
Hey everyone the ventrilo server just went up! go to scriptingschool.forumotion.com and its flashing on the home page! I'd post it here, but I am not sure if that is against the rules.
__________________
Reply With Quote
  #68  
Old 05-04-2011, 03:31 AM
Tricxta Tricxta is offline
The Muffin Man
Tricxta's Avatar
Join Date: Oct 2010
Location: Australia
Posts: 563
Tricxta is a jewel in the roughTricxta is a jewel in the rough
I think:
PHP Code:
onCreated(){


originated from gs1 which is what I still use

PHP Code:
onCreated()
{


Is kinda from languages like java and C#, I was only introduced to this style when my lecturers showed me this and threatened to take off marks if I didnt do it like that lol. I personally think the second way Is alot cleaner and yer new scripters should practice this style intead
Reply With Quote
  #69  
Old 05-04-2011, 03:45 AM
Devil_Lord2 Devil_Lord2 is offline
David K?
Devil_Lord2's Avatar
Join Date: Apr 2011
Location: PA, MD.
Posts: 643
Devil_Lord2 can only hope to improve
Quote:
Originally Posted by MattKan View Post
I've always done it, that's just the way I script, but do you think should get in the habit of doing it the first way?
Up to you, but I've taken C Programming classes and learned the first way.. D: it may be a slight difference but the second way gives me a headache and confuses me sometimes.. even } else { lines too..

For anyone else who wants to comment along the lines of me not being able to read slight differences in code easily without strain.. I dropped out of Computer Science for Fine Arts. D:

So I no longer have to worry about it..


Quote:
Originally Posted by oo_jazz_oo View Post
Actually, having single like script blocks within if() or loops is common.

The problem in this case is he was asking about a function without brackets..
I now hate the common folk, they are meanies.
I thought Dusty did it like that to confuse new people..

Oh well.. I guess I will have to work around it lol
__________________

Digital Media Artist - David K? </3 (UnLoved)
www.davidkrout.com
www.twitch.com/DavidKkz



Reply With Quote
  #70  
Old 05-04-2011, 05:09 AM
Seich Seich is offline
Noctorious' NeoHunter
Seich's Avatar
Join Date: Jun 2008
Location: Honduras
Posts: 193
Seich will become famous soon enough
Send a message via MSN to Seich Send a message via Yahoo to Seich
Quote:
Originally Posted by Devil_Lord2 View Post
Up to you, but I've taken C Programming classes and learned the first way.. D: it may be a slight difference but the second way gives me a headache and confuses me sometimes.. even } else { lines too..

For anyone else who wants to comment along the lines of me not being able to read slight differences in code easily without strain.. I dropped out of Computer Science for Fine Arts. D:

So I no longer have to worry about it..




I now hate the common folk, they are meanies.
I thought Dusty did it like that to confuse new people..

Oh well.. I guess I will have to work around it lol
The way you style your code is just personal preference. You can use whichever way you feel more comfortable. If you're working with other people it is recommended to be as clean as possible and to following a common styling guideline so that they can easily follow your code and that you can follow theirs.
Reply With Quote
  #71  
Old 05-04-2011, 07:01 AM
oo_jazz_oo oo_jazz_oo is offline
Jazz teh Awesome
oo_jazz_oo's Avatar
Join Date: Jul 2006
Location: California
Posts: 596
oo_jazz_oo is a jewel in the roughoo_jazz_oo is a jewel in the rough
Send a message via MSN to oo_jazz_oo
There are many ways one can style code...some are just uglier (and wrong-er :3).

Such as putting brackets on their own lines. I used to do this, but I think it was GK who actually taught me not to. o_o
Putting brackets on their own lines increases line size, which isn't really a bad thing, its just unnecessary; but not necessarily wrong.

The only thing that irks me, is when people dont indent properly. >:[
PHP Code:
function onCreated() {
  
zomg();
  } 
Drives me crazy. Put the bracket on the indentation as the function declaration!
Because, if you do that all the time, you end up with very ugly scripts, especially if its not consistent.

PHP Code:
function onCreated() {
  
with (findplayer("Stefan")) {
    if (
player.hearts 3) {
    
player.chat "Hooray!";
      }
}
  } 
WTF is that. What. Is. That.
__________________

Reply With Quote
  #72  
Old 05-04-2011, 08:32 AM
Clockwork Clockwork is offline
ᶘ ᵒᴥᵒᶅ...ᶘ ಠᴥಠᶅ❤...ℳℴℯ
Clockwork's Avatar
Join Date: Feb 2007
Location: Pennsylvania
Posts: 2,071
Clockwork has a brilliant futureClockwork has a brilliant futureClockwork has a brilliant futureClockwork has a brilliant futureClockwork has a brilliant futureClockwork has a brilliant futureClockwork has a brilliant futureClockwork has a brilliant future
I'd love to try this out

Sign meh up.
__________________
Reply With Quote
  #73  
Old 05-04-2011, 10:36 AM
Devil_Lord2 Devil_Lord2 is offline
David K?
Devil_Lord2's Avatar
Join Date: Apr 2011
Location: PA, MD.
Posts: 643
Devil_Lord2 can only hope to improve
Quote:
Originally Posted by papajchris View Post
Please take a minute to check out http://scriptingschool.forumotion.com/.

I put up a mini practice script (pretty simple) Under Assignments/Week One. You can see the instructions on top and then see posts below. Feel free to comment on people's scripts (I put a simple script up to show you). If you need help, go to the help section.
Sign up here. :]
__________________

Digital Media Artist - David K? </3 (UnLoved)
www.davidkrout.com
www.twitch.com/DavidKkz



Reply With Quote
  #74  
Old 05-04-2011, 11:38 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
Quote:
Originally Posted by oo_jazz_oo View Post
Actually, having single like script blocks within if() or loops is common.

The problem in this case is he was asking about a function without brackets.

PHP Code:
function onCreated() {
  if (
foo == bar) return true;
}
function 
onPlayerEnters() {
  for (
pl:players)
    
pl.chat "Welcome!";

Both of which are used commonly. At that point, I think its a matter of preference whether you include brackets for 1 line codes.
Please don't teach people to exclude braces for one-line statements . It's a hard habit to break, and it just makes it a pain when you try to change code later.
__________________
Reply With Quote
  #75  
Old 05-04-2011, 04:50 PM
Chompy Chompy is offline
¯\(º_o)/¯
Chompy's Avatar
Join Date: Sep 2006
Location: Norway
Posts: 2,815
Chompy is just really niceChompy is just really niceChompy is just really nice
Send a message via MSN to Chompy
For those of you who needs access to the Testbed Server, read this:

http://forums.graalonline.com/forums...21#post1647521


By providing everything I need to get your access up and running, that will be better for both. 60-70% people who ask me for access doesn't provide me with (enough) information I need to set up access Read the thread and you will!
__________________
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 07:03 PM.


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