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 12-20-2004, 06:03 AM
Slash-P2P Slash-P2P is offline
Banned
Join Date: May 2004
Location: Burning Blade
Posts: 941
Slash-P2P is on a distinguished road
Proposed Q-Menu Tutorial

I made a little tutorial on how to script a custom Q-Menu. This is my first tutorial and I doubt its the best. I tried to be as clear as I could and make it so anyone could understand it. Tell me what you think (constructive criticism please).
Attached Files
File Type: txt tutorial_qmenu.txt (12.3 KB, 604 views)
Reply With Quote
  #2  
Old 12-20-2004, 07:12 AM
Lance Lance is offline
dark overlord
Lance's Avatar
Join Date: Sep 2003
Location: Space Jam Mountain
Posts: 5,072
Lance is on a distinguished road
Quote:
Originally Posted by Slash-P2P
I made a little tutorial on how to script a custom Q-Menu. This is my first tutorial and I doubt its the best. I tried to be as clear as I could and make it so anyone could understand it. Tell me what you think (constructive criticism please).
Right-e-o. From skimming your document, here's what I found:

Quote:
...that you hold the Q-Menu down to view all of your items...
Holding the whole Q-Menu down sounds like a difficult task.

Quote:
don't think your going
Spelling - you're.

Quote:
and think your 'da bomb'
Spelling - you're

Quote:
Your going to
Spelling - You're

Remember:

your - possession
you're - you are

Quote:
Below are some information
To my knowledge, 'information' is collective, and thus 'is' would be appropriate.

Quote:
Showimg - Displays an image on a certain point.
A whole image, on a point? Consider rewording this. If this is truly for beginners, they will (should) want to actually understand how the command works. Consider replacing 'on' with 'with the top-left corner drawn at a certain point'

Quote:
Showtext - Displays text on a certain point.
Same comment as the last one, though since you can specify some justification settings you may wish to reword it.

Quote:
changeimgcolors - Used to change the color of things (works best with showtext)
What?

Also, if you are explaining the commands and their components, it might be wise to explain what the 'index' is.

Quote:
over 4 is for screen
You should correct this to say '4 or over'

Quote:
The 'for' function:
'for' is a control structure, not a function.

Quote:
heres how we will
Apostrophe usage - here's

Quote:
In order to keep lag down, you should have a lesser timeout for when the
Q-Menu key is not down, and a higher one for when the Q-Menu key is down
What is your basis for this statement?

After this point, I've pretty much stopped checking for spelling/grammar errors. I think you can resolve those on your own.

Quote:
Use the 'for' function
See above.

Quote:
+ If the weapon is not hidden, add the weapon image and name to the strings. I suggest using insertstring so the weapons can easily be read with #I(string,index).
Wouldn't addstring be simpler and just as effective?

Quote:
The example below shows how to use the '%' function.
It does not show you how to use the modulus operator, it provides an example of it being used.

Quote:
for (i=0;i<sarraylen(this.weapons_NAMES);i++) { // Go through the weapons list
This is inefficient. Each time it compares i, it recalculates the length of your string array. Set a variable to the length of your string array a line above your for statement, then compare it to that variable inside your for statement.

Quote:
...mousescreenx and mousescreeny. Those variables are the position

of the mouse on the screen (within the Graal window).
relative to the Graal window

Quote:
Example (in timeout): if (leftmousebutton && in the icon x,y) { // In the icon x,y isnt a real statement....
Why not use the mousedown event...? It's more efficient to act based upon an event when it happens than check a flag every timeout, yaknow.

Quote:
the 'for' function
See above.

---

I applaud you for your effort, but must ask that you thoroughly refine this document. I am going to be mean and edit the thread title, too, to add 'Proposed' in front of it.
Reply With Quote
  #3  
Old 12-20-2004, 07:27 AM
Slash-P2P Slash-P2P is offline
Banned
Join Date: May 2004
Location: Burning Blade
Posts: 941
Slash-P2P is on a distinguished road
I don't make tutorials. I didn't really check it over well for grammar and spelling errors.
Reply With Quote
  #4  
Old 12-20-2004, 07:33 AM
Lance Lance is offline
dark overlord
Lance's Avatar
Join Date: Sep 2003
Location: Space Jam Mountain
Posts: 5,072
Lance is on a distinguished road
Quote:
Originally Posted by Slash-P2P
I don't make tutorials.
So?

Quote:
I didn't really check it over well for grammar and spelling errors.
Well, you should have. I worry more about the other types of errors, though.
Reply With Quote
  #5  
Old 12-20-2004, 07:39 AM
Slash-P2P Slash-P2P is offline
Banned
Join Date: May 2004
Location: Burning Blade
Posts: 941
Slash-P2P is on a distinguished road
Fixed the grammar errors.
Attached Files
File Type: txt tutorial_qmenu.txt (12.7 KB, 708 views)
Reply With Quote
  #6  
Old 12-20-2004, 07:43 AM
Lance Lance is offline
dark overlord
Lance's Avatar
Join Date: Sep 2003
Location: Space Jam Mountain
Posts: 5,072
Lance is on a distinguished road
Quote:
Originally Posted by Slash-P2P
Fixed the grammar errors.
How about the non-grammar errors?
Reply With Quote
  #7  
Old 12-20-2004, 11:36 AM
HoudiniMan HoudiniMan is offline
Playerworld Administrator
HoudiniMan's Avatar
Join Date: Dec 2001
Location: Calfiornia - USA
Posts: 3,512
HoudiniMan will become famous soon enough
Fun fact: The "Q-Menu" is called the "Inventory"

Wow!
__________________
-HoudiniMan (Chief Playerworld Administrator)
Compulsive Support Center Checker - 5 Years and Change
Graal Support Center

Reply With Quote
  #8  
Old 12-20-2004, 05:01 PM
osrs osrs is offline
Graalian since 1998
osrs's Avatar
Join Date: Mar 2002
Location: Brazil
Posts: 2,724
osrs is on a distinguished road
Send a message via ICQ to osrs Send a message via AIM to osrs Send a message via MSN to osrs Send a message via Yahoo to osrs
Could not you wait until I finished the others documents? I've uploaded them on Debug and will finish the last one today so Stefan can check, you should have wait then we could release everything at the same time with a good quality. Thanks for being nice and be the only one who helped, but a bit of patience would be appreciated. x-x
__________________
"Ability is what you are capable of doing. Motivation determines what you do. Attitude determines how well you do it."
Facebook: facebook.com/raysilvadotnet /
Reply With Quote
  #9  
Old 12-20-2004, 06:55 PM
calum calum is offline
Registered User
Join Date: Nov 2003
Location: Scotland
Posts: 182
calum is on a distinguished road
Quote:
Originally Posted by HoudiniMan
Fun fact: The "Q-Menu" is called the "Inventory"

Wow!
I think there is another thing called the inventory that is not used much anymore .
__________________
Reply With Quote
  #10  
Old 12-20-2004, 08:46 PM
Slash-P2P Slash-P2P is offline
Banned
Join Date: May 2004
Location: Burning Blade
Posts: 941
Slash-P2P is on a distinguished road
Quote:
Originally Posted by Lance
How about the non-grammar errors?
I'll go back and revise that soon.

Quote:
Originally Posted by Houdiniman
Fun fact: The "Q-Menu" is called the "Inventory"
Fun Fact: The "Inventory" is known better as the "Q-Menu"

Wow!

Quote:
Originally Posted by osrs
Could not you wait until I finished the others documents? I've uploaded them on Debug and will finish the last one today so Stefan can check, you should have wait then we could release everything at the same time with a good quality. Thanks for being nice and be the only one who helped, but a bit of patience would be appreciated. x-x
I hadn't talked to you in a while so I thought you forgot about it or something.
Reply With Quote
  #11  
Old 12-20-2004, 09:40 PM
GoZelda GoZelda is offline
Mister 1,000,000
GoZelda's Avatar
Join Date: Jan 2003
Location: Brussels, capital of Europe.
Posts: 5,396
GoZelda will become famous soon enough
Send a message via AIM to GoZelda Send a message via MSN to GoZelda
Quote:
Originally Posted by osrs
Could not you wait until I finished the others documents? I've uploaded them on Debug and will finish the last one today so Stefan can check, you should have wait then we could release everything at the same time with a good quality. Thanks for being nice and be the only one who helped, but a bit of patience would be appreciated. x-x
You could've asked me for help too >_>
__________________

Quote:
Originally Posted by Lance
stefan is satan
I am the best.
[URL removed]Music or aural pollution?
Reply With Quote
  #12  
Old 12-21-2004, 05:58 AM
osrs osrs is offline
Graalian since 1998
osrs's Avatar
Join Date: Mar 2002
Location: Brazil
Posts: 2,724
osrs is on a distinguished road
Send a message via ICQ to osrs Send a message via AIM to osrs Send a message via MSN to osrs Send a message via Yahoo to osrs
Quote:
Originally Posted by GoZelda
You could've asked me for help too >_>
I have posted a thread about it two months ago, many people offered help but nobody did, unless Slash. Now everything is finished anyway.
__________________
"Ability is what you are capable of doing. Motivation determines what you do. Attitude determines how well you do it."
Facebook: facebook.com/raysilvadotnet /
Reply With Quote
  #13  
Old 12-23-2004, 03:19 AM
middo middo is offline
VHE Monkey
middo's Avatar
Join Date: Aug 2002
Location: California
Posts: 327
middo is on a distinguished road
Send a message via AIM to middo
Quote:
Originally Posted by HoudiniMan
Fun fact: The "Q-Menu" is called the "Inventory"

Wow!
Fun fact: I haven't willingly called it "Inventory" ever since I started playing! During the first betas!

Wow!

Last edited by middo; 12-24-2004 at 01:10 AM..
Reply With Quote
  #14  
Old 12-27-2004, 10:18 PM
ApothiX ApothiX is offline
Okiesmokie
Join Date: May 2004
Posts: 1,447
ApothiX is on a distinguished road
Quote:
Originally Posted by HoudiniMan
Fun fact: The "Q-Menu" is called the "Inventory"

Wow!
The Inventory is the area below the ASD panel make an NPC with:

PHP Code:
if(created) {
  
setimg bomb.png;
  
toinventory client.suprcoolflag;

__________________


[06:24:19] * Parts: Skyld (i=silent@unaffiliated/skyld) ("Perhaps Okiesmokie did not realise that I like the boys. ")
Reply With Quote
  #15  
Old 12-27-2004, 10:25 PM
Projectshifter Projectshifter is offline
The David
Projectshifter's Avatar
Join Date: Apr 2002
Location: USA
Posts: 912
Projectshifter is an unknown quantity at this point
Send a message via ICQ to Projectshifter Send a message via AIM to Projectshifter Send a message via MSN to Projectshifter Send a message via Yahoo to Projectshifter
Quote:
Originally Posted by HoudiniMan
Fun fact: The "Q-Menu" is called the "Inventory"

Wow!
Sadly you are mistaken my friend :P The inventory was an old and depracated thing. It was kind of like a temp little holder of stuff, never used it much. Q-Menu is commonly and more properly referred to as the NPC-Menu (you can also press period on the num pad).

Overall I skimmed the document. I found there to be a good deal of mistakes and misconceptions. For example that you have to make a timeout to detect when you press it on and off, that is not right, keypressed and keydown/keydown2 are wonderful events Also if there is really a need I will sit down and spend an hour writing one.

Osrs: I looked over and made some edits to your "library" thing on Debug (stefan asked me to). Had to redo the triggeraction for the most part, but overall it wasn't bad. Just don't think I would've called it "library" as much as a "database" he he :P
__________________
Who has time for life these days?
Reply With Quote
  #16  
Old 12-27-2004, 10:31 PM
ApothiX ApothiX is offline
Okiesmokie
Join Date: May 2004
Posts: 1,447
ApothiX is on a distinguished road
Quote:
Originally Posted by Projectshifter
Sadly you are mistaken my friend :P The inventory was an old and depracated thing. It was kind of like a temp little holder of stuff, never used it much. Q-Menu is commonly and more properly referred to as the NPC-Menu (you can also press period on the num pad).
I said it first PS, I win
__________________


[06:24:19] * Parts: Skyld (i=silent@unaffiliated/skyld) ("Perhaps Okiesmokie did not realise that I like the boys. ")
Reply With Quote
  #17  
Old 12-27-2004, 10:32 PM
Projectshifter Projectshifter is offline
The David
Projectshifter's Avatar
Join Date: Apr 2002
Location: USA
Posts: 912
Projectshifter is an unknown quantity at this point
Send a message via ICQ to Projectshifter Send a message via AIM to Projectshifter Send a message via MSN to Projectshifter Send a message via Yahoo to Projectshifter
Quote:
Originally Posted by ApothiX
I said it first PS, I win
Yeah yeah, I'm posting on the forums, so be happy
__________________
Who has time for life these days?
Reply With Quote
  #18  
Old 12-27-2004, 11:22 PM
GoZelda GoZelda is offline
Mister 1,000,000
GoZelda's Avatar
Join Date: Jan 2003
Location: Brussels, capital of Europe.
Posts: 5,396
GoZelda will become famous soon enough
Send a message via AIM to GoZelda Send a message via MSN to GoZelda
Quote:
Originally Posted by osrs
I have posted a thread about it two months ago, many people offered help but nobody did, unless Slash. Now everything is finished anyway.
Oh heh. Didn't notice the thread.
__________________

Quote:
Originally Posted by Lance
stefan is satan
I am the best.
[URL removed]Music or aural pollution?
Reply With Quote
  #19  
Old 12-27-2004, 11:29 PM
osrs osrs is offline
Graalian since 1998
osrs's Avatar
Join Date: Mar 2002
Location: Brazil
Posts: 2,724
osrs is on a distinguished road
Send a message via ICQ to osrs Send a message via AIM to osrs Send a message via MSN to osrs Send a message via Yahoo to osrs
Quote:
Originally Posted by Projectshifter
Osrs: I looked over and made some edits to your "library" thing on Debug (stefan asked me to). Had to redo the triggeraction for the most part, but overall it wasn't bad. Just don't think I would've called it "library" as much as a "database" he he :P
Okay, post it in a new thread if possible.
__________________
"Ability is what you are capable of doing. Motivation determines what you do. Attitude determines how well you do it."
Facebook: facebook.com/raysilvadotnet /
Reply With Quote
  #20  
Old 12-27-2004, 11:29 PM
Kaimetsu Kaimetsu is offline
Script Monkey
Kaimetsu's Avatar
Join Date: May 2001
Posts: 18,222
Kaimetsu will become famous soon enough
Quote:
Originally Posted by Projectshifter
keypressed and keydown/keydown2 are wonderful events
keydown isn't an event.
__________________
Reply With Quote
  #21  
Old 12-28-2004, 12:11 AM
Projectshifter Projectshifter is offline
The David
Projectshifter's Avatar
Join Date: Apr 2002
Location: USA
Posts: 912
Projectshifter is an unknown quantity at this point
Send a message via ICQ to Projectshifter Send a message via AIM to Projectshifter Send a message via MSN to Projectshifter Send a message via Yahoo to Projectshifter
Quote:
Originally Posted by osrs
Okay, post it in a new thread if possible.
You mean the new document? It's in debug under the same name you used, but yours has _osrs.txt appended to it and mine is _ps.txt now. I can't get on Debug because of the new IP rule and Stefan didn't ever set an IP for me =/

Quote:
Originally Posted by Kaimetsu
keydown isn't an event.
It USED to not be, but I'm quite sure it has been updated since, I myself thought so until a little bit ago when someone was using it. Also you can do if (keypressed) and then use conditional if (keydown())/keydown2() to check other aspects such as control and alt into it.
__________________
Who has time for life these days?
Reply With Quote
  #22  
Old 12-28-2004, 01:20 AM
Kaimetsu Kaimetsu is offline
Script Monkey
Kaimetsu's Avatar
Join Date: May 2001
Posts: 18,222
Kaimetsu will become famous soon enough
Quote:
Originally Posted by Projectshifter
It USED to not be, but I'm quite sure it has been updated since
Not in my Graal version. Perhaps you would like to provide some example scripts to back it up?
__________________
Reply With Quote
  #23  
Old 12-28-2004, 01:48 AM
Andares Andares is offline
Scr1pt3r-ish
Andares's Avatar
Join Date: Mar 2004
Posts: 55
Andares is on a distinguished road
Send a message via AIM to Andares
Quote:
Originally Posted by Kaimetsu
keydown isn't an event.
Cheers to that! I was about to post it.
__________________
Quote:
<Wan> Can I have a poll? Do people mind if I talk about sexual intercourse between two human beings?
<Kai> Wan, I think the problem is that it's basically ALL you talk about
<Wan> Ahhhhhh
Aim: AtariTandy | Job: Sanstrata)
Reply With Quote
  #24  
Old 12-28-2004, 01:55 AM
Projectshifter Projectshifter is offline
The David
Projectshifter's Avatar
Join Date: Apr 2002
Location: USA
Posts: 912
Projectshifter is an unknown quantity at this point
Send a message via ICQ to Projectshifter Send a message via AIM to Projectshifter Send a message via MSN to Projectshifter Send a message via Yahoo to Projectshifter
Quote:
Originally Posted by Andares
Cheers to that! I was about to post it.
Except I've already responded as such.
Anyway, right now my IP is off, so I will see what goes when I get it back up. Also I'm on linux so I cannot use an offline level editor or so right now.
__________________
Who has time for life these days?
Reply With Quote
  #25  
Old 12-29-2004, 10:25 PM
Python523 Python523 is offline
Banned
Join Date: Aug 2001
Location: Illinois
Posts: 3,498
Python523 is on a distinguished road
Quote:
Originally Posted by Projectshifter
Except I've already responded as such.
Anyway, right now my IP is off, so I will see what goes when I get it back up. Also I'm on linux so I cannot use an offline level editor or so right now.
It is not an event and it never has been (and, for the purpose it is used for, never will be).

Last edited by Python523; 12-29-2004 at 10:55 PM..
Reply With Quote
  #26  
Old 12-29-2004, 10:31 PM
Kaimetsu Kaimetsu is offline
Script Monkey
Kaimetsu's Avatar
Join Date: May 2001
Posts: 18,222
Kaimetsu will become famous soon enough
Quote:
Originally Posted by Python523
It is not a function and it never has been
Keydown? It most certainly is a function.
__________________
Reply With Quote
  #27  
Old 12-29-2004, 10:56 PM
Python523 Python523 is offline
Banned
Join Date: Aug 2001
Location: Illinois
Posts: 3,498
Python523 is on a distinguished road
Quote:
Originally Posted by Kaimetsu
Keydown? It most certainly is a function.
Ack, my train of thought has been off, my bad. I meant it's not an event... I really should read what I type before I post. *edits post*
Reply With Quote
  #28  
Old 01-01-2005, 02:43 PM
Velox Cruentus Velox Cruentus is offline
Registered User
Velox Cruentus's Avatar
Join Date: Dec 2004
Location: Quebec, Canada
Posts: 465
Velox Cruentus is on a distinguished road
Send a message via ICQ to Velox Cruentus Send a message via AIM to Velox Cruentus
This is fun: Scripters bashing scripters.

Anyhow, thanks for the Tutorial -- I bet some people would still appreciate the involvement you put into it. It's saddening that the community couldn't give you a warmer greeting.
Reply With Quote
  #29  
Old 01-02-2005, 05:20 AM
Kaimetsu Kaimetsu is offline
Script Monkey
Kaimetsu's Avatar
Join Date: May 2001
Posts: 18,222
Kaimetsu will become famous soon enough
Quote:
Originally Posted by Velox Cruentus
Scripters bashing scripters
Where?
__________________
Reply With Quote
  #30  
Old 01-02-2005, 06:36 AM
Velox Cruentus Velox Cruentus is offline
Registered User
Velox Cruentus's Avatar
Join Date: Dec 2004
Location: Quebec, Canada
Posts: 465
Velox Cruentus is on a distinguished road
Send a message via ICQ to Velox Cruentus Send a message via AIM to Velox Cruentus
Eh? Where what?

*hugs Kaimetsu*
It's not your fault, Kaimetsu! *tightens grasp on Kaimetsu*
Reply With Quote
  #31  
Old 01-02-2005, 06:39 AM
Slash-P2P Slash-P2P is offline
Banned
Join Date: May 2004
Location: Burning Blade
Posts: 941
Slash-P2P is on a distinguished road
Quote:
Originally Posted by Velox Cruentus
It's saddening that the community couldn't give you a warmer greeting.
Apparently you are new to the Graal community.
Reply With Quote
  #32  
Old 01-02-2005, 06:40 AM
Kaimetsu Kaimetsu is offline
Script Monkey
Kaimetsu's Avatar
Join Date: May 2001
Posts: 18,222
Kaimetsu will become famous soon enough
Quote:
Originally Posted by Velox Cruentus
Eh? Where what?
Read my post again. Read the quote. Surely I was not too cryptic.
__________________
Reply With Quote
  #33  
Old 01-02-2005, 01:03 PM
Velox Cruentus Velox Cruentus is offline
Registered User
Velox Cruentus's Avatar
Join Date: Dec 2004
Location: Quebec, Canada
Posts: 465
Velox Cruentus is on a distinguished road
Send a message via ICQ to Velox Cruentus Send a message via AIM to Velox Cruentus
*hugs Kaimetsu again* I love you too.
Reply With Quote
  #34  
Old 01-02-2005, 01:17 PM
Kaimetsu Kaimetsu is offline
Script Monkey
Kaimetsu's Avatar
Join Date: May 2001
Posts: 18,222
Kaimetsu will become famous soon enough
What a novel defense mechanism.
__________________
Reply With Quote
  #35  
Old 01-02-2005, 11:12 PM
Velox Cruentus Velox Cruentus is offline
Registered User
Velox Cruentus's Avatar
Join Date: Dec 2004
Location: Quebec, Canada
Posts: 465
Velox Cruentus is on a distinguished road
Send a message via ICQ to Velox Cruentus Send a message via AIM to Velox Cruentus
Are you going to keep saying that, hun?
Reply With Quote
  #36  
Old 01-03-2005, 02:15 AM
Slash-P2P Slash-P2P is offline
Banned
Join Date: May 2004
Location: Burning Blade
Posts: 941
Slash-P2P is on a distinguished road
...Thanks whoever silenced my opinion
Isn't it awesome how you make a thread about a Q-Menu tutorial and certain people post stupid stuff, and my post ends up getting deleted?
Reply With Quote
  #37  
Old 01-03-2005, 02:52 AM
Velox Cruentus Velox Cruentus is offline
Registered User
Velox Cruentus's Avatar
Join Date: Dec 2004
Location: Quebec, Canada
Posts: 465
Velox Cruentus is on a distinguished road
Send a message via ICQ to Velox Cruentus Send a message via AIM to Velox Cruentus
You're welcome!
Reply With Quote
  #38  
Old 01-03-2005, 06:21 AM
CaTigus CaTigus is offline
Scripter
Join Date: Oct 2002
Posts: 80
CaTigus is on a distinguished road
Quote:
Originally Posted by Velox Cruentus
Are you going to keep saying that, hun?
I like fish. Mostly Cichlids.
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 11:24 PM.


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