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
  #61  
Old 03-14-2010, 09:41 PM
Deas_Voice Deas_Voice is offline
Deas
Deas_Voice's Avatar
Join Date: Jun 2007
Location: Sweden
Posts: 2,264
Deas_Voice is a jewel in the roughDeas_Voice is a jewel in the rough
Send a message via AIM to Deas_Voice Send a message via MSN to Deas_Voice Send a message via Yahoo to Deas_Voice
Quote:
Originally Posted by jkldogg View Post
So if I take out the second function it will work?
i don't know? try!
srsly man, rc should tell you errors like this!
__________________
.
WTF is real life, and where do I Download it?
There is no Real Life, just AFK!
since 2003~
I Support~
ღAeonღ | ღTestbedღ | ღDelteriaღ

if you are going to rep me, don't be an idiot, leave your name!
I got nothing but love for you
Reply With Quote
  #62  
Old 03-14-2010, 09:47 PM
jkldogg jkldogg is offline
J.Rollin (killaz)
jkldogg's Avatar
Join Date: Feb 2010
Location: USA
Posts: 675
jkldogg can only hope to improve
Send a message via AIM to jkldogg Send a message via MSN to jkldogg
Quote:
Originally Posted by Deas_Voice View Post
i don't know? try!
srsly man, rc should tell you errors like this!
It should, but doesn't.
__________________

PSN: jkldogg



The best post ever made on the graal forums.
After playing Graal Online for many years, JKL decides to make a forum account. Isn't life funny?
Reply With Quote
  #63  
Old 03-14-2010, 09:48 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
HTML Code:
function onActionGrab() { 
  if (clientr.SquadName == "La Carmelas") { 
    setlevel("vega_kody-house-inside.nw", 30, 30); 
  } else {
    setlevel("vega_staff-meeting,nw", 20, 20); 
  }
}
This uses the else feature, and you only need one function (onActionGrab)
__________________
Reply With Quote
  #64  
Old 03-14-2010, 09:59 PM
jkldogg jkldogg is offline
J.Rollin (killaz)
jkldogg's Avatar
Join Date: Feb 2010
Location: USA
Posts: 675
jkldogg can only hope to improve
Send a message via AIM to jkldogg Send a message via MSN to jkldogg
testing

Quote:
Originally Posted by xAndrewx View Post
HTML Code:
function onActionGrab() { 
  if (clientr.SquadName == "La Carmelas") { 
    setlevel("vega_kody-house-inside.nw", 30, 30); 
  } else {
    setlevel("vega_staff-meeting,nw", 20, 20); 
  }
}
This uses the else feature, and you only need one function (onActionGrab)
I'll try it with one function.

EDIT: I did this and it didn't work.

PHP Code:
function onActionGrab() {
      if (
clientr.SquadName == "Vega") {
        
setlevel("vega_hut.nw"3030);
      } else {
        
setlevel("vega_staff-meeting,nw"2020);
      }
    } 
Attached Thumbnails
Click image for larger version

Name:	script.PNG
Views:	135
Size:	99.5 KB
ID:	50569  
__________________

PSN: jkldogg



The best post ever made on the graal forums.
After playing Graal Online for many years, JKL decides to make a forum account. Isn't life funny?

Last edited by jkldogg; 03-14-2010 at 10:18 PM.. Reason: now0rk
Reply With Quote
  #65  
Old 03-14-2010, 10:48 PM
salesman salesman is offline
Finger lickin' good.
salesman's Avatar
Join Date: Nov 2008
Location: Colorado
Posts: 1,865
salesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud of
Quote:
Originally Posted by jkldogg View Post
I'll try it with one function.

EDIT: I did this and it didn't work.

PHP Code:
function onActionGrab() {
      if (
clientr.SquadName == "Vega") {
        
setlevel("vega_hut.nw"3030);
      } else {
        
setlevel("vega_staff-meeting,nw"2020);
      }
    } 
try setlevel2()
Reply With Quote
  #66  
Old 03-14-2010, 11:02 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
Oh yeah- haha duh
__________________
Reply With Quote
  #67  
Old 03-14-2010, 11:17 PM
Switch Switch is offline
o.o
Switch's Avatar
Join Date: Jan 2007
Location: Philadelphia
Posts: 3,038
Switch has a spectacular aura about
Send a message via MSN to Switch
Quote:
Originally Posted by jkldogg View Post
PHP Code:
GraalControl.onKeyPressed(codekeyscan
Change this to GraalControl.onKeyDown(code, key, scan). Forgot to change it when I updated the script.
__________________
Oh squiggly line in my eye fluid. I see you lurking there on the peripheral of my vision.
But when I try to look at you, you scurry away.
Are you shy, squiggly line?
Why only when I ignore you, do you return to the center of my eye?
Oh, squiggly line, it's alright, you are forgiven.
Reply With Quote
  #68  
Old 03-14-2010, 11:51 PM
jkldogg jkldogg is offline
J.Rollin (killaz)
jkldogg's Avatar
Join Date: Feb 2010
Location: USA
Posts: 675
jkldogg can only hope to improve
Send a message via AIM to jkldogg Send a message via MSN to jkldogg
Wink

Quote:
Originally Posted by salesman View Post
try setlevel2()
Works, thanks.

Quote:
Originally Posted by xAndrewx View Post
Oh yeah- haha duh
lol, you had the just of it

Quote:
Originally Posted by Switch View Post
Change this to GraalControl.onKeyDown(code, key, scan). Forgot to change it when I updated the script.
Thanks, already did.
__________________

PSN: jkldogg



The best post ever made on the graal forums.
After playing Graal Online for many years, JKL decides to make a forum account. Isn't life funny?
Reply With Quote
  #69  
Old 03-15-2010, 12:03 AM
DrakilorP2P DrakilorP2P is offline
Registered User
DrakilorP2P's Avatar
Join Date: Apr 2006
Posts: 755
DrakilorP2P is just really niceDrakilorP2P is just really nice
Quote:
Originally Posted by jkldogg View Post
PHP Code:
function onActionGrab() {
      if (
clientr.SquadName == "Vega") {
        
setlevel("vega_hut.nw"3030);
      } else {
        
setlevel("vega_staff-meeting,nw"2020);
      }
    } 
You should probably remove the tabs that come when you copy paste.
Reply With Quote
  #70  
Old 03-15-2010, 12:17 AM
jkldogg jkldogg is offline
J.Rollin (killaz)
jkldogg's Avatar
Join Date: Feb 2010
Location: USA
Posts: 675
jkldogg can only hope to improve
Send a message via AIM to jkldogg Send a message via MSN to jkldogg
Question

Quote:
Originally Posted by DrakilorP2P View Post
You should probably remove the tabs that come when you copy paste.
When I copy paste what?
__________________

PSN: jkldogg



The best post ever made on the graal forums.
After playing Graal Online for many years, JKL decides to make a forum account. Isn't life funny?
Reply With Quote
  #71  
Old 03-15-2010, 12:22 AM
Cubical Cubical is offline
Banned
Join Date: Feb 2007
Posts: 1,348
Cubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant future
the script
Reply With Quote
  #72  
Old 03-15-2010, 12:25 AM
jkldogg jkldogg is offline
J.Rollin (killaz)
jkldogg's Avatar
Join Date: Feb 2010
Location: USA
Posts: 675
jkldogg can only hope to improve
Send a message via AIM to jkldogg Send a message via MSN to jkldogg
Exclamation Inventory()replace

Quote:
Originally Posted by Cubical View Post
the script
Okay.

I want to replace the old classic inventory with my own one. I changed the key to "Q", but both inventories popped up..lol How can I easily disable the old classic one? Also, is there a way to drag out items and drop them on the ground?

I thought editing this would help..but I failed

PHP Code:
   player.chat "You can't drop this!";
    return;
  }
  
Inventory_Window.visible false;
  
this.dragging true;
  
this.dragWep = ( @ ct ).weapon;
  
Inventory_DragImg.image = ( @ ct ).weapon.image;
  
Inventory_DragQuantity.text 1;
  
refreshDrag();
  
Inventory_DragImg.visible true;
  
Inventory_DragQuantity.visible true;
  
this.startDrag timevar2;
  
client.frozen true;
}
function 
refreshDrag() 

Here's the code:

PHP Code:
function onActionServerSidecmdwepammimgacc )
{
  }
    
    
//echo(wep SPC clientr.item.( @ wep ) SPC player.account);
    
if ( clientr.item.( @ wep ) >= amm )
    {
      
clientr.item.( @ wep ) -= amm;
      if ( 
clientr.item.( @ wep ) == )
      {
        
removeweaponwep );
      }
      
temp.npc putnpc2dropPosition()[0], dropPosition()[1], "join(\"object_droppeditem\");" );
      
temp.npc.dropper acc;
      
temp.npc.realName wep;
      
temp.npc.itemQuantity amm;
      
temp.npc.itemImage img;
      
clientr.trueMoney base64encodeclientr.item.Money );
      
triggerclient"gui"name"reopenMenu" );
    }
function 
dropPosition()
{
  
temp.playerPos = {{0.751}, {0.61.5}};
  
temp.dropPos = {
                   
player.+ (player.dir in {02}? temp.playerPos[0][0] : temp.playerPos[1][0]) + vecx(player.dir) * 2,
                   
player.+ (player.dir in {02}? temp.playerPos[0][1] : temp.playerPos[1][1]) + vecy(player.dir) * 2
                 
};
  return 
temp.dropPos;
}
//#CLIENTSIDE
function onCreated()
{
  
setTimer0.05 );
}
function 
onActionClientSidecmd )
{
  if ( 
cmd == "reopenMenu" )
  {
    if ( 
this.menu == )
    {
      
destroyMenu();
      
showMenu();
    }
    else
    {
      
destroyMenu();
    }
  }
}
function 
onKeyPressedcodekey )
{
  if ( 
key == "w" )
  {
    
this.menu this.menu;
    if ( 
this.menu )
    {
      
showMenu();
      
setTimer0.05 );
    }
    else
    {
      
destroyMenu();
      
this.scroll 0;
    }
  }
}
function 
onTimeOut()
{
  if ( 
mousewheeldelta )
  {
    if ( 
this.scroll 35 this.iWeps.size() )
    {
      
this.scroll += 5;
      
destroyMenu();
      
showMenu();
    }
  }
  else if ( 
mousewheeldelta )
  {
    if ( 
this.scroll )
    {
      
this.scroll -= 5;
      
destroyMenu();
      
showMenu();
    }
  }
  if ( 
this.dragging )
  {
    
temp.Inventory_DragQuantity.text;
    if ( 
timevar2 this.lastTime >= .1 )
    {
      if ( 
keydown) )
      {
        if ( 
temp.!= clientr.item.( @ this.dragWep.name ) )
        {
          
Inventory_DragQuantity.text temp.1;
          
this.lastTime timevar2;
        }
      }
      if ( 
keydown) )
      {
        if ( 
temp.100 )
        {
          
Inventory_DragQuantity.text temp.100;
          
// this.lastTime = timevar2;
        
}
        else
        {
          
Inventory_DragQuantity.text 1;
          
//this.lastTime = timevar2;
        
}
      }
      if ( 
keydown) )
      {
        if ( 
temp.)
        {
          
Inventory_DragQuantity.text temp.1;
          
this.lastTime timevar2;
        }
      }
      if ( 
keydown) )
      {
        if ( 
temp.100 <= clientr.item.( @ this.dragWep.name ) )
        {
          
Inventory_DragQuantity.text temp.100;
          
//this.lastTime = timevar2;
        
}
        else
        {
          
Inventory_DragQuantity.text clientr.item.( @ this.dragWep.name );
          
//this.lastTime = timevar2;
        
}
      }
    }
    if ( ! 
leftmousebutton )
    {
      
endDragging();
    }
    else
    {
      
refreshDrag();
    }
  }
  if ( 
this.menu )
  {
    
setTimer0.05 );
  }
}
function 
destroyMenu()
{
  
Inventory_Window.destroy();
}
function 
showMenu()
{
  
iWeps.clear();
for ( 
temp.player.weapons )
  {
    
temp.temp.a.name;
    if ( ! 
temp.n.starts"-" ) )
    {
      
iWeps.addtemp.);
    }
  }
  
this.iWeps iWeps;
  
scroll this.scroll;
  new 
GuiShowImgCtrl"Inventory_DragImg" )
  {
    
image "";
    
0;
    
0;
    
visible false;
    
width 32;
    
height 32;
  }
  new 
GuiShowImgCtrl"Inventory_Window" )
  {
    
image "inventory1.png";
    
width 380;
    
height 380;
    
screenwidth - ( width 20 );
    
screenheight - ( height );
    
visible true;
    for ( 
temp.scrolltemp.35 scrolltemp.++ )
    {
      if ( 
temp.iWeps.size() )
      {
        
temp.iWeps[temp.i];
        if ( 
temp.cols == )
        {
          
temp.row ++;
          
temp.cols 0;
        }
        new 
GuiShowImgCtrl"Inventory_Item_" temp.a.name )
        {
          
image temp.a.image;
          
13 + ( 60.5 temp.cols );//108-x/original|35|
          
+ ( 43.5 temp.row );//9-y/original|35|
          //Newer Old-x=27.5
          //Newer Old-y=96
          
width 32;
          
height 32;
          
hint temp.a.name;
          
this.weapon temp.a;
          
thiso.catcheventname"onMouseDown""onItemClicked" );
          
thiso.catcheventname"onMouseDragged""onItemDragged" );
        }
        
temp.cols ++;
      }
    }
  }
  
onSelect( ( @ "Inventory_Item_" player.weapons[selectedweapon].name ) );
}
function 
onItemClickedctrnxycount )
{
  
temp.= ( @ ctr );
  
temp.temp.c.weapon;
  if ( 
count == )
  {
    
onEquipctr );
  }
  else
  {
    
onSelectctr );
  }
}
function 
onItemDraggedctrlnnx)
{
  if ( ! 
this.dragging )
  {
    
startDraggingctrln );
  }
}
function 
startDraggingct )
{
  if ( ( @ 
ct ).weapon.name == NULL )
  {
    
player.chat "You can't drop this!";
    return;
  }
  
Inventory_Window.visible false;
  
this.dragging true;
  
this.dragWep = ( @ ct ).weapon;
  
Inventory_DragImg.image = ( @ ct ).weapon.image;
  
Inventory_DragQuantity.text 1;
  
refreshDrag();
  
Inventory_DragImg.visible true;
  
Inventory_DragQuantity.visible true;
  
this.startDrag timevar2;
  
client.frozen true;
}
function 
refreshDrag()
{
  
player.dir getdirmousex player.xmousey player.);
  if ( 
mousex in player.10player.10 | && mousey in player.10player.10 |)// && ( timevar2 - this.startDrag > .5 ) )
  
{
    
setAni"grab"Inventory_DragImg.image );
  }
  else
  {
    
setAni"idle""" );
  }
  
Inventory_DragImg.mousescreenx 25;
  
Inventory_DragImg.mousescreeny 25;
  
Inventory_DragQuantity.mousescreenx 30;
  
Inventory_DragQuantity.mousescreeny 20;
  
Inventory_DragImg.showtop();
}
function 
endDragging()
{
  
Inventory_Window.visible true;
  if ( 
this.dragWep.name == "Medkit" )
  {
  for (
aallplayers)
    {
      if ( 
player.x in |a.2a.2| && player.y in |a.2a.2| )
      {
        if ( 
a.account != player.account )
        {
          
triggerserver"weapon"name"revive"a.account );
          
this.dragging false;
          
Inventory_DragImg.image "";
          
Inventory_DragImg.visible true;
          
Inventory_DragQuantity.text "";
          
Inventory_DragQuantity.visible false;
          
this.dragWep "";
          
client.frozen false;
        }
      }
    }
  }
  elseif ( 
mousex in player.10player.10 | && mousey in player.10player.10 | && ( timevar2 this.startDrag .5 ) )
  {
    
triggerserver"gui"name"dropItem"this.dragWep.nameInventory_DragQuantity.textthis.dragWep.imageplayer.account );
  }
  else
  {
    
setAni"idle""" );
  }
  
this.dragging false;
  
Inventory_DragImg.image "";
  
Inventory_DragImg.visible false;
  
Inventory_DragQuantity.text "";
  
Inventory_DragQuantity.visible false;
  
this.dragWep "";
  
client.frozen false;
}

function 
onSelectctrl )
{
  
temp.= ( @ ctrl ).weapon.name;
  
temp.temp.n.tokenize"/" );
  if ( 
temp.a.size() == )
  {
    
Inventory_ItemName.text "Item:" SPC temp.a[1];
  }
  else
  {
    
Inventory_ItemName.text "Item:" SPC temp.a[0];
  }

  
Inventory_ItemQuantity.text "Quantity:" SPC clientr.item.( @ temp.);
  
Inventory_Icon.image = ( @ ctrl ).weapon.image;
}
function 
onEquipctrl3 )
{
  
temp.= ( @ ctrl3 ).weapon.name;
  for ( 
temp.0temp.player.weapons.size(); temp.++ )
  {
    
temp.player.weapons[temp.i];
    if ( 
temp.a.name == temp.)
    {
      
selectedweapon temp.i;
    }
  }

__________________

PSN: jkldogg



The best post ever made on the graal forums.
After playing Graal Online for many years, JKL decides to make a forum account. Isn't life funny?

Last edited by jkldogg; 03-15-2010 at 12:26 AM.. Reason: ok script
Reply With Quote
  #73  
Old 03-15-2010, 01:50 AM
Mark Sir Link Mark Sir Link is offline
Kevin Azite
Mark Sir Link's Avatar
Join Date: Sep 2005
Posts: 1,489
Mark Sir Link is just really niceMark Sir Link is just really nice
Send a message via AIM to Mark Sir Link
use enablefeatures() and the appropriate bitflags to enable what you want


Game features (for enablefeatures)

2 P key
4 Q key
8 R key
0x10 S+A combo
0x20 S+D combo
0x40 TAB key
0x80 chat text
0x100 hearts overhead
0x200 display of nicknames
0x400 toall/PM bubbles
0x800 right-click profiles
0x1000 emoticons
0x2000 Alt+5 snapshots
0x4000 Alt+8/9 zooming
0x8000 logframe
allfeatures all features
Reply With Quote
  #74  
Old 03-15-2010, 02:34 AM
jkldogg jkldogg is offline
J.Rollin (killaz)
jkldogg's Avatar
Join Date: Feb 2010
Location: USA
Posts: 675
jkldogg can only hope to improve
Send a message via AIM to jkldogg Send a message via MSN to jkldogg
Quote:
Originally Posted by Mark Sir Link View Post
use enablefeatures() and the appropriate bitflags to enable what you want


Game features (for enablefeatures)

2 P key
4 Q key
8 R key
0x10 S+A combo
0x20 S+D combo
0x40 TAB key
0x80 chat text
0x100 hearts overhead
0x200 display of nicknames
0x400 toall/PM bubbles
0x800 right-click profiles
0x1000 emoticons
0x2000 Alt+5 snapshots
0x4000 Alt+8/9 zooming
0x8000 logframe
allfeatures all features
I've seen this before, can't remember where it goes though. Any help?
__________________

PSN: jkldogg



The best post ever made on the graal forums.
After playing Graal Online for many years, JKL decides to make a forum account. Isn't life funny?
Reply With Quote
  #75  
Old 03-15-2010, 02:58 AM
Imperialistic Imperialistic is offline
graal player lord
Imperialistic's Avatar
Join Date: Apr 2007
Location: Florida
Posts: 1,094
Imperialistic is a jewel in the roughImperialistic is a jewel in the rough
Maybe you should read and learn yourself instead of asking for scripts, it's okay to ask questions for help but people giving you scripts isn't helping. If you read through all of the wiki's you should be able to answer your own questions.

Maybe these links can help you:
www.wiki.graal.us
www.wiki.graal.net
www.gs2.graalstudios.com
__________________
" It's been swell, but the swelling's gone down. "
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 08:01 AM.


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