Graal Forums  

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

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 12-29-2007, 05:24 AM
Knightmare1 Knightmare1 is offline
Billy Allan
Knightmare1's Avatar
Join Date: Apr 2007
Posts: 804
Knightmare1 can only hope to improve
Grabbing of floor?

is there a way to do add items (guns, items, etc.) that are lying on the ground? would i have to make it like this? and so it dissapears.
PHP Code:
//#CLIENTSIDE
function onActionGrab() {
  
clientr.weapon.? = 1;
  
destroy;

__________________
I am the devil, I am here to do to devils work.
Reply With Quote
  #2  
Old 12-29-2007, 05:35 AM
Codein Codein is offline
jwd
Codein's Avatar
Join Date: Oct 2005
Location: Greater Manchester
Posts: 2,423
Codein has a spectacular aura aboutCodein has a spectacular aura about
Send a message via AIM to Codein Send a message via MSN to Codein
Quote:
Originally Posted by Knightmare1 View Post
is there a way to do add items (guns, items, etc.) that are lying on the ground? would i have to make it like this? and so it dissapears.
PHP Code:
//#CLIENTSIDE
function onActionGrab() {
  
clientr.weapon.? = 1;
  
destroy;

You'd need to make your own Grab trigger. Also, clientr. flags can't be set clientside.
Reply With Quote
  #3  
Old 12-29-2007, 06:41 AM
Angel_Light Angel_Light is offline
Varia Developer
Angel_Light's Avatar
Join Date: Nov 2005
Location: Knoxville, TN
Posts: 1,684
Angel_Light is on a distinguished road
Send a message via AIM to Angel_Light Send a message via MSN to Angel_Light
PHP Code:
function onKeyPressedcodekey)
{

  switch ( 
temp.code)
  {
  
    case 
"65"//a
      
Grab();
    break;
    
  }
}

function 
Grab()
{

  
frontPosition = { player.1.5 vecx(player.dir) * 2player.1.5 vecy(player.dir) * 2};
  
  
canGrab = ( testplayer(frontPosition[0], frontPosition[1]) || testnpc(frontPosition[0], frontPosition[1]));

  if ( 
canGrab)
    
triggerAction(frontPosition[0], frontPosition[1], "Grabbed"player.accountplayer.guild);


Here what I use, forgot where I got it though. :/
__________________
Deep into the Darkness peering...
Reply With Quote
  #4  
Old 12-29-2007, 06:59 AM
coreys coreys is offline
N-Pulse Assistant Manager
coreys's Avatar
Join Date: Mar 2005
Posts: 2,180
coreys has a spectacular aura about
Send a message via AIM to coreys Send a message via MSN to coreys Send a message via Yahoo to coreys
Quote:
Originally Posted by Codein View Post
You'd need to make your own Grab trigger. Also, clientr. flags can't be set clientside.
Not...ENTIRELY true...
__________________

Quote:
*SlikRick: so should I even ask about your aim status?
*Xor: well if you want to
*Xor: but i am LARPING
*SlikRick: While on a computer?
*Xor: yes
*Xor: in my living room
*SlikRick: ahh
*Xor: i have a fort setup to hide from beasts
Reply With Quote
  #5  
Old 12-29-2007, 07:09 AM
Angel_Light Angel_Light is offline
Varia Developer
Angel_Light's Avatar
Join Date: Nov 2005
Location: Knoxville, TN
Posts: 1,684
Angel_Light is on a distinguished road
Send a message via AIM to Angel_Light Send a message via MSN to Angel_Light
Quote:
Originally Posted by coreys View Post
Not...ENTIRELY true...
please do explain, I know client.vars can be set both and I thought clientr.vars could only be set serverside, for security. :/
__________________
Deep into the Darkness peering...
Reply With Quote
  #6  
Old 12-29-2007, 07:28 AM
coreys coreys is offline
N-Pulse Assistant Manager
coreys's Avatar
Join Date: Mar 2005
Posts: 2,180
coreys has a spectacular aura about
Send a message via AIM to coreys Send a message via MSN to coreys Send a message via Yahoo to coreys
You can...sort of set clientr vars clientside
but I think it it acts more like a public variable (a.k.a. without a heading like this. or temp.) that happens to start with "clientr," therefore effectively replacing a real one that may exist.

Anyways, it really is best to use triggeractions for this...
__________________

Quote:
*SlikRick: so should I even ask about your aim status?
*Xor: well if you want to
*Xor: but i am LARPING
*SlikRick: While on a computer?
*Xor: yes
*Xor: in my living room
*SlikRick: ahh
*Xor: i have a fort setup to hide from beasts
Reply With Quote
  #7  
Old 12-29-2007, 04:15 PM
Codein Codein is offline
jwd
Codein's Avatar
Join Date: Oct 2005
Location: Greater Manchester
Posts: 2,423
Codein has a spectacular aura aboutCodein has a spectacular aura about
Send a message via AIM to Codein Send a message via MSN to Codein
Quote:
Originally Posted by coreys View Post
You can...sort of set clientr vars clientside
but I think it it acts more like a public variable (a.k.a. without a heading like this. or temp.) that happens to start with "clientr," therefore effectively replacing a real one that may exist.

Anyways, it really is best to use triggeractions for this...
In the way that he's using clientr. variables, I think he'd want to set them serverside. Either way, even if you can or can't, it'd just be best for him to set them serverside.
Reply With Quote
  #8  
Old 12-29-2007, 04:36 PM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
destroy() not destroy;
__________________
Reply With Quote
  #9  
Old 12-29-2007, 06:31 PM
Knightmare1 Knightmare1 is offline
Billy Allan
Knightmare1's Avatar
Join Date: Apr 2007
Posts: 804
Knightmare1 can only hope to improve
Quote:
Originally Posted by Angel_Light View Post
PHP Code:
function onKeyPressedcodekey)
{

  switch ( 
temp.code)
  {
  
    case 
"65"//a
      
Grab();
    break;
    
  }
}

function 
Grab()
{

  
frontPosition = { player.1.5 vecx(player.dir) * 2player.1.5 vecy(player.dir) * 2};
  
  
canGrab = ( testplayer(frontPosition[0], frontPosition[1]) || testnpc(frontPosition[0], frontPosition[1]));

  if ( 
canGrab)
    
triggerAction(frontPosition[0], frontPosition[1], "Grabbed"player.accountplayer.guild);


Here what I use, forgot where I got it though. :/
would that be for the system script? or the item script?
__________________
I am the devil, I am here to do to devils work.
Reply With Quote
  #10  
Old 12-29-2007, 06:56 PM
xXziroXx xXziroXx is offline
Master of Puppets
xXziroXx's Avatar
Join Date: May 2004
Location: Sweden
Posts: 5,288
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
Send a message via AIM to xXziroXx Send a message via MSN to xXziroXx
If that's what you're gonna use, it should be clientsided in a system NPC.
__________________

"A delayed game is eventually good, but a rushed game is forever bad." - Shigeru Miyamoto
Reply With Quote
  #11  
Old 12-29-2007, 07:00 PM
coreys coreys is offline
N-Pulse Assistant Manager
coreys's Avatar
Join Date: Mar 2005
Posts: 2,180
coreys has a spectacular aura about
Send a message via AIM to coreys Send a message via MSN to coreys Send a message via Yahoo to coreys
Quote:
Originally Posted by Codein View Post
In the way that he's using clientr. variables, I think he'd want to set them serverside. Either way, even if you can or can't, it'd just be best for him to set them serverside.
Oh, well yeah, I know.
__________________

Quote:
*SlikRick: so should I even ask about your aim status?
*Xor: well if you want to
*Xor: but i am LARPING
*SlikRick: While on a computer?
*Xor: yes
*Xor: in my living room
*SlikRick: ahh
*Xor: i have a fort setup to hide from beasts
Reply With Quote
  #12  
Old 12-29-2007, 08:04 PM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
I thought clientr. variables had to be set serverside? Or am I totally wrong?

Either way, I would set something like that serverside.
__________________
Reply With Quote
  #13  
Old 12-29-2007, 10:05 PM
Knightmare1 Knightmare1 is offline
Billy Allan
Knightmare1's Avatar
Join Date: Apr 2007
Posts: 804
Knightmare1 can only hope to improve
and in that script that angel made, what would i edit to make it show an icon?
__________________
I am the devil, I am here to do to devils work.
Reply With Quote
  #14  
Old 12-29-2007, 10:25 PM
Angel_Light Angel_Light is offline
Varia Developer
Angel_Light's Avatar
Join Date: Nov 2005
Location: Knoxville, TN
Posts: 1,684
Angel_Light is on a distinguished road
Send a message via AIM to Angel_Light Send a message via MSN to Angel_Light
well thats part of a system weapon. For Instance you add this to a weapon.

PHP Code:
//#CLIENTSIDE
function onKeyPressedcodekey)
{

  switch ( 
temp.code)
  {
  
    case 
"65"//a
      
Grab();
    break;
    
  }
}

function 
Grab()
{

  
frontPosition = { player.1.5 vecx(player.dir) * 2player.1.5 vecy(player.dir) * 2};
  
  
canGrab = ( testplayer(frontPosition[0], frontPosition[1]) || testnpc(frontPosition[0], frontPosition[1]));

  if ( 
canGrab)
    
triggerAction(frontPosition[0], frontPosition[1], "Grabbed"player.accountplayer.guild);


then in a level NPC on the ground you would add this.

PHP Code:

function onCreated()
{

  
setImgimage);
  
setShape116*216*2);

}

function 
onActionGrabbed()
{

  
findPlayerparams0]).addWeaponweapon);

  
destroy();


__________________
Deep into the Darkness peering...
Reply With Quote
  #15  
Old 12-30-2007, 02:18 AM
Knightmare1 Knightmare1 is offline
Billy Allan
Knightmare1's Avatar
Join Date: Apr 2007
Posts: 804
Knightmare1 can only hope to improve
PHP Code:
function onCreated()
{

  
setImg(this.image);
  
setShape116*216*2);

}

function 
onActionGrabbed()
{

  
findPlayerparams0]).addWeaponweapon);

  
destroy();


could i make the image this.image = "image" in the NPC? im using classes.
__________________
I am the devil, I am here to do to devils work.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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:35 PM.


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