Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting > New Scripting Engine (GS2)
FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 05-26-2009, 05:52 PM
Skyld Skyld is offline
Script-fu
Skyld's Avatar
Join Date: Jan 2002
Location: United Kingdom
Posts: 3,914
Skyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud of
Send a message via AIM to Skyld
Script events

You might find the following list of clientside script events useful:
HTML Code:
Global:
  onClassLoaded(str) - a class script has been updated: name of the class
  onConnectingToServer(str, str, int) - connecting to: servername, address, port
  onDefaultStyleChanges(str) - the $pref::Video::defaultguistyle has been changed
  onFileChunkReceived(str, int, int) - file download progress: filename, current position, full size
  onFileDownloaded(str, int) - a game file has been downloded: filename, size
  onFilesUploaded() - finished uploading all files to the file browser
  onFirstResponderChanges(obj) - the control that received the keyboard input changed
  onFolderLog(str) - scripted RC file browser message
  onLevelFileUpdated(str) - a game file has been updated: filename
  onLogMessage(str, float, float, float, str) - log message: text, red, green, blue, log type
  onMapClick(obj) - clicked on a player on the map: player object
  onMouseYawPitch(int, int) - the mouse moved in 3D mode: yaw and pitch
  onMusicDataReceived(str, str) - music meta data received: name and value
  onOfflineModeStarted() - the offline mode is started because there is no connection to the server
  onOpenHelpWindow() - the key for opening the help window (F1) has been pressed
  onOpenLogWindow() - the key for opening the log window (F2) has been pressed
  onOpenOptionsWindow() - the key for opening the options window (F3) has been pressed
  onOpenPlayerList() - the key for opening the player list (F7) has been pressed
  onOpenPlayerPositionWindow() - the key for opening the positon window (F5) has been pressed
  onOpenProfileWindow(obj) - right click on a player or call to showProfile() to open the profile window
  onOpenServerList() - the key for opening the serverlist (F8) has been pressed
  onPackagesDownloadComplete() - all update packages (.gupd files) have been downloaded
  onPackagesDownloaded() - some update packages (.gupd files) have been downloaded
  onPlayerChanges(obj, int) - the look of a player changed: player object and id
  onPlayerLanguageChanges(obj, str) - the language of the player has changed: player object, new language
  onPlayerLogin(obj, int) - a player logged in: player object and id
  onPlayerLogout(obj, int) - a player logged out: player object (might be NULL) and id
  onPM(obj) - received a PM from a player: player object
  onRCChat(str) - scripted RC chat: text
  onRemotePlayerChats(obj, str) - another player is saying something: player object, text
  onServerListerConnect() - a connection to the server-lister (central server) established
  onServerLogin() - logged into a server
  onToall(obj, str) - received a toall message: player object and message
  onTranslationUpdated(str) - a translation file (.po) has been updated
  onUpdatePackageDownloaded(obj) - downloaded an update package (.gupd): package object

  GuiControl (TGraalVar):
    onAction() - an action happened (e.g. button pressed)
    onAdd() - the control has been added as child to another control
    onDialogPop() - the control is no longer the dialog control (popDialog())
    onDialogPush() - the control is now the dialog control (pushDialog())
    onDropFiles(int, int, obj) - files dropped from explorer/finder to the control (acceptdropfiles must be true): x, y, filelist
    onHide() - the control is no longer visible on the screen
    onKeyDown(int, str, int) - a key has been pressed: keycode, keytext, scancode
    onKeyUp(int, str, int) - a key has been released: keycode, keytext, scancode
    onMouseDown(int, int, int, int) - mouse click: key modifiers, mouse x and y, click count
    onMouseDragged(int, int, int, int) - mouse moved while holding the mouse button down: key modifiers, mouse x and y, click count
    onMouseEnter(int, int, int, int) - mouse enters the area of the control: key modifiers, mouse x and y, click count
    onMouseLeave(int, int, int, int) - mouse leaves the are of the control: key modifiers, mouse x and y, click count
    onMouseMove(int, int, int, int) - mouse moved: key modifiers, mouse x and y, click count
    onMouseUp(int, int, int, int) - mouse button released: key modifiers, mouse x and y, click count
    onMouseWheelDown(int, int, int, int) - mouse wheel scrolled down: key modifiers, mouse x and y, click count
    onMouseWheelUp(int, int, int, int) - mouse wheel scrolled up: key modifiers, mouse x and y, click count
    onMove(int, int) - the control has been moved to x, y
    onRemove() - the control has been removed from its parent
    onResize(int, int) - the control has been resized to width, height
    onRightMouseDown(int, int, int, int) - right mouse click: key modifiers, mouse x and y, click count
    onRightMouseDragged(int, int, int, int) - mouse moved while holding the right mouse button down: key modifiers, mouse x and y, click count
    onRightMouseUp(int, int, int, int) - right mouse button released: key modifiers, mouse x and y, click count
    onShow() - the control becomes actually visible on the screen
    onSleep() - the control is not part of the screen anymore
    onStartDrag() - the user is moving the control
    onStopDrag(int, int, int, int) - stopped moving a control: key modifiers, mouse x and y, click count
    onStyleChanges() - the GUI style has changed 
    onWake() - the control has been added to the screen

    GuiAnimationCtrl (GuiControl):
      onAnimationEnd(int) - finished moving: new entry index
      onAnimationStart(int, int) - started moving: current entry index, destination entry index

    GuiArrayCtrl (GuiControl):
      onOpenMenu(int, int, int, int) - right click on an entry: column, row, mouse x and y
      onSelect(int, int) - an entry has been selected: column and row

      GuiTextListCtrl (GuiArrayCtrl):
        onDblClick(int, str, int) - double click on a list entry: id, text, row
        onDeleteKey(int, str, int) - delete key pressed for an entry: id, text, row
        onIconResized(int, int) - the size of the icons has been changed: new width and height
        onMouseOverCell(int, str, int) - the mouse is hovering over a list entry: id, text, row
        onOpenMenu(int, str, int) - right-click on a list entry: id, text, row
        onSelect(int, str, int) - a list entry has been selected: id, text, row

      GuiTreeViewCtrl (GuiArrayCtrl):
        onDblClick(obj, str, str) - double-click on a node: node object, slash-path, dot-path
        onExpand(obj, str, str) - a node is expanding: node object, slash-path, dot-path
        onFold(obj, str, str) - a node is folded: node object: slash-path, dot-path
        onIconResized(int, int) - the size of the icons has been changed: new width and height
        onMouseOverCell(obj, str, str) - the mouse is hovering over a node: node object, slash-path, dot-path
        onOpenMenu(obj, str, str) - right click on a node: node object, slash-path, dot-path
        onSelect(obj, str, str) - a node is selected: node object, slash-path, dot-path

    GuiContextMenuCtrl (GuiControl):
      onCancel() - the menu has been closed without selecting an entry
      onSelect(int, str, int) - a menu entry has been selected: id, text and row

      GuiStartMenuCtrl (GuiContextMenuCtrl):
        onCancel() - the menu has been closed without selecting an entry
        onSelect(int, str, int) - a menu entry has been selected: id, text and row
        onTextChanged(str) - the menu text has been changed

    GuiMenuCtrl (GuiControl):
      onCancel() - the menu has been closed without selecting a menu entry
      onIconResized(int, int) - the size of the icons has been changed: new width and height
      onSelect(str, int, str, int) - a menu item has been selected: menu name, selection id, text and row

    GuiMLTextCtrl (GuiControl):
      onCursorLineChanged(int) - cursor moved: new line number
      onReflow(int, int) - the displayed content changed: new visible width and height
      onRightSelectTag(str) - right click on: tag id
      onSelectTag(str) - the user clicked on a tag or bitmap: tag id
      onURL(str) - the user clicked on an url

    GuiSliderCtrl (GuiControl):
      onAction(float) - the slider value has been changed (by script or user): new slider value
      onReleaseSlider(float) - the user has finishzed moving the slider: new slider value

    GuiSpriteCtrl (GuiControl):
      onPlayerDies() - the player died
      onUpdateScore(int, int) - new score: new total score, added points

    GuiTabCtrl (GuiControl):
      onDeselect(int, str, int) - a tab is no longer selected: id, text, row
      onIconResized(int, int) - the size of the icons has been changed: new width and height
      onMouseOverCell(int, str, int) - the mouse is hovering over a tab: id, text, row
      onOpenMenu(int, int, int) - the user has clicked with the right mouse button on an entry: row, mouse x and y
      onSelect(int, str, int) - a tab has been selected: id, text, row

    GuiTextCtrl (GuiControl):
      onTextChanged(str) - text has been changed

      GuiPopUpEditCtrl (GuiTextCtrl):
        onCancel() - the menu has been closed without selecting an entry
        onSelect(int, str, int) - a menu entry has been selected: id, text and row

      GuiPopUpMenuCtrl (GuiTextCtrl):
        onCancel() - the menu has been closed without selecting an entry
        onSelect(int, str, int) - a menu entry has been selected: id, text and row

      GuiTextEditCtrl (GuiTextCtrl):
        onAction(str) - a text has been entered (return key pressed)
        onTabComplete(bool) - the tab key has been pressed (with or without shift key)

      GuiWindowCtrl (GuiTextCtrl):
        onCloseQuery() - the player clicked on the close button and closequery=true
        onTextChanged(str) - the window title has been changed
I don't know whether all of the global events will be available to unprivileged (non-login) scripts like onConnectingToServer() but I guess they are not a lot of use to unprivileged scripts anyway.
Reply With Quote
  #2  
Old 05-26-2009, 06:41 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 have to spread first
Thanks a bunch!
__________________
Reply With Quote
  #3  
Old 05-26-2009, 06:42 PM
[email protected] sid.gottlieb@googlemail.com is offline
Banned
Join Date: Mar 2008
Posts: 861
sid.gottlieb@googlemail.com will become famous soon enough
You're great- thank you!
Could you compile a list for all script functions (onCreated, onTimeout) etc.
Reply With Quote
  #4  
Old 05-26-2009, 07:33 PM
DustyPorViva DustyPorViva is offline
Will work for food. Maybe
DustyPorViva's Avatar
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
DustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond repute
Send a message via AIM to DustyPorViva Send a message via MSN to DustyPorViva
That's great, a lot of events I didn't know existed
Reply With Quote
  #5  
Old 05-26-2009, 07:35 PM
Tigairius Tigairius is offline
The Cat
Tigairius's Avatar
Join Date: Jan 2007
Location: Missouri, USA
Posts: 4,240
Tigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant future
This is great, thanks
__________________


“Shoot for the moon. Even if you miss, you'll land among the stars.”
Reply With Quote
  #6  
Old 05-26-2009, 08:08 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
onOfflineModeStarted()

Makes me wonder why we can't work and test GS2 scripts offline.
__________________
Quote:
Reply With Quote
  #7  
Old 05-26-2009, 11:10 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
+rep
__________________
Reply With Quote
  #8  
Old 05-26-2009, 11:11 PM
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
Awesome, thanks Skyld.

Quote:
Originally Posted by [email protected] View Post
You're great- thank you!
Could you compile a list for all script functions (onCreated, onTimeout) etc.
They're called events.
__________________
Reply With Quote
  #9  
Old 05-27-2009, 11:00 PM
Skyld Skyld is offline
Script-fu
Skyld's Avatar
Join Date: Jan 2002
Location: United Kingdom
Posts: 3,914
Skyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud of
Send a message via AIM to Skyld
Quote:
Originally Posted by [email protected] View Post
You're great- thank you!
Could you compile a list for all script functions (onCreated, onTimeout) etc.
I guess there is a sorta-partial list at http://wiki.graal.us/CategoryFunctionEvent but it is not complete; people should help to document what they know more.
Reply With Quote
  #10  
Old 05-28-2009, 12:36 PM
Pelikano Pelikano is offline
Registered User
Pelikano's Avatar
Join Date: Oct 2008
Posts: 1,133
Pelikano can only hope to improve
Quote:
Originally Posted by cbk1994 View Post
Awesome, thanks Skyld.



They're called events.
ysosmart?
Reply With Quote
  #11  
Old 05-28-2009, 02:12 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 Pelikano View Post
ysosmart?
Because "functions" is not the correct term.
__________________
Reply With Quote
  #12  
Old 05-28-2009, 04:18 PM
Pelikano Pelikano is offline
Registered User
Pelikano's Avatar
Join Date: Oct 2008
Posts: 1,133
Pelikano can only hope to improve
still using [i] on the word, is very ***gy
Reply With Quote
  #13  
Old 05-28-2009, 05:11 PM
Codein Codein is offline
jwd
Codein's Avatar
Join Date: Oct 2005
Location: Greater Manchester
Posts: 2,423
Codein has a spectacular aura aboutCodein has a spectacular aura about
Send a message via AIM to Codein Send a message via MSN to Codein
Quote:
Originally Posted by Pelikano View Post
still using [i] on the word, is very ***gy
How is emphasising a word, especially a key word, '***gy'?
Reply With Quote
  #14  
Old 05-28-2009, 05:15 PM
Pelikano Pelikano is offline
Registered User
Pelikano's Avatar
Join Date: Oct 2008
Posts: 1,133
Pelikano can only hope to improve
Quote:
Originally Posted by Codein View Post
How is emphasising a word, especially a key word, '***gy'?
it was an attack, we all know that
Reply With Quote
  #15  
Old 05-28-2009, 05:46 PM
Codein Codein is offline
jwd
Codein's Avatar
Join Date: Oct 2005
Location: Greater Manchester
Posts: 2,423
Codein has a spectacular aura aboutCodein has a spectacular aura about
Send a message via AIM to Codein Send a message via MSN to Codein
Quote:
Originally Posted by Pelikano View Post
it was an attack, we all know that
Or, rather, a pretty legitimate correction? This is from a standing point where I've known no previous bitterness between Chris and Andy. I've certainly seen none shown on the forums. Maybe you could correct me on that? :P
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 03:47 PM.


Powered by vBulletin® Version 3.8.3
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
Copyright (C) 1998-2008 Linux cyberjoueurs All Rights Reserved.