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
  #76  
Old 05-04-2011, 07:35 PM
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
Hey Chompy, on the Graal news / F1 page it says:

"If you wish to participate, simply click here to fill out the submission form. (Be sure to include your email for contact information.) "


And when I click the link, it takes me to a

"Page not found

The page you request is not available on GraalOnline. We take in note to try to correct the problem. Please, back to home page

(Click here if your browser does not automatically forward you)
"

Page.


I don't know if it was linked bad, or not created yet, but I thought you should know..


Also, my friend ZeroG that I asked could get on Testbed a while ago, I forgot his gold ran out.. he can still do everything on the server he owns, so I guess he will work on his stuff there lol..

I just wanted him to come on Testbed since I can only work on Testbed with a classic account.. it gets lonely lmao. So, he doesn't need the access anymore, no longer a gold subscriber. D: I still appreciate it though. ^.^
__________________

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



Reply With Quote
  #77  
Old 05-04-2011, 07:55 PM
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
--Update ---
Sent in all the accounts who needed Access on testbed WHO filled out a form. If you replied in this thread I did NOT send your account. Please forum PM Chompy or Clockwork
__________________
Reply With Quote
  #78  
Old 05-04-2011, 08:04 PM
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
Aeko/Clockwork needs money for the Testbed server.

Quote:
Originally Posted by Clockwork View Post
FYI: Testbed has 26 days before it has to be paid for again... and at 72$ it's not exactly cheap for someone w/o a job :P

Last time I got a little less than half, it'd be nice for the same to happen (tho only 2 people donated =.= )

Donate here
Considering the amount of support for this group, you guys should have an easy time helping him out in the process.
__________________
Quote:
Reply With Quote
  #79  
Old 05-04-2011, 08:41 PM
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 fowlplay4 View Post
Aeko/Clockwork needs money for the Testbed server.

Noooooo :'[

Quote:
Originally Posted by fowlplay4 View Post
Considering the amount of support for this group, you guys should have an easy time helping him out in the process.
I hope so.. D:
I like the testbed server seeing it is the only server I am aloud to actually work on being classic..

I'd help out if I could, I'm not financially stable either.
__________________

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



Reply With Quote
  #80  
Old 05-05-2011, 12:48 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 cbk1994 View Post
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.
I dont see a huge problem in using one line codes without brackets for certain instances.
PHP Code:
function check(xy) {
  if (
== y) return true;

Like in that instance. Does it really make it any more readable...any more efficient...any more anything by adding the brackets?
__________________

Reply With Quote
  #81  
Old 05-05-2011, 12:54 AM
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
Quote:
Originally Posted by Devil_Lord2 View Post
Hey Chompy, on the Graal news / F1 page it says:

"If you wish to participate, simply click here to fill out the submission form. (Be sure to include your email for contact information.) "


And when I click the link, it takes me to a

"Page not found

The page you request is not available on GraalOnline. We take in note to try to correct the problem. Please, back to home page

(Click here if your browser does not automatically forward you)
"

Page.


I don't know if it was linked bad, or not created yet, but I thought you should know..

I have nothing to do with that form

I add people who pm me here on the forums pretty fast, all depending on if I'm sleeping or not
__________________
Reply With Quote
  #82  
Old 05-05-2011, 01:24 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
I dont see a huge problem in using one line codes without brackets for certain instances.
PHP Code:
function check(xy) {
  if (
== y) return true;

Like in that instance. Does it really make it any more readable...any more efficient...any more anything by adding the brackets?
Yes, it makes it more readable, and it makes it easier to expand upon, especially if some parts of the code aren't properly indented. There are tons of arguments for this on stackoverflow and other programming sites—check them out.
__________________
Reply With Quote
  #83  
Old 05-05-2011, 01:26 AM
salesman salesman is offline
Finger lickin' good.
salesman's Avatar
Join Date: Nov 2008
Location: Colorado
Posts: 1,865
salesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud of
Quote:
Originally Posted by oo_jazz_oo View Post
I dont see a huge problem in using one line codes without brackets for certain instances.
PHP Code:
function check(xy) {
  if (
== y) return true;

Like in that instance. Does it really make it any more readable...any more efficient...any more anything by adding the brackets?
Bad example because if you're going to take shortcuts, take the best shortcut.

PHP Code:
function check(xy) {
  return 
temp.== temp.y;

In general, I try to always include brackets for one-line statements. Consistency not only improves readability (imo), but it makes your code a lot less error-prone.

If you start saying "oh, well in this instance is it really a problem?" your styling is probably very confusing and inconsistent, and you're much more likely to **** up.
__________________
Reply With Quote
  #84  
Old 05-05-2011, 01:31 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 oo_jazz_oo View Post
I dont see a huge problem in using one line codes without brackets for certain instances.
PHP Code:
function check(xy) {
  if (
== y) return true;

Like in that instance. Does it really make it any more readable...any more efficient...any more anything by adding the brackets?
On first site I would say it was a mistake, and fix it to have brackets..
I agree not to teach like this, but if you are the only one ever going to touch your scripts.. I suppose it doesn't matter if it works for you.. lol

But if someone in the future may have to go over it.. Again it could confuse them... I'm not totally experienced in programming, so I don't know, others may be able to pick it up what it means faster.. Even if I did pick it up, I'd take the time to fix it towards a common style for others and myself in case I look at it again in the future.




Quote:
Originally Posted by salesman View Post
PHP Code:
function check(xy) {
  return 
temp.== temp.y;

This would return true if true? and if it isn't the same, it would still return false?


I'm only wondering because I would do:
this.variable = 0;
if (this.variable == 1){
dostuff();
}

I use 0 and 1.. and later on if I need to I can increase it if I want it to be 2, 3, or 4.. but even if it stays on and off, true or false, I still use 0 and 1.. should I start doing true and false for those special things that only use true or false?
__________________

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



Reply With Quote
  #85  
Old 05-05-2011, 01:36 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
This is a good example of why it's bad:

PHP Code:
function whatever()
  for (
aallplayers)
    
with (a)
      if (
player.account == "wat")
       do(
player); 
If you want to obscure your code and make it much harder for others to maintain then carry on with bad practices such as that.
__________________
Quote:
Reply With Quote
  #86  
Old 05-05-2011, 01:37 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 Devil_Lord2 View Post
On first site I would say it was a mistake, and fix it to have brackets..
I agree not to teach like this, but if you are the only one ever going to touch your scripts.. I suppose it doesn't matter if it works for you.. lol

But if someone in the future may have to go over it.. Again it could confuse them... I'm not totally experienced in programming, so I don't know, others may be able to pick it up what it means faster.. Even if I did pick it up, I'd take the time to fix it towards a common style for others and myself in case I look at it again in the future.
It is good practice to always format well, even if you're the only person who is going to see it. You will generally make less mistakes.


Quote:
This would return true if true? and if it isn't the same, it would still return false?
It will return the result of the statement.

PHP Code:
echo(== 1); // echoes true
echo(== 0); // echoes false
echo("a" == "a"); // echoes true
echo((2) == 7); // echoes true 
__________________
Reply With Quote
  #87  
Old 05-05-2011, 01:56 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 cbk1994 View Post
It is good practice to always format well, even if you're the only person who is going to see it. You will generally make less mistakes.
I only meant if 'he' wanted to do it, and no one else would see it, he can go ahead.. Not saying everyone in general should do it lol.. I took the time in changing Stefans 2001 baddy script styling it correctly. D:

If I didn't I don't think I'd ever have figured out what it was doing..
But I agree.. It is kind of like doing a turn single at a turn or stop sign even if there is no one else there to see.. Still a good habit to keep/practice..



Quote:
Originally Posted by cbk1994 View Post
It will return the result of the statement.

PHP Code:
echo(== 1); // echoes true
echo(== 0); // echoes false
echo("a" == "a"); // echoes true
echo((2) == 7); // echoes true 
Oh I see.. So would this be a good thing inside a class / function for ... w/e the function might do.. assuming the point is to be true or false... Also, can you return more then one thing, for instance maybe X and Y? or would you have to return X and Y in an array with X and Y in it?

I usually do this. variables so they work through the whole script D: and have not made any real functions that needed to be in classes and used everywhere, but I would like to make a bush system.. and other things..

One more thing... xD returns do not return temp. variables? I've had a problem with this and had to make the temp. a this. to pass it back x.x;
__________________

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



Reply With Quote
  #88  
Old 05-05-2011, 02:05 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 Devil_Lord2 View Post
Oh I see.. So would this be a good thing inside a class / function for ... w/e the function might do.. assuming the point is to be true or false...
Not sure what you're asking.

Quote:
Also, can you return more then one thing, for instance maybe X and Y? or would you have to return X and Y in an array with X and Y in it?
You can only return one value. Use arrays for returning multiple.

Quote:
One more thing... xD returns do not return temp. variables? I've had a problem with this and had to make the temp. a this. to pass it back x.x;
Functions return values, not variables. You can assign them to whatever variable you want to.
__________________
Reply With Quote
  #89  
Old 05-06-2011, 08:21 AM
reyalS reyalS is offline
Freelancer
reyalS's Avatar
Join Date: Jan 2011
Location: New Orleans
Posts: 11
reyalS will become famous soon enough
I see all these one line codes above me and I have no clue what they mean... SIGN ME UP!
__________________
~reyalS
Reply With Quote
  #90  
Old 05-06-2011, 09:29 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 cbk1994 View Post
Not sure what you're asking.
For instance, I guess function onPlayerGrabs(){ }
could be made a class that could return true and make the if statement work..

if (onPlayerGrabs()){} "I think could work assuming it is joined to the class"
could return true or false.. I don't know how it works really...

Quote:
Originally Posted by cbk1994 View Post
You can only return one value. Use arrays for returning multiple.
Oh I see.. thanks ^.^;
In the future could they do it with commas to add more, or is there no point?


Quote:
Originally Posted by cbk1994 View Post
Functions return values, not variables. You can assign them to whatever variable you want to.
I've had a function go through all players, and didn't accept externals.
I had it as:
variable
temp.count = 0;

a lot of script...

return temp.count
and
return count

which kept becoming 0 or null... in the end I set it to this.count = temp.count and it finally worked with:

return this.count

I couldn't get it to pass the temp. variable D:
__________________

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



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 09:18 AM.


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