|
|
(31 intermediate revisions by 12 users not shown) |
Line 1: |
Line 1: |
| GScript 2 is the new scripting engine for [[Graal]]
| | [[Category:Scripting Reference]] |
| | | What was formerly called [[Creation/Dev/Old GScript|GScript]] has now been replaced as '''GScript2''', [[Creation/Dev/GScript|Graal's scripting language]]. |
| 1. Old script compatibility
| |
| | |
| 1.1. Removed functionality
| |
| | |
| - toinventory
| |
| - followplayer
| |
| - playersays()
| |
| - setbackpal
| |
| | |
| 1.2. Supported old scripting commands & their mapping to new script
| |
| | |
| addstring oldstring, oldstring;
| |
| addstring(string,string);
| |
| addtiledef oldstring, oldstring, float;
| |
| addtiledef(string,string,float);
| |
| addtiledef2 oldstring, oldstring, float, float;
| |
| addtiledef2(string,string,float,float);
| |
| attachplayertoobj float, float;
| |
| attachplayertoobj(float,float);
| |
| blockagain;
| |
| blockagain();
| |
| blockagainlocal;
| |
| blockagainlocal();
| |
| callnpc float, oldstring;
| |
| callnpc(float,string);
| |
| callweapon float, oldstring;
| |
| callweapon(float,string);
| |
| canbecarried;
| |
| canbecarried();
| |
| canbepulled;
| |
| canbepulled();
| |
| canbepushed;
| |
| canbepushed();
| |
| cannotbecarried;
| |
| cannotbecarried();
| |
| cannotbepulled;
| |
| cannotbepulled();
| |
| cannotbepushed;
| |
| cannotbepushed();
| |
| canwarp;
| |
| canwarp();
| |
| canwarp2;
| |
| canwarp2();
| |
| carryobject oldstring;
| |
| carryobject(string);
| |
| changeimgcolors float, float, float, float, float;
| |
| changeimgcolors(float,float,float,float,float);
| |
| changeimgmode float, float;
| |
| changeimgmode(float,float);
| |
| changeimgpart float, float, float, float, float;
| |
| changeimgpart(float,float,float,float,float);
| |
| changeimgvis float, float;
| |
| changeimgvis(float,float);
| |
| changeimgzoom float, float;
| |
| changeimgzoom(float,float);
| |
| deletestring oldstring, float;
| |
| deletestring(string,float);
| |
| destroy;
| |
| destroy();
| |
| detachplayer;
| |
| detachplayer();
| |
| disabledefmovement;
| |
| disabledefmovement();
| |
| disablemap;
| |
| disablemap();
| |
| disablepause;
| |
| disablepause();
| |
| disableselectweapons;
| |
| disableselectweapons();
| |
| disableweapons;
| |
| disableweapons();
| |
| dontblock;
| |
| dontblock();
| |
| dontblocklocal;
| |
| dontblocklocal();
| |
| drawaslight;
| |
| drawaslight();
| |
| drawoverplayer;
| |
| drawoverplayer();
| |
| drawunderplayer;
| |
| drawunderplayer();
| |
| enabledefmovement;
| |
| enabledefmovement();
| |
| enablefeatures float;
| |
| enablefeatures(float);
| |
| enablemap;
| |
| enablemap();
| |
| enablepause;
| |
| enablepause();
| |
| enableselectweapons;
| |
| enableselectweapons();
| |
| enableweapons;
| |
| enableweapons();
| |
| explodebomb float;
| |
| explodebomb(float);
| |
| followplayer;
| |
| followplayer();
| |
| freezeplayer float;
| |
| freezeplayer(float);
| |
| freezeplayer2;
| |
| freezeplayer2();
| |
| hide;
| |
| hide();
| |
| hideimg float;
| |
| hideimg(float);
| |
| hideimgs float, float;
| |
| hideimgs(float,float);
| |
| hidelocal;
| |
| hidelocal();
| |
| | |
| hitcompu float, float, float, float;
| |
| hitcompu(float,float,float,float);
| |
| hitnpc float, float, float, float;
| |
| hitnpc(float,float,float,float);
| |
| hitobjects float, float, float;
| |
| hitobjects(float,float,float);
| |
| hideplayer float;
| |
| hideplayer(float);
| |
| hidesword float;
| |
| hidesword(float);
| |
| hitplayer float, float, float, float;
| |
| hitplayer(float,float,float,float);
| |
| hurt float;
| |
| hurt(float);
| |
| insertstring oldstring, float, oldstring;
| |
| insertstring(string,float,string);
| |
| join oldstring;
| |
| join(string);
| |
| lay oldstring;
| |
| lay(string);
| |
| lay2 oldstring, float, float;
| |
| lay2(string,float,float);
| |
| loadmap oldstring;
| |
| loadmap(string);
| |
| message oldstring;
| |
| message(string);
| |
| move float, float, float, float;
| |
| move(float,float,float,float);
| |
| noplayerkilling;
| |
| noplayerkilling();
| |
| openurl oldstring;
| |
| openurl(string);
| |
| openurl2 oldstring, float, float;
| |
| openurl2(string,float,float);
| |
| play oldstring;
| |
| play(string);
| |
| play2 oldstring, float, float, float;
| |
| play2(string,float,float,float);
| |
| playlooped oldstring;
| |
| playlooped(string);
| |
| putbomb float, float, float;
| |
| putbomb(float,float,float);
| |
| putcomp oldstring, float, float;
| |
| putcomp(string,float,float);
| |
| putexplosion float, float, float;
| |
| putexplosion(float,float,float);
| |
| putexplosion2 float, float, float, float;
| |
| putexplosion2(float,float,float,float);
| |
| puthorse oldstring, float, float;
| |
| puthorse(string,float,float);
| |
| putleaps float, float, float;
| |
| putleaps(float,float,float);
| |
| putnewcomp oldstring, float, float, oldstring, float;
| |
| putnewcomp(string,float,float,string,float);
| |
| putnpc oldstring, oldstring, float, float;
| |
| putnpc(string,string,float,float);
| |
| putnpc2 float, float, oldstring;
| |
| putnpc2(float,float,string);
| |
| reflectarrow float;
| |
| reflectarrow(float);
| |
| removearrow float;
| |
| removearrow(float);
| |
| removebomb float;
| |
| removebomb(float);
| |
| removecompus;
| |
| removecompus();
| |
| removeexplo float;
| |
| removeexplo(float);
| |
| removehorse float;
| |
| removehorse(float);
| |
| rmeoveitem float;
| |
| removeitem(float)
| |
| removestring oldstring, oldstring;
| |
| removestring(string,string);
| |
| removetiledefs oldstring;
| |
| removetiledefs(string);
| |
| replaceani oldstring, oldstring;
| |
| replaceani(string,string);
| |
| replacestring oldstring, float, oldstring;
| |
| replacestring(string,float,string);
| |
| resetfocus;
| |
| resetfocus();
| |
| savelog oldstring;
| |
| savelog(string);
| |
| savelog2 oldstring, oldstring;
| |
| savelog2(string,string);
| |
| say float;
| |
| say(float);
| |
| say2 oldstring;
| |
| say2(string);
| |
| sendrpgmessage oldstring;
| |
| sendrpgmessage(string);
| |
| sendpm oldstring;
| |
| sendpm(string);
| |
| sendtonc oldstring;
| |
| sendtonc(string);
| |
| sendtorc oldstring;
| |
| sendtorc(string);
| |
| serverwarp oldstring;
| |
| serverwarp(string);
| |
| set oldstring;
| |
| set(string);
| |
| setani oldstring, oldstring;
| |
| setani(string,string);
| |
| setarray float, float;
| |
| setarray(var,float);
| |
| setbeltcolor oldstring;
| |
| setbeltcolor(string);
| |
| setbow oldstring;
| |
| setbow(string);
| |
| setcharani oldstring, oldstring;
| |
| setcharani(string,string);
| |
| setchargender oldstring;
| |
| setchargender(string);
| |
| setcharprop oldstring, oldstring;
| |
| string = string;
| |
| setcoatcolor oldstring;
| |
| setcoatcolor(string);
| |
| setcoloreffect float, float, float, float;
| |
| setcoloreffect(float,float,float,float);
| |
| setcursor float;
| |
| setcursor(float);
| |
| setcurcor2 oldstring;
| |
| setcursor2(string);
| |
| seteffect float, float, float, float;
| |
| seteffect(float,float,float,float);
| |
| seteffectmode float;
| |
| seteffectmode(float);
| |
| setfocus float, float;
| |
| setfocus(float,float);
| |
| setgender oldstring;
| |
| setgender(string);
| |
| sethead oldstring;
| |
| sethead(string);
| |
| setlevel oldstring;
| |
| setlevel(string);
| |
| setlevel2 oldstring, float, float;
| |
| setlevel2(string,float,float);
| |
| setmap oldstring, oldstring, float, float;
| |
| setmap(string,string,float,float);
| |
| setminimap oldstring, oldstring, float, float;
| |
| setminimap(string,string,float,float);
| |
| setmusicvolume float, float;
| |
| setmusicvolume(float,float);
| |
| setimg oldstring;
| |
| setimg(string);
| |
| setimgpart oldstring, float, float, float, float;
| |
| setimgpart(string,float,float,float,float);
| |
| setletters oldstring;
| |
| setletters(string);
| |
| setplayerdir oldstring;
| |
| setplayerdir(string);
| |
| setplayerprop oldstring, oldstring;
| |
| string = string;
| |
| setpm oldstring;
| |
| setpm(string);
| |
| setshape float, float, float;
| |
| setshape(float,float,float);
| |
| setshape2 float, float, float;
| |
| setshape2(float,float,float);
| |
| setshield oldstring, float;
| |
| setshield(string,float);
| |
| setshoecolor oldstring;
| |
| setshoecolor(string);
| |
| setshootparams oldstring;
| |
| setshootparams(string);
| |
| setskincolor oldstring;
| |
| setskincolor(string);
| |
| setsleevecolor oldstring;
| |
| setsleevecolor(string);
| |
| setstring oldstring, oldstring;
| |
| setstring(string,string);
| |
| setsword oldstring, float;
| |
| setsword(string,float);
| |
| seturllevel oldstring;
| |
| seturllevel(string);
| |
| setz float, float, float, float, float, float, float, float;
| |
| setz(float,float,float,float,float,float,float,float);
| |
| setzoomeffect float;
| |
| setzoomeffect(float);
| |
| shoot float, float, float, float, float, float, oldstring, oldstring;
| |
| shoot(float,float,float,float,float,float,string,string);
| |
| shootarrow float;
| |
| shootarrow(float);
| |
| shootball;
| |
| shootball();
| |
| shootfireball float;
| |
| shootfireball(float);
| |
| shootfireblast float;
| |
| shootfireblast(float);
| |
| shootnuke float;
| |
| shootnuke(float);
| |
| show;
| |
| show();
| |
| showani float, float, float, float, oldstring;
| |
| showani(float,float,float,float,string);
| |
| showani2 float, float, float, float, float, oldstring;
| |
| showani2(float,float,float,float,float,string);
| |
| showcharacter;
| |
| showcharacter();
| |
| showfile oldstring;
| |
| showfile(string);
| |
| showimg float, oldstring, float, float;
| |
| showimg(float,string,float,float);
| |
| showimg2 float, oldstring, float, float, float;
| |
| showimg2(float,string,float,float,float);
| |
| showlocal;
| |
| showlocal();
| |
| | |
| showpoly float, float;
| |
| showpoly(float,array);
| |
| showpoly2 float, float;
| |
| showpoly2(float,array);
| |
| showstats float;
| |
| showstats(float);
| |
| showtext float, float, float, oldstring, oldstring, oldstring;
| |
| showtext(float,float,float,string,string,string);
| |
| showtext2 float, float, float, float, oldstring, oldstring, oldstring;
| |
| showtext2(float,float,float,float,string,string,string);
| |
| sleep float;
| |
| sleep(float);
| |
| spyfire float, float;
| |
| spyfire(float,float);
| |
| stopmidi;
| |
| stopmidi();
| |
| stopsound oldstring;
| |
| stopsound(string);
| |
| take oldstring;
| |
| take(string);
| |
| take2 float;
| |
| take2(float);
| |
| takehorse float;
| |
| takehorse(float);
| |
| takeplayercarry;
| |
| takeplayercarry();
| |
| takeplayerhorse;
| |
| takeplayerhorse();
| |
| throwcarry;
| |
| throwcarry();
| |
| timereverywhere;
| |
| timereverywhere();
| |
| timershow;
| |
| timershow();
| |
| toinventory oldstring;
| |
| toinventory(string);
| |
| tokenize oldstring;
| |
| tokens = string.tokenize();
| |
| tokenize2 oldstring, oldstring;
| |
| tokens = string.tokenize(" ," @ string);
| |
| toweapons oldstring;
| |
| toweapons(string);
| |
| triggeraction float, float, oldstring, oldstring;
| |
| triggeraction(float,float,string,string);
| |
| unfreezeplayer;
| |
| unfreezeplayer();
| |
| unset oldstring;
| |
| unset(string);
| |
| updateboard float, float, float, float;
| |
| updateboard(float,float,float,float);
| |
| updateterrain;
| |
| updateterrain();
| |
| wraptext float, oldstring, oldstring;
| |
| tokens = wraptext(float," ," @ string,string);
| |
| wraptext2 float, float, oldstring, oldstring;
| |
| tokens = wraptext2(float,float," ," @ string,string);
| |
| | |
| 1.3. Supported old scripting functions & their mapping to new script
| |
| | |
| 1.4. Supported old string operations
| |
| | |
| These old string operators can be used in string parameters
| |
| for the old commands, also you can use them directly as operators, e.g.
| |
| #c = "hello"
| |
| is actually doing
| |
| player.chat = "hello"
| |
| | |
| #a player.account
| |
| #a(float) players[float].account
| |
| #m player.ani
| |
| ani
| |
| #m(float) players[float].ani
| |
| #K(float) ascii(float)
| |
| #8 player.bodyimg
| |
| bodyimg
| |
| #8(float) players[float].bodyimg
| |
| #c player.chat
| |
| chat
| |
| #c(float) players[float].chat
| |
| #C0 player.colors[0]
| |
| colors[0]
| |
| #C0(float) players[float].colors[0]
| |
| #C1 player.colors[1]
| |
| colors[1]
| |
| #C1(float) players[float].colors[1]
| |
| #C2 player.colors[2]
| |
| colors[2]
| |
| #C2(float) players[float].colors[2]
| |
| #C3 player.colors[3]
| |
| colors[3]
| |
| #C3(float) players[float].colors[3]
| |
| #C4 player.colors[4]
| |
| colors[4]
| |
| #C4(float) players[float].colors[4]
| |
| #C5 player.colors[5]
| |
| colors[5]
| |
| #C5(float) players[float].colors[5]
| |
| #D downloadfile()
| |
| #E emoticonchar()
| |
| #e(float,float,oldstring)
| |
| string.substring(float,float)
| |
| #g player.guild
| |
| guild
| |
| #g(float) players[float].guild
| |
| #3 player.headimg
| |
| headimg
| |
| #3(float) players[float].headimg
| |
| #5 player.horseimg
| |
| horseimg
| |
| #5(float) players[float].horseimg
| |
| #k(float) keyname(float)
| |
| #L player.level
| |
| #I(oldstring,float)
| |
| getstring(string)[float]
| |
| #n player.nick
| |
| nick
| |
| #n(float) players[float].nick
| |
| #f image
| |
| #f(float) npcs[float].image
| |
| #F level
| |
| #p(float) params[float]
| |
| #P(float) player.attr[float]
| |
| attr[float]
| |
| #P(float,float)
| |
| players[float].attr[float]
| |
| #P1 player.attr[1]
| |
| attr[1]
| |
| #P1(float) players[float].attr[1]
| |
| #P2 player.attr[2]
| |
| attr[2]
| |
| #P2(float) players[float].attr[2]
| |
| #P3 player.attr[3]
| |
| attr[3]
| |
| #P3(float) players[float].attr[3]
| |
| #P4 player.attr[4]
| |
| attr[4]
| |
| #P4(float) players[float].attr[4]
| |
| #P5 player.attr[5]
| |
| attr[5]
| |
| #P5(float) players[float].attr[5]
| |
| #P6 player.attr[6]
| |
| attr[6]
| |
| #P6(float) players[float].attr[6]
| |
| #P7 player.attr[7]
| |
| attr[7]
| |
| #P7(float) players[float].attr[7]
| |
| #P8 player.attr[8]
| |
| attr[8]
| |
| #P8(float) players[float].attr[8]
| |
| #P9 player.attr[9]
| |
| attr[9]
| |
| #P9(float) players[float].attr[9]
| |
| #R(oldstring) string.random()
| |
| #2 player.shieldimg
| |
| shieldimg
| |
| #2(float) players[float].shieldimg
| |
| #s(oldstring) getstring(string)
| |
| #1 player.swordimg
| |
| swordimg
| |
| #1(float) players[float].swordimg
| |
| #S player.sword.script
| |
| #t(float) tokens[float]
| |
| #T(oldstring) string.trim()
| |
| #v(float) float
| |
| #W player.weapon.icon
| |
| #W(float) weapons[float].icon
| |
| #w player.weapon.script
| |
| #w(float) weapons[float].script
| |
| | |
| Compatibility note:
| |
| When you use the command setcharprop then the first parameter
| |
| is handled differently: instead of changing 'player.chat' it
| |
| is changing 'chat', the chat text of the npc. So 'setcharprop #c,hello'
| |
| would be translated into
| |
| chat = "hello"
| |
| while 'setplayerprop #c,hello' is translated into
| |
| player.chat = "hello"
| |
| In the list above both possibilities are listed.
| |
| | |
| | |
| 2. Basics
| |
| | |
| 2.1. Operators
| |
| | |
| Addition a + b
| |
| Substraction a - b
| |
| Mulitplication a * b
| |
| Division a / b
| |
| Modulus a % b
| |
| Power a ^ b
| |
| String Concationation a @ b
| |
| Bool-And a && b
| |
| Bool-Or a || b
| |
| Bool-Not !a
| |
| Negative -a
| |
| Equal a == b
| |
| Not-Equal a != b
| |
| Less a < b
| |
| Greater a > b
| |
| Less-Equal a <= b, a =< b
| |
| Greater-Equal a >= b, a => b
| |
| In-Range a in <b,c>, a in |b,c>, a in <b,c|, a in |b,c|
| |
| In-Array a in {b,c,...}, {a,b,...} in {c,d,...}
| |
| Array-Constructor {a,b,...}
| |
| Empty Array new [count]
| |
| Array Member a[index]
| |
| Function call a(), a(b,c,...)
| |
| Object Attribute a.b, a.(b)
| |
| Post Increment a++
| |
| Post Decrement a--
| |
| Pre Increment ++a
| |
| Pre Decrement --a
| |
| Old String Function #a
| |
| Conditional a? b : c
| |
| Assignment a = b, a := b
| |
| Additive Assignment a += b
| |
| Substractive Assignment a -= b
| |
| Multiplicative Assignment a *= b
| |
| Division Assignment a /= b
| |
| Modulus Assignment a %= b
| |
| Power Assignment a ^= b
| |
| String Append a @= b
| |
| | |
| 2.2. Accessing variables
| |
| | |
| Graal Script variables are 'variant', that means they are objects | |
| that hold values of different types.
| |
| When you assign a value to the variable then it automatically
| |
| switches to the right type:
| |
| | |
| Numeric (floating point):
| |
| var = 1;
| |
| String:
| |
| var = "hello";
| |
| Object link:
| |
| var = player;
| |
| Array (list of objects):
| |
| var = {1,2,3};
| |
| | |
| You can check the current type with the
| |
| type()-function - obj.type() returns
| |
| 0,1,2,3 for numeric, string, object or array.
| |
| | |
| 2.3. Standard object functions
| |
| | |
| obj.name
| |
| obj.type() - gets the type of the var (float 0, string 1, object 2, array 3)
| |
| obj.length() - string length
| |
| obj.trim()
| |
| obj.tokenize([delimiters])
| |
| obj.charat(pos)
| |
| obj.pos(substring)
| |
| obj.beginswith(string)
| |
| obj.endson(string)
| |
| obj.substring(index[,length])
| |
| obj.size() - array length
| |
| obj.index(obj2) - position of obj2 in the array
| |
| obj.clear()
| |
| obj.add(obj2)
| |
| obj.delete(index)
| |
| obj.remove(obj2)
| |
| obj.replace(index,obj2)
| |
| obj.insert(index,obj2)
| |
| obj.getvarnames() - list of the object attributes
| |
| obj.geteditvarnames()
| |
| obj.loadstring(filename)
| |
| obj.loadlines(filename)
| |
| obj.loadvars(filename)
| |
| obj.savestring(filename,mode)
| |
| obj.savelines(filename,mode)
| |
| obj.savevars(filename,mode)
| |
| | |
| 2.2.1. NPCs
| |
| | |
| npc.actionplayer - integer, read only
| |
| npc.ani - object, read only
| |
| npc.anistep - integer, read only
| |
| npc.ap - integer
| |
| npc.attr - array
| |
| npc.attached - boolean, read only
| |
| npc.attachid - integer, read only
| |
| npc.attachtype - integer, read only
| |
| npc.body - object
| |
| npc.bodyimg - string
| |
| npc.bombs - integer
| |
| npc.chat - string
| |
| npc.colors - array
| |
| npc.darts - integer
| |
| npc.dir - integer
| |
| npc.glovepower - integer
| |
| npc.gralats - integer
| |
| npc.head - object
| |
| npc.headimg - string
| |
| npc.headset - integer
| |
| npc.hearts - floating point value, better use npc.hp
| |
| npc.height - floating point value, read only
| |
| npc.horseimg - string
| |
| npc.hp - floating point value
| |
| npc.hurtdx - floating point value
| |
| npc.hurtdy - floating point value
| |
| npc.id - integer, read only
| |
| npc.isfemale - boolean, read only
| |
| npc.ismale - boolean, read only
| |
| npc.isweapon - boolean, read only
| |
| npc.layer - integer
| |
| npc.mp - integer
| |
| npc.nick - string
| |
| npc.peltwithnpc - boolean, read only
| |
| npc.peltwithbush - boolean, read only
| |
| npc.peltwithsign - boolean, read only
| |
| npc.peltwithvase - boolean, read only
| |
| npc.peltwithstone - boolean, read only
| |
| npc.peltwithblackstone - boolean, read only
| |
| npc.rupees - integer, better use npc.gralats
| |
| npc.shield - object
| |
| npc.shieldimg - string
| |
| npc.shieldpower - integer
| |
| npc.sprite - integer
| |
| npc.sword - object
| |
| npc.swordimg - string
| |
| npc.swordpower - integer
| |
| npc.timeout - floating point value
| |
| npc.visible - boolean
| |
| npc.width - floating point value, read only
| |
| npc.x - floating point value
| |
| npc.y - floating point value
| |
| npc.z - floating point value
| |
| | |
| npc.blockagain()
| |
| npc.blockagainlocal()
| |
| npc.canbecarried()
| |
| npc.cannotbecarried()
| |
| npc.canbepushed()
| |
| npc.cannotbepushed()
| |
| npc.canbepulled()
| |
| npc.cannotbepulled()
| |
| npc.carryobject(name)
| |
| npc.catchevent(object name,event,function)
| |
| npc.changeimgcolors(index,red,green,blue,alpha)
| |
| npc.changeimgmode(index,mode)
| |
| npc.changeimgpart(index,x,y,width,height)
| |
| npc.changeimgvis(index,layer)
| |
| npc.changeimgzoom(index,zoom factor)
| |
| npc.destroy()
| |
| npc.dontblock()
| |
| npc.dontblocklocal()
| |
| npc.drawaslight()
| |
| npc.drawoverplayer()
| |
| npc.drawunderplayer()
| |
| npc.getimageforsprite(sprite) - returns image
| |
| npc.getsprite(string) - returns sprite
| |
| npc.getspriteforspritepos(spritepos) - returns sprite
| |
| npc.hide()
| |
| npc.hidelocal()
| |
| npc.hideimg(index)
| |
| npc.hideimgs(startindex,endindex)
| |
| npc.hurt(power)
| |
| npc.ignoreevent(object name,event)
| |
| npc.ignoreevents(object name)
| |
| npc.lay(item name)
| |
| npc.message(text)
| |
| npc.move(delta x,delta y,time,options)
| |
| npc.setbow(image name)
| |
| npc.setcharani(ani name,parameters)
| |
| npc.setchargender("male" or "female")
| |
| npc.setcoloreffect(red,green,blue,alpha)
| |
| npc.seteffectmode(mode)
| |
| npc.setimg(image name)
| |
| npc.setimgpart(image name,x,y,width,height)
| |
| npc.setshape(type,pixelwidth,pixelheight)
| |
| npc.setshape2(tilewidth,tileheight,tilearray)
| |
| npc.setzoomeffect(zoom factor)
| |
| npc.shootarrow(direction)
| |
| npc.shootball()
| |
| npc.shootfireball(direction)
| |
| npc.shootfireblast(direction)
| |
| npc.shootnuke(direction)
| |
| npc.show()
| |
| npc.showani(index,x,y,direction,ani name,parameters)
| |
| npc.showani2(index,x,y,z,direction,ani name,parameters)
| |
| npc.showcharacter()
| |
| npc.showimg(index,image name,x,y)
| |
| npc.showimg2(index,image name,x,y,z)
| |
| npc.showlocal()
| |
| npc.showpoly(index,array)
| |
| npc.showpoly2(index,array)
| |
| npc.showtext(index,x,y,font,style,text)
| |
| npc.showtext2(index,x,y,z,font,style,text)
| |
| npc.take(item name)
| |
| npc.take2(item index)
| |
| npc.takehorse(horse index)
| |
| npc.throwcarry()
| |
| npc.timereverywhere()
| |
| npc.timershow()
| |
| npc.toweapons(weapon name)
| |
| | |
| | |
| 2.2.2. Players
| |
| | |
| player.account - string, read only
| |
| player.ani - object, read only
| |
| player.anistep - integer, read only
| |
| player.ap - integer
| |
| player.attached - boolean, read only
| |
| player.attachid - integer, read only
| |
| player.attachtype - integer, read only
| |
| player.attr - array
| |
| player.body - object
| |
| player.bodyimg - string
| |
| player.bombs - integer
| |
| player.chat - string
| |
| player.colors - array
| |
| player.darts - integer
| |
| player.dir - integer
| |
| player.freezetime - floating point value, only valid for local players
| |
| player.fullhearts - integer, read only, better use player.maxhp
| |
| player.glovepower - integer
| |
| player.gralats - integer
| |
| player.head - object
| |
| player.headimg - string
| |
| player.headset - integer
| |
| player.hearts - floating point value, only editable for local players, better use player.hp
| |
| player.horseimg - string, only editable for local players
| |
| player.hp - floating point value, only editable for local players
| |
| player.hurt - boolean, read only, only valid for local players
| |
| player.hurtdx - floating point value, read only, only valid for local players
| |
| player.hurtdy - floating point value, read only, only valid for local players
| |
| player.hurted - boolean, read only, only valid for local players, better use player.hurt
| |
| player.hurtpower - floating point value, read only, only valid for local players
| |
| player.id - integer, read only
| |
| player.isfemale - boolean, read only
| |
| player.ismale - boolean, read only
| |
| player.letters - object, only valid for local players
| |
| player.level - object, read only
| |
| player.map - boolean, only valid for local players
| |
| player.maxhp - integer, read only
| |
| player.mp - integer
| |
| player.nick - string, read only for local players
| |
| player.onhorse - boolean, read only, only valid for local players
| |
| player.online - boolean, read only, only valid for local players
| |
| player.paused - boolean, read only, only valid for local players
| |
| player.reading - boolean, read only, only valid for local players
| |
| player.rupees - integer, better use player.gralats
| |
| player.shield - object
| |
| player.shieldimg - string
| |
| player.shieldpower - integer, read only
| |
| player.sprite - integer
| |
| player.swimming - boolean, read only, only valid for local players
| |
| player.sword - object
| |
| player.swordimg - string
| |
| player.swordpower - integer, read only
| |
| player.weapon - object, read only, only valid for local players
| |
| player.weapons - array, read only, only valid for local players
| |
| player.x - floating point value
| |
| player.y - floating point value
| |
| player.z - floating point value
| |
| | |
| player.getimageforsprite(sprite) - returns object
| |
| player.getsprite(string) - returns object
| |
| player.getspriteforspritepos(spritepos) - returns object
| |
| | |
| | |
| 2.2.3. Levels
| |
| 2.2.4. Ganis
| |
| | |
| e.g. player.ani
| |
| ani.name
| |
| ani.sprites[]
| |
| ani.steps[]
| |
| ani.continuous
| |
| ani.singledirection
| |
| ani.looping
| |
| ani.ismovie
| |
| ani.setbackto
| |
| ani.ganitype
| |
| ani.getsprite(id)
| |
| ani.addsprite(id) returns the added sprite
| |
| ani.deletesprite(id)
| |
| ani.addstep()
| |
| ani.insertstep(index)
| |
| ani.deletestep(index)
| |
| | |
| sprites:
| |
| sprite.spriteindex
| |
| sprite.image
| |
| sprite.imagetype
| |
| sprite.x
| |
| sprite.y
| |
| sprite.width
| |
| sprite.height
| |
| sprite.red
| |
| sprite.green
| |
| sprite.blue
| |
| sprite.alpha
| |
| sprite.zoom
| |
| sprite.mode
| |
| sprite.surface
| |
| sprite.attachments[]
| |
| sprite.addattachment()
| |
| sprite.insertattachment(index)
| |
| sprite.deleteattachment(index)
| |
| | |
| attachment:
| |
| attachment.sprite
| |
| attachment.dx
| |
| attachment.dy
| |
| attachment.behind
| |
| | |
| step:
| |
| step.spritespos[][]
| |
| step.sounds[]
| |
| step.delay
| |
| step.addpos(dir)
| |
| step.insertpos(dir,index)
| |
| step.deletepos(dir,index)
| |
| | |
| spritepos:
| |
| spritepos.sprite
| |
| spritepos.param
| |
| spritepos.attr
| |
| spritepos.dx
| |
| spritepos.dy
| |
| | |
| sound:
| |
| sound.sound
| |
| sound.dx
| |
| sound.dy
| |
| sound.delay
| |
| | |
| also the gani owners (players, npcs) have those functions:
| |
| getimageforsprite(sprite)
| |
| getsprite(string)
| |
| getspriteforspritepos(spritepos)
| |
| | |
| | |
| 2.5. Standard functions
| |
| | |
| format(format,parameters,...) - formats a "%s %d" string, inserts the parameters, and returns a string
| |
| int(a)
| |
| abs(a)
| |
| random(rangestart,rangeend)
| |
| sin(a)
| |
| cos(a)
| |
| arctan(a)
| |
| exp(a)
| |
| log(base,a)
| |
| min(a,b)
| |
| max(a,b)
| |
| getangle(delta x,delta y)
| |
| getdir(delta x,delta y)
| |
| vecx(direction)
| |
| vecy(direction)
| |
| | |
| 2.4. Standard variables
| |
| | |
| 3. GUI
| |
| | |
| 3.1. GUI controls
| |
| | |
| 3.2. GUI events
| |
| | |
| All controls:
| |
| onAdd() when added to the parent
| |
| onRemove() when removed from the parent
| |
| onWake() when activated
| |
| onSleep() when deactivated
| |
| onResize(w,h)
| |
| onMove(x,y)
| |
| onMouseEnter(modifier,x,y,clickcount)
| |
| onMouseLeave(modifier,x,y,clickcount)
| |
| onMouseDown(modifier,x,y,clickcount)
| |
| onMouseUp(modifier,x,y,clickcount)
| |
| onMouseDragged(modifier,x,y,clickcount)
| |
| onMouseMove(modifier,x,y,clickcount)
| |
| onRightMouseDown(modifier,x,y,clickcount)
| |
| onRightMouseUp(modifier,x,y,clickcount)
| |
| onRightMouseDragged(modifier,x,y,clickcount)
| |
| onMouseWheelUp(modifier,x,y,clickcount)
| |
| onMouseWheelDown(modifier,x,y,clickcount)
| |
| onKeyDown(keycode,string)
| |
| onKeyUp(keycode,string)
| |
| onKeyRepeat(keycode,string)
| |
| | |
| GuiMLTextCtrl:
| |
| onResize(w,h) when reflowing
| |
| onURL(url) when clicked on url
| |
| | |
| GuiTextEditCtrl:
| |
| onTabComplete()
| |
| onAction(text) when return key pressed
| |
| | |
| GuiTextListCtrl:
| |
| onSelect(id,text) when row selected
| |
| onDblClick(id) when double-click on row or return key pressed
| |
| onDeleteKey(id) when delete key pressed
| |
| onIconResized(w,h) when setIconSize() called
| |
| onOpenMenu(0,index,text) when an item was right-clicked
| |
| | |
| GuiPopUpMenuCtrl:
| |
| onSelect(id,text) when menu option choosen
| |
| onCancel() when menu is closed without action
| |
| onOpenMenu(0,index,text) when an item was right-clicked
| |
| | |
| GuiMenuBar:
| |
| onMenuSelect(menuid,menutext)
| |
| onMenuItemSelect(menuid,menutext,itemid,itemtext)
| |
| | |
| GuiTreeViewCtrl:
| |
| onSelect(id,rightmouse) when row selected
| |
| onUnselect(id) when row de-selected
| |
| onInspect(id) when clicked on the name of an item
| |
| onOpenMenu(0,index,text) when an item was right-clicked
| |
| onContextMenu("x y",id) when clicked with right-mouse key on row
| |