The Wiki is actually very sensibly organised. Let me give you some examples of how you might search for things in the Wiki.
I'm working with a GuiTabCtrl, but I want to look up how to clear all of the tabs.
- Open up the wiki (http://wiki.graal.net/Creation/Dev/GScript) and navigate to the clientside page, because I'm working clientside.
- Now, a GuiTabCtrl is a class or object, so navigate to "Classes / Object Types".
- I've got a tree of objects now, so find GuiTabCtrl and click it. I've now got a page up with all of the functions, variables and events related to the object.
- Here I find the function I'm looking for: clearRows()
Now I've got my GuiTabCtrl working, I want to change some attributes about the control. For example, I want to change the size of it, but that attribute isn't listed under GuiTabCtrl.
- The top of the page states that it inherits 'GuiControl', so everything that is available in GuiControl is available to my GuiTabCtrl. Click the 'GuiControl' link.
- I look down the list of variables and see the 'extent' variable; that's the one I'm looking for.
Now finally, I want to edit the text of one of the tabs by making it lower case. I want to edit the variable MyTabs.rows[0].text.
- Navigate back to http://wiki.graal.net/Creation/Dev/GScript and go back to the clientside functions.
- I'm looking for functions regarding strings, so look under the '1.4 Functions' header in the navigation box.
- Find '1.4.1.3 Strings' listed under Common. Perfect. A list of common string functions. Follow the link.
- Listed there is just the function I'm looking for:
PHP Code:
lowercase(str text) - returns lowercased string
That isn't difficult. For the object types, the available events are listed at the bottom of the page where available. It isn't difficult to find things.
If you are worried that you can't figure out the basic events (
if (created) is now
function onCreated()) then look at the old commands.rtf and just rewrite them in the
function onEVENTNAME() format.
HTML Code:
Built-in Flags true when:
actionleftmouse someone left-clicks on the npc
actionrightmouse someone right-clicks the npc
actionmiddlemouse someone middle-clicks the npc
actiondoublemouse someone double-clicks the npc
actionprojectile is triggered when a projectile lands on player/npc from the shoot command
canspin the player has spin power (for sword)
carrying the player carries something
carriesblackstone the player carries a blackstone
carriesbush the player carries a bush
carriessign the player carries a sign
carriesstone the player carries a stone
carriesvase the player carries a vase
compsdead there is no living baddy
compusdied all baddies died
exploded the npc was exploded by a bomb
firedonhorse this npc weapon is fired while riding on horse
followsplayer the npc currently follows the player
hasweapon( name ) the player has the weapon specified with ‘name’
isleader the player entered the level first (of all players in the same room)
isonmap the player is on an outside level
issparringzone the player is in a sparring level
isweapon this npc is a weapon
keycode(character) gets the keycode for a character
keypressed occurs when a standard key is pressed, also triggers a parameter, #P(0) for the keycode, #P(1) for the character
keydown( key ) the specified key is pressed (0..10: up,left,down,right,S,A,D,M,tab,Q,P)
keydown2(keycode,ignorecase) checks if a key has been pressed, must be true if you want to turn off the check for alt/shift/ctrl
for keycode values, check at the end.
lighteffectsenabled the player can see light effects
leftmousebutton the left-mouse button is clicked (in combination with mousedown)
middlemousebutton the middle-mouse button is clicked (in combination with mousedown)
rightmousebutton the right-mouse button is clicked (in combination with mousedown)
mousedown a mouse button is clicked
mouseup the mouse is released
mousewheel when the mousewheel has been used
nopkzone the player is in a level where you can’t hurt other players
onmapx( level ) x-position of the level on the current map
onmapy( level ) y-position of the level on the current map
onwall( x, y ) the specified field is blocked
onwater( x, y ) the specified field is water
playeronline the game is in online mode
peltwithblackstone the npc was pelt with a blackstone
peltwithbush the npc was pelt with a bush
peltwithnpc the npc was pelt with another npc
peltwithsign the npc was pelt with a sign
peltwithstone the npc was pelt with a stone
peltwithvase the npc was pelt with a vase
playerchats the player says something
playerdies the player died
playerendsreading the player finished reading
playerenters the layer enters the room
playerhurt the player has been hurt
playerisfemale the player is female
playerismale the player is male (specified in headsconfig.txt)
playerlaysitem somebody layed an item
playeronhorse the player rides on a horse (or boat)
playerreading the player is reading a sign
playerswimming the player is swimming
playertouchsme the layer touchs the npc
playertouchsother the player touchs another npc
playerattached the player is attached to this npc
shotbybaddy the npc was shot by a computer opponent
shotbyplayer the npc was shot by the player
startswith( partstr, str ) str starts with partstr
strcontains( str, partstr ) str contains partstr
strequals( str1, str2 ) str1=str2 (both strings can contain message codes)
timeout the npc’s timeout counter runs to 0
visible the npc is visible
wa**** the npc was slayed with a sword or axe
waspelt the npc was pelt
wasshot the npc was shot with arrows
wasthrown the npc was carried and then thrown
weaponfired this npc is used as weapon, ‘D’ (or joybutton1) is pressed
weaponsenabled the player weapons are enabled