Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 01-25-2005, 03:07 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
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()

__________________
Skyld

Last edited by Skyld; 01-25-2005 at 03:52 PM..
Reply With Quote
  #2  
Old 01-25-2005, 04:46 PM
Admins Admins is offline
Graal Administration
Join Date: Jan 2000
Location: Admins
Posts: 11,693
Admins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud of
It should
Reply With Quote
  #3  
Old 01-27-2005, 06:54 PM
Gman4pwnu Gman4pwnu is offline
Banned
Join Date: Jan 2004
Posts: 434
Gman4pwnu is on a distinguished road
Send a message via AIM to Gman4pwnu
How do you use gscript 2?
Reply With Quote
  #4  
Old 01-27-2005, 07:09 PM
CheeToS2 CheeToS2 is offline
That Guy
CheeToS2's Avatar
Join Date: Dec 2001
Location: Seattle, WA
Posts: 2,528
CheeToS2 will become famous soon enough
Send a message via AIM to CheeToS2
Quote:
Originally Posted by Gman4pwnu
How do you use gscript 2?
At the moment, it needs to be enabled on your server.
__________________

Reply With Quote
  #5  
Old 01-28-2005, 06:01 PM
TB3 TB3 is offline
Registered User
TB3's Avatar
Join Date: May 2001
Location: US of A State of VA
Posts: 658
TB3 is on a distinguished road
Send a message via Yahoo to TB3
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
__________________

To the sun of your age, I arise
Reply With Quote
  #6  
Old 01-28-2005, 07:33 PM
CheeToS2 CheeToS2 is offline
That Guy
CheeToS2's Avatar
Join Date: Dec 2001
Location: Seattle, WA
Posts: 2,528
CheeToS2 will become famous soon enough
Send a message via AIM to CheeToS2
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.
__________________

Reply With Quote
  #7  
Old 01-28-2005, 08:47 PM
Benm00t Benm00t is offline
I made a tree!
Benm00t's Avatar
Join Date: Jul 2003
Location: The Intarwebbernetwork!
Posts: 987
Benm00t is on a distinguished road
Are you able to use GScript2 offline?
__________________
Lag is a good thing. Only those without it complain.

~ Ben
Reply With Quote
  #8  
Old 01-28-2005, 09:37 PM
EikeSiewertsen EikeSiewertsen is offline
Fry
EikeSiewertsen's Avatar
Join Date: Apr 2001
Location: Germany
Posts: 64
EikeSiewertsen is on a distinguished road
Send a message via ICQ to EikeSiewertsen
Quote:
Originally Posted by Benm00t
Are you able to use GScript2 offline?
No.
__________________
Graal Wiki - Graal Forum
Reply With Quote
  #9  
Old 01-29-2005, 12:38 AM
Rick Rick is offline
PipBoy Extraordinaire!
Rick's Avatar
Join Date: Jul 2004
Location: Long Beach, California.
Posts: 831
Rick is on a distinguished road
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;
}

Reply With Quote
  #10  
Old 01-29-2005, 06:51 AM
Nappa Nappa is offline
The Great Nappa
Nappa's Avatar
Join Date: Sep 2003
Location: Florida
Posts: 1,911
Nappa is on a distinguished road
Send a message via AIM to Nappa
Gscript2 looks confoosing.
__________________
Reply With Quote
  #11  
Old 01-29-2005, 12:59 PM
JudgeDurst JudgeDurst is offline
Malorian
JudgeDurst's Avatar
Join Date: Jan 2002
Posts: 145
JudgeDurst is on a distinguished road
Gscript2 looks useful
__________________
MrWorry, Lover of Maloria
Reply With Quote
  #12  
Old 01-29-2005, 04:43 PM
Malinko Malinko is offline
Unholy Nation
Join Date: Mar 2004
Location: Massachusetts, U.S.A.
Posts: 1,782
Malinko is on a distinguished road
Send a message via AIM to Malinko
GScript2 makes so much more sense.
Reply With Quote
  #13  
Old 01-30-2005, 03:50 AM
Alexander Alexander is offline
Registered User
Join Date: Apr 2003
Location: California
Posts: 246
Alexander is on a distinguished road
Send a message via AIM to Alexander
Malinko quit spamming
Reply With Quote
  #14  
Old 01-30-2005, 03:59 AM
falco10291029 falco10291029 is offline
BEst User EVER!
Join Date: Apr 2004
Posts: 1,186
falco10291029 is on a distinguished road
It looks more organized but like it wil ltake a bit longer to learn
__________________
BEst Insult ever: If I had a dollar for every brain you DIDNT have, i'd have one dollar!
Reply With Quote
  #15  
Old 01-30-2005, 03:26 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
It is suprisingly easy to get used to. I'll have to take a look at the DB NPC triggeractioning later again.
__________________
Skyld
Reply With Quote
  #16  
Old 01-31-2005, 06:01 PM
TB3 TB3 is offline
Registered User
TB3's Avatar
Join Date: May 2001
Location: US of A State of VA
Posts: 658
TB3 is on a distinguished road
Send a message via Yahoo to 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.
__________________

To the sun of your age, I arise
Reply With Quote
  #17  
Old 01-31-2005, 09:58 PM
ApothiX ApothiX is offline
Okiesmokie
Join Date: May 2004
Posts: 1,447
ApothiX is on a distinguished road
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.
__________________


[06:24:19] * Parts: Skyld (i=silent@unaffiliated/skyld) ("Perhaps Okiesmokie did not realise that I like the boys. ")
Reply With Quote
  #18  
Old 02-01-2005, 02:29 AM
Curt1zzle Curt1zzle is offline
Starting not to love you
Curt1zzle's Avatar
Join Date: Sep 2003
Posts: 3,669
Curt1zzle has a spectacular aura about
Send a message via AIM to Curt1zzle
With GScript2 Enabled, does the server recognize GScript 1 commands as well?
__________________

This message has been deleted by Sam. Reason: you should better stop it now
Reply With Quote
  #19  
Old 02-01-2005, 02:34 AM
Ajira Ajira is offline
Poont.
Join Date: Oct 2004
Location: NY, USA
Posts: 477
Ajira is on a distinguished road
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.
Reply With Quote
  #20  
Old 01-31-2005, 07:05 AM
zokemon zokemon is offline
That one guy...
zokemon's Avatar
Join Date: Mar 2001
Location: Sonoma County, California
Posts: 2,925
zokemon is a jewel in the roughzokemon is a jewel in the rough
Send a message via ICQ to zokemon Send a message via AIM to zokemon Send a message via MSN to zokemon Send a message via Yahoo to zokemon
Gs2 is much easier to use then Gs1 and I have been using Gs1 for 4 or so years
__________________
Do it with a DON!
Reply With Quote
  #21  
Old 01-31-2005, 07:47 PM
Slash-P2P Slash-P2P is offline
Banned
Join Date: May 2004
Location: Burning Blade
Posts: 941
Slash-P2P is on a distinguished road
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.
Reply With Quote
  #22  
Old 01-31-2005, 10:06 PM
falco10291029 falco10291029 is offline
BEst User EVER!
Join Date: Apr 2004
Posts: 1,186
falco10291029 is on a distinguished road
Yeah I still wish I had some way to begin learning GS2
__________________
BEst Insult ever: If I had a dollar for every brain you DIDNT have, i'd have one dollar!
Reply With Quote
  #23  
Old 02-04-2005, 04:25 AM
Projectshifter Projectshifter is offline
The David
Projectshifter's Avatar
Join Date: Apr 2002
Location: USA
Posts: 912
Projectshifter is an unknown quantity at this point
Send a message via ICQ to Projectshifter Send a message via AIM to Projectshifter Send a message via MSN to Projectshifter Send a message via Yahoo to Projectshifter
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.
__________________
Who has time for life these days?
Reply With Quote
  #24  
Old 02-04-2005, 04:36 AM
Admins Admins is offline
Graal Administration
Join Date: Jan 2000
Location: Admins
Posts: 11,693
Admins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud of
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).
Reply With Quote
  #25  
Old 04-08-2005, 05:15 PM
Bartjuh1992 Bartjuh1992 is offline
Banned
Bartjuh1992's Avatar
Join Date: Nov 2004
Location: Netherlands
Posts: 79
Bartjuh1992 is on a distinguished road
Send a message via ICQ to Bartjuh1992 Send a message via AIM to Bartjuh1992 Send a message via MSN to Bartjuh1992 Send a message via Yahoo to Bartjuh1992
its still hard to learn it yust went better at gscript1 ahh well atleast if used gscript1 in my graallife
Reply With Quote
Reply


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 09:22 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.