Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #14  
Old 02-16-2008, 12:19 AM
pokeSMOT pokeSMOT is offline
Registered User
Join Date: Jun 2006
Posts: 35
pokeSMOT is on a distinguished road
Newbie Scripter seeks line-by-line breakdown

//#CLIENTSIDE
function onCreated()
Why onCreated() and not just Created()? What does "on" do?
setTimer(0.1);
What is the timer used for? and if it's declared within a function, why not just call the function for later use?
function onTimeout() {
What is the difference between "setTimer" and "onTimeout"?
// or whatever to detect if it's not held down
if (!keydown(5)) this.canhit = true;
Does this mean if whatever key '5' represents, pressing the opposite will activate "this.canhit = true;"? And what does that part mean?
setTimer(0.1);
Couldn't the whole function be called?
}
function onKeyPressed(code, key) {
Are "code" and "key" some sort of preset parameters or something? What do those mean? Cause I don't see them defined anywhere..
switch (lowercase(key)) {
Is capslock relevant here, or is this for something else?
case "s":
I remember case's from C++, but the next part is what troubles me..
if (this.canhit) {
Is this still asking if while it is true?
player.chat = "s";
So if "this.canhit" was set to true, then it makes the player say "s"? But then how is this.canhit even determinded? By pressing any key other than '5'?
this.canhit = false;
And I'm guessing that absolutely nothing happens if this.canhit is false, cause there's nothing after it except closing brackets
}
break;
And this simply halts the script? no?
}
}

Sorry to whomever takes the time out to read through and answer this post, but I'm really trying to learn this stuff. I find gs2 quite fascinating.
Reply With Quote
 


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 03:12 PM.


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