Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting > Code Gallery
FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Search this Thread Display Modes
  #16  
Old 08-11-2010, 12:08 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 xXziroXx View Post
No, but it sure as hell can help them along the way, which is why we post stuff here to begin with or at least it should be.
The thing is, most people don't know how things work, they just want to know how to use it. And that won't help. Not at all.
__________________
Reply With Quote
  #17  
Old 08-11-2010, 04:22 PM
DrakilorP2P DrakilorP2P is offline
Registered User
DrakilorP2P's Avatar
Join Date: Apr 2006
Posts: 755
DrakilorP2P is just really niceDrakilorP2P is just really nice
Quote:
Originally Posted by Crow View Post
The thing is, most people don't know how things work, they just want to know how to use it. And that won't help. Not at all.
Maybe they don't know how to write their own script from scratch, but if they can use it they may at least attempt to read and modify it.
That's the impression I get anway.
Reply With Quote
  #18  
Old 08-11-2010, 04:55 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
Sorry if this wasn't clear. When I talked about the people who just want to know how to use a certain thing, I was specifically talking about the kind which just wants to, well, use it; and no more. And if anything doesn't work like they want it to do, they come onto the forums, crying. You know, the people who don't even want to learn or look at things, the ones who just want everything to work out of the box.
__________________
Reply With Quote
  #19  
Old 08-11-2010, 05:57 PM
Contrast Contrast is offline
Axel
Join Date: Jul 2010
Location: France
Posts: 7
Contrast is on a distinguished road
Quote:
Originally Posted by Crow View Post
Code Gallery snippets are not meant to be used as is. Most require integration into existing systems. What's shown here is a piece of code only including some very basic things. If you don't know exactly what it does, I don't think you should be using it in the first place. No offense.
Quote:
Originally Posted by Crow View Post
Code is useless if you don't understand it, because then you can't integrate it into other things, therefore it's of no use. Playerworlds relying completely on the Code Gallery don't stand a chance, either.
Way to imply how things can be, but always isn't. You're implying that I shouldn't use code from the code gallery if I don't understand it? If I understood it, I could script the code myself. The Code Gallery isn't the place to dump your code for people who understand it, but a place to release code that can help and more. In terms of helping I mean understanding the code, the function of it and maybe how to integrate it into systems.

If I was a new scripter and wanted to integrate this code into my own systems, I wouldn't have any clue on how how to do so. There's no explaination behind the code posted by the OP, like where should it go? The code is also indented, so should it go under an event? A function? The title is also vague compared to the content posted, I would have expected a guide explaining how to add buttons on the taskbar by script, not some snippet from his GP Tool. And aslo about the underlined bold part, if I don't try to use if I didn't understand it fully, I wouldn't learn how to use it at all. Many scripters learn by trial and error.

This isn't post isn't meant to bash the OP, just to inform him that some documentation would be more useful for people learning or wondering how the code is used, code gallery posts including sections like screenshots, how-to-install and description/function is much more constructive and helping.
Reply With Quote
  #20  
Old 08-11-2010, 06:10 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
For those who can't work from the snippet:

PHP Code:
//#CLIENTSIDE
function onCreated() {
  
createButton();
}

function 
createButton() {
  
with(Serverlist_TaskBar) {
    new 
GuiButtonCtrl("Serverlist_TaskButton_HelloWorld") {

      
useownprofile true;

      
// Copy GUI Values from Main Button
      
for (temp.iServerlist_TaskButton_Main.getvarnames()) {
        if (
temp.!= icon) (@ temp.i) = Serverlist_TaskButton_Main.(@ temp.i);
      }

      
500;
      
text "Hello World";

      
// Draw Icon
      
seticonsize(2020);
      
icon.clearall();
      
icon.drawimagestretched(00icon.widthicon.height"login_icon_developer4.png"003232);
      
width += 10;
      
      
// Setup Action Event Catcher
      
thiso.catchevent(this"onAction""onHelloWorldClicked");
    }
  }
}

function 
onHelloWorldClicked() {
  
player.chat "Whatup world!";

__________________
Quote:
Reply With Quote
  #21  
Old 08-11-2010, 06:11 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
I agree partly. The Code Gallery doesn't exist just for the people who can't code, though. The snippets on here can help you save time while coding. Also, you just can't know everything. Especially on Graal, you get to know things by trial and error. Lots of threads on the Code Gallery show you how to do stuff which isn't documented anywhere; this thread is an example.

So, this is a place to dump code for people who understand it. But, at the same time, it's a place to release code to "help and more". There's a clear line between code for beginners and code for experienced coders though. People new to coding shouldn't start off with anything fancy like task bar buttons in the first place. Besides, who wants to use Graal's task bar anyway? I believe that new coding monkeys should not try to learn much by looking at complicated stuff. If they'd learn things one by one, they would probably understand Andrew's snippet after the lessons on GUI controls and catchEvent().
__________________
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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:14 AM.


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