Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting > New Scripting Engine (GS2)
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 08-24-2006, 08:30 PM
pig132 pig132 is offline
professional troll
Join Date: May 2006
Posts: 260
pig132 will become famous soon enough
onActionGrab

I dont see why this doesnt work..

NPC Code:
function onActionserverside() {
this.join("door");
}
//#CLIETNSIDE
function onActionGrab() {
triggeraction 0,0,serverside,test;
}



I also tried:
NPC Code:
//#CLIETNSIDE
function onActionGrab() {
this.join("door");
}


Could someone help me? I'm not sure what it is, but i think actiongrab is messed up, if (actiongrab) also doesnt work

Last edited by pig132; 08-24-2006 at 09:30 PM..
Reply With Quote
  #2  
Old 08-24-2006, 08:52 PM
Tolnaftate2004 Tolnaftate2004 is offline
penguin.
Join Date: Jul 2004
Location: Berkeley, CA
Posts: 534
Tolnaftate2004 is a jewel in the roughTolnaftate2004 is a jewel in the rough
Send a message via AIM to Tolnaftate2004
I'm gonna have to say it's not working because it doesn't exist.
__________________
◕‿‿◕ · pfa · check yer syntax! · src

Killa Be: when i got that locker in 6th grade the only thing in it was a picture of a midget useing a firehose :/
Reply With Quote
  #3  
Old 08-24-2006, 09:09 PM
KuJi KuJi is offline
Banned
Join Date: Apr 2004
Location: Staten Island, New York
Posts: 2,202
KuJi will become famous soon enough
Send a message via ICQ to KuJi Send a message via AIM to KuJi Send a message via MSN to KuJi Send a message via Yahoo to KuJi
The action of Grab is usually made custom. You can try something like this - it doesnt allow you to hold down A and must/should be in a timeout.

PHP Code:
  if (keydown(6))
  {
    if (
this.grab == false && player.ani == "grab")
    {
      
triggeraction(player.1.5 vecx(player.dir)*2player.1.5 vecy(player.dir)*2"grab"player.accountplayer.guild);
      
this.grab true;
    }
  }
  else 
this.grab false
Reply With Quote
  #4  
Old 08-24-2006, 09:26 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
The "grab" event is not built-in, the script wouldn't work anyway though since a triggeraction with "serverside" is for sending a trigger to a serverside weapon script.
Reply With Quote
  #5  
Old 08-24-2006, 09:43 PM
KuJi KuJi is offline
Banned
Join Date: Apr 2004
Location: Staten Island, New York
Posts: 2,202
KuJi will become famous soon enough
Send a message via ICQ to KuJi Send a message via AIM to KuJi Send a message via MSN to KuJi Send a message via Yahoo to KuJi
Also why didn't he just do join("door");
Reply With Quote
  #6  
Old 08-24-2006, 09:45 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
Quote:
Originally Posted by KuJi
Also why didn't he just do join("door");
Because this.join("door"); is nice and implies scope.
Reply With Quote
  #7  
Old 08-24-2006, 10:13 PM
KuJi KuJi is offline
Banned
Join Date: Apr 2004
Location: Staten Island, New York
Posts: 2,202
KuJi will become famous soon enough
Send a message via ICQ to KuJi Send a message via AIM to KuJi Send a message via MSN to KuJi Send a message via Yahoo to KuJi
Quote:
Originally Posted by Skyld
Because this.join("door"); is nice and implies scope.
I mean over the ENTIRE script he didnt need to trigger the server to join it x.x
Reply With Quote
  #8  
Old 08-25-2006, 10:34 AM
ApothiX ApothiX is offline
Okiesmokie
Join Date: May 2004
Posts: 1,447
ApothiX is on a distinguished road
Quote:
Originally Posted by KuJi
I mean over the ENTIRE script he didnt need to trigger the server to join it x.x
Perhaps he is using a state-approach, where he joins a class in one state, and another class in another.

Example:

PHP Code:
// CLASSES/State1
function DoSomething() {
  echo(
"Currently in State 1.");
}

function 
LeavingState() {
  echo(
"Leaving State 1");
}

function 
JoiningState() {
  echo(
"Joining State 1");

PHP Code:
// CLASSES/State2
function DoSomething() {
  echo(
"Currently in State 2.");
}

function 
LeavingState() {
  echo(
"Leaving State 2");
}

function 
JoiningState() {
  echo(
"Joining State 2");

PHP Code:
// Some Object
function onCreated() {
  
SetState(1);
}

function 
onPlayerChats() {
  if(
player.chat.starts("/changestate")) {
    
temp.state = (temp.state == 1);
    
SetState(temp.state);
  } else if(
player.chat.starts("/dosomething")) {
    
this.DoSomething();
  }
}

function 
SetState(stateNum) {
  if(
this.state in |1,2|) {
    
temp.oldstate this.state;
    
this.LeavingState();
    
this.leave("State" temp.oldstate);
  }

  
this.state stateNum;
  
this.join("State" this.state);
  
this.JoiningState();

__________________


[06:24:19] * Parts: Skyld (i=silent@unaffiliated/skyld) ("Perhaps Okiesmokie did not realise that I like the boys. ")
Reply With Quote
  #9  
Old 10-04-2006, 12:59 PM
The Evil Within The Evil Within is offline
I'm Not Chance...Really
The Evil Within's Avatar
Join Date: Aug 2004
Location: Coral Springs, Florida
Posts: 65
The Evil Within is on a distinguished road
Send a message via AIM to The Evil Within
Being that ActionGrab doesn't exist try just using the keydown command along with playertouchsme.

i.e.

function onPlayerTouchsMe() {
if (keydown(4)) {
stuff
}
}

(I'm relatively sure the #4 = D I dunno what A is, but once you find that out it should work no problem).
__________________
-CMercy

Delteria Forums
Reply With Quote
  #10  
Old 10-06-2006, 02:30 PM
Chompy Chompy is offline
¯\(º_o)/¯
Chompy's Avatar
Join Date: Sep 2006
Location: Norway
Posts: 2,815
Chompy is just really niceChompy is just really niceChompy is just really nice
Send a message via MSN to Chompy
why don't do something like:

PHP Code:
//#CLIENTSIDE
function onKeyPressed(codekey
{
  switch(
key)
  {
    case 
"a":
      
temp.gx player.1.5 vecx(player.dir) * 2;
      
temp.gy player.vecy(player.dir )* 2;
      
triggeraction(temp.gxtemp.gy"Grab"player.accountplayer.guild);
    break;
  }

PHP Code:
//#CLIENTSIDE
function onActionGrab(acctguild)
{
  
hide();
  
sleep(3);
  
show();

and with the parametres in ActionGrab(acct, guild) you can make a protection system for example
(the function "onActionGrab" can go in a class or an level npc too,
and the onKeyPressed could be added like an system, like -Grab?)
__________________
Reply With Quote
  #11  
Old 10-06-2006, 06:38 PM
xAndrewx xAndrewx is offline
Registered User
xAndrewx's Avatar
Join Date: Sep 2004
Posts: 5,260
xAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud of
You don't need to add the player's details into a triggeraction... (player.account, player.guild etc)
__________________
Reply With Quote
  #12  
Old 10-06-2006, 06:50 PM
xXziroXx xXziroXx is offline
Malorian
xXziroXx's Avatar
Join Date: May 2004
Posts: 5,289
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
Quote:
Originally Posted by xAndrewx View Post
You don't need to add the player's details into a triggeraction... (player.account, player.guild etc)
Correct, just use actionplayer to find it out.
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
  #13  
Old 10-06-2006, 07:22 PM
Twinny Twinny is offline
My empire of dirt
Twinny's Avatar
Join Date: Mar 2006
Location: Australia
Posts: 2,422
Twinny is just really niceTwinny is just really nice
Send a message via AIM to Twinny
Quote:
Originally Posted by pig132 View Post
//#CLIETNSIDE
No-one seemed to notice but i'm sure spelling clientside wrong doesn't help.
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 05:54 AM.


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