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-09-2008, 12: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
Quote:
Originally Posted by Tigairius View Post
Some functions on GK don't even work properly unless you use with()
GK's functions.
__________________
Reply With Quote
  #2  
Old 08-09-2008, 12:31 AM
xXziroXx xXziroXx is offline
Malorian
xXziroXx's Avatar
Join Date: May 2004
Posts: 5,289
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
Quote:
Originally Posted by Tigairius View Post
it depends how many values I'm editing at once.
Agreed.
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
  #3  
Old 08-09-2008, 12:23 AM
Inverness Inverness is offline
Incubator
Inverness's Avatar
Join Date: Aug 2004
Location: Houston, Texas
Posts: 3,613
Inverness is a jewel in the roughInverness is a jewel in the rough
Using with() on serverside is how you change the calling player.
__________________
Reply With Quote
  #4  
Old 08-09-2008, 12:48 AM
Admins Admins is offline
Graal Administration
Join Date: Jan 2000
Location: Admins
Posts: 11,693
Admins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud of
It can reduce problems with typing errors (typing the same object name over and over again), it can also make scripts look easier to understand. If you need to write very efficient code then it should probably be avoided (e.g. loops inside with() are not optimized), but that should not happen often.
Making scripts look easier to understand is often more important than you think, because code often needs to be understood by other scripters to be able to fix or improve stuff (or by yourself in the future).
Reply With Quote
  #5  
Old 08-10-2008, 12:18 PM
Cloven Cloven is offline
Delteria
Cloven's Avatar
Join Date: Dec 2006
Location: Florida, United States
Posts: 542
Cloven has a spectacular aura about
Send a message via AIM to Cloven
Quote:
Originally Posted by Stefan View Post
It can reduce problems with typing errors (typing the same object name over and over again), it can also make scripts look easier to understand. If you need to write very efficient code then it should probably be avoided (e.g. loops inside with() are not optimized), but that should not happen often.
Making scripts look easier to understand is often more important than you think, because code often needs to be understood by other scripters to be able to fix or improve stuff (or by yourself in the future).
In my opinion, the first (and possibly best thing) people can do in general is use practical, logical names for their variables and/or functions as they apply to the npc they're being used in. This makes it 10x easier on any future scripter who may have to edit/debug your work if they can relate easily to the code in front of them.
Reply With Quote
  #6  
Old 08-10-2008, 10:55 PM
zokemon zokemon is offline
That one guy...
zokemon's Avatar
Join Date: Mar 2001
Location: Sonoma County, California
Posts: 2,925
zokemon is a jewel in the roughzokemon is a jewel in the rough
Send a message via ICQ to zokemon Send a message via AIM to zokemon Send a message via MSN to zokemon Send a message via Yahoo to zokemon
I use with when creating objects (like GUIs) to make it match with the new blocks.

Quote:
Originally Posted by Kristi View Post
Preference or not, it is what is generally taught as standard coding practices in computer science.
Not a single CIS class I've taken has taught such a practice, though it does make sense.
__________________
Do it with a DON!
Reply With Quote
  #7  
Old 08-11-2008, 07:23 AM
Kristi Kristi is offline
Bowie's Deciple
Kristi's Avatar
Join Date: Dec 2003
Location: Boston, MA
Posts: 748
Kristi has a spectacular aura aboutKristi has a spectacular aura about
Send a message via AIM to Kristi Send a message via MSN to Kristi
Quote:
Originally Posted by zokemon View Post
i use with when creating objects (like guis) to make it match with the new blocks.



Not a single cis class i've taken has taught such a practice, though it does make sense.
cis <> cs
__________________
Reply With Quote
  #8  
Old 08-11-2008, 02:00 PM
Loriel Loriel is offline
Somewhat rusty
Loriel's Avatar
Join Date: Mar 2001
Posts: 5,059
Loriel is a name known to allLoriel is a name known to allLoriel is a name known to allLoriel is a name known to all
Quote:
Originally Posted by Kristi View Post
cis <> cs
I am watching CSI: Miami every week and have yet to see them line up any equal signs.
Reply With Quote
  #9  
Old 08-11-2008, 02:59 PM
Inverness Inverness is offline
Incubator
Inverness's Avatar
Join Date: Aug 2004
Location: Houston, Texas
Posts: 3,613
Inverness is a jewel in the roughInverness is a jewel in the rough
Quote:
Originally Posted by Loriel View Post
I am watching CSI: Miami every week and have yet to see them line up any equal signs.
I tried to find the humor in that but I just couldn't do it.
__________________
Reply With Quote
  #10  
Old 08-11-2008, 03:03 PM
Loriel Loriel is offline
Somewhat rusty
Loriel's Avatar
Join Date: Mar 2001
Posts: 5,059
Loriel is a name known to allLoriel is a name known to allLoriel is a name known to allLoriel is a name known to all
Quote:
Originally Posted by Inverness View Post
I tried to find the humor in that but I just couldn't do it.
I tried to find the humor in your mom but I just could not do that either
Reply With Quote
  #11  
Old 08-11-2008, 05:36 PM
zokemon zokemon is offline
That one guy...
zokemon's Avatar
Join Date: Mar 2001
Location: Sonoma County, California
Posts: 2,925
zokemon is a jewel in the roughzokemon is a jewel in the rough
Send a message via ICQ to zokemon Send a message via AIM to zokemon Send a message via MSN to zokemon Send a message via Yahoo to zokemon
Quote:
Originally Posted by Kristi View Post
cis <> cs
CIS = Computer Information Sciences

It just means the department also include more then just programming classes. I was however, referring to the programming classes that I've taken.
__________________
Do it with a DON!
Reply With Quote
  #12  
Old 08-11-2008, 05:41 PM
Kristi Kristi is offline
Bowie's Deciple
Kristi's Avatar
Join Date: Dec 2003
Location: Boston, MA
Posts: 748
Kristi has a spectacular aura aboutKristi has a spectacular aura about
Send a message via AIM to Kristi Send a message via MSN to Kristi
Quote:
Originally Posted by zokemon View Post
CIS = Computer Information Sciences

It just means the department also include more then just programming classes. I was however, referring to the programming classes that I've taken.
CIS = Computer Information Systems....
__________________
Reply With Quote
  #13  
Old 08-11-2008, 08:25 PM
Crow Crow is offline
ǝɔɐɹq ʎןɹnɔ
Crow's Avatar
Join Date: Dec 2006
Location: Germany
Posts: 5,153
Crow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond repute
Quote:
Originally Posted by Kristi View Post
CIS = Computer Information Systems....
CIS = Cancer Information Service!
Reply With Quote
  #14  
Old 08-12-2008, 05:34 AM
zokemon zokemon is offline
That one guy...
zokemon's Avatar
Join Date: Mar 2001
Location: Sonoma County, California
Posts: 2,925
zokemon is a jewel in the roughzokemon is a jewel in the rough
Send a message via ICQ to zokemon Send a message via AIM to zokemon Send a message via MSN to zokemon Send a message via Yahoo to zokemon
Quote:
Originally Posted by Kristi View Post
CIS = Computer Information Systems....
You go to a different school.
__________________
Do it with a DON!
Reply With Quote
  #15  
Old 08-11-2008, 08:40 AM
Mark Sir Link Mark Sir Link is offline
Kevin Azite
Mark Sir Link's Avatar
Join Date: Sep 2005
Posts: 1,489
Mark Sir Link is just really niceMark Sir Link is just really nice
Send a message via AIM to Mark Sir Link
I've yet to be taught to line up equal signs after Computer Science, AP Computer Science AB, and Computer Systems, but perhaps year 4 will be my lucky year!
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 12:39 AM.


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