Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Gscript2 Triggeractions (https://forums.graalonline.com/forums/showthread.php?t=57307)

Skyld 01-25-2005 03:07 PM

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:
function onActionname() {


NPC Code:
function onname() {


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()


Admins 01-25-2005 04:46 PM

It should

Gman4pwnu 01-27-2005 06:54 PM

How do you use gscript 2?

CheeToS2 01-27-2005 07:09 PM

Quote:

Originally Posted by Gman4pwnu
How do you use gscript 2?

At the moment, it needs to be enabled on your server.

TB3 01-28-2005 06:01 PM

Quote:

Originally Posted by CheeToS2
At the moment, it needs to be enabled on your server.

Then a more suited question is how do you have it enabled for your server :)

CheeToS2 01-28-2005 07:33 PM

Quote:

Originally Posted by TB3
Then a more suited question is how do you have it enabled for your server :)

Only a few servers have it; Stefan has to make the necessary changes.

Benm00t 01-28-2005 08:47 PM

Are you able to use GScript2 offline?

EikeSiewertsen 01-28-2005 09:37 PM

Quote:

Originally Posted by Benm00t
Are you able to use GScript2 offline?

No.

Rick 01-29-2005 12:38 AM

A snippet from a DB-NPC I made awhile ago: (uses gscript1 for clientside, 2.x compatible)

NPC Code:
function onCreated()
{
this.setshape(1, 32, 32);
}

function onActionChat(text)
{
message("You said: " @ text);
}

//#CLIENTSIDE
if (playerchats) {
triggeraction x+1,y+1,chat,#c;
}


Nappa 01-29-2005 06:51 AM

Gscript2 looks confoosing. :(

JudgeDurst 01-29-2005 12:59 PM

Gscript2 looks useful ^^

Malinko 01-29-2005 04:43 PM

GScript2 makes so much more sense.

Alexander 01-30-2005 03:50 AM

Malinko quit spamming

falco10291029 01-30-2005 03:59 AM

It looks more organized but like it wil ltake a bit longer to learn

Skyld 01-30-2005 03:26 PM

It is suprisingly easy to get used to. I'll have to take a look at the DB NPC triggeractioning later again.

zokemon 01-31-2005 07:05 AM

Gs2 is much easier to use then Gs1 and I have been using Gs1 for 4 or so years

TB3 01-31-2005 06:01 PM

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.

Slash-P2P 01-31-2005 07:47 PM

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.

ApothiX 01-31-2005 09:58 PM

Quote:

Originally Posted by TB3
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.

Right now the documentation is very cryptic. While some things are self-explanitory, some things need a lot of trial and error testing, because it only gives the datatypes of the parameters of functions, not a description of them.

falco10291029 01-31-2005 10:06 PM

Yeah I still wish I had some way to begin learning GS2 :(

Curt1zzle 02-01-2005 02:29 AM

With GScript2 Enabled, does the server recognize GScript 1 commands as well?

Ajira 02-01-2005 02:34 AM

Quote:

Originally Posted by Curt1zzle
With GScript2 Enabled, does the server recognize GScript 1 commands as well?

Some of them it does, but it will give you an error in RC for the ones it does not.

Projectshifter 02-04-2005 04:25 AM

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. :)

Admins 02-04-2005 04:36 AM

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).

Bartjuh1992 04-08-2005 05:15 PM

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.