![]() |
Gscript2 Triggeractions
Right, I'm having a little trouble with triggeractions in Gscript2, mainly because I can't work out how to receive the action.
I thought it might be one of the following: NPC Code: NPC Code: Neither of these appear to work, and it does not appear to be documented. Does anyone know how the action is received? Edit It appears that with weapons, it is received using onActionserverside() if I use serverside as the actionname, but with a database NPC, it fails. I have set the shape with: NPC Code:function onCreated() setshape(1,32,32); And triggeraction'd with: NPC Code:triggeraction(x+0.5,y+0.5,"lol","magic","please"); However, receiving using this method does not work: NPC Code:function onActionlol() |
It should
|
How do you use gscript 2?
|
Quote:
|
Quote:
|
Quote:
|
Are you able to use GScript2 offline?
|
Quote:
|
A snippet from a DB-NPC I made awhile ago: (uses gscript1 for clientside, 2.x compatible)
NPC Code:function onCreated() |
Gscript2 looks confoosing. :(
|
Gscript2 looks useful ^^
|
GScript2 makes so much more sense.
|
Malinko quit spamming
|
It looks more organized but like it wil ltake a bit longer to learn
|
It is suprisingly easy to get used to. I'll have to take a look at the DB NPC triggeractioning later again.
|
Gs2 is much easier to use then Gs1 and I have been using Gs1 for 4 or so years
|
I hope gs2 has better documentation (Mainly for usability) than gs1 , gs1's best documentation didn't come until way to l8 and most of it was best done by the community.
|
For me, making the switch to GS2 from GS1 (which I have been using for about 5 years), was easier than I thought. I think GScript1 is easy but I guess GScript2 makes the language easier to read so people new to it can understand it.
|
Quote:
|
Yeah I still wish I had some way to begin learning GS2 :(
|
With GScript2 Enabled, does the server recognize GScript 1 commands as well?
|
Quote:
|
The problem probably lies in your weapon has a space in it. I had problems with it myself when we were testing it as it was developed > 1 year ago or so. triggeraction(0,0,"serverside","Weapon name","params"); doesn't quite work because "weapon name" is two words. Unless it's changed, but it used to only take 1 word probably. Odds are also you're trying triggeraction(0,0,serverside,weaponname,params) and the problem lies in by doing it this way it reads serverside,weaponname, and params all as variables rather than real text. Like any good language quotes denote realtext for the most part. :)
|
Hmmm the triggeraction problems with space in the parameters should be fixed. There is still some problem with getnpc(npcname with space in it) I think.
I will try to package some example scripts when I get some time. The function list is complete because it is generated by the program itself (client or npcserver, with -listscriptfunctions option in >=v3.15). |
its still hard to learn it :( yust went better at gscript1 ahh well atleast if used gscript1 in my graallife :)
|
| All times are GMT +2. The time now is 07:07 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.