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 06-09-2012, 07:42 PM
MysticalDragon MysticalDragon is offline
Global Administration
MysticalDragon's Avatar
Join Date: Oct 2002
Location: Lynn Ma
Posts: 883
MysticalDragon is a jewel in the roughMysticalDragon is a jewel in the rough
Send a message via AIM to MysticalDragon Send a message via MSN to MysticalDragon
setshootparams help

I really don't get what I'm doing wrong. I'm trying to implement picking up and throwing bushes on delteria but for some odd reason I can't get he setshootparams to work right at all. So I got picking up and throwing part finished, but the setshootparams isn't working when the bush lands for that "leap effect".
Here is What i did.
-Skipped Some stuff that isn't needed int he code below

PHP Code:
function onActionServerSide(cmddata) {
  switch (
cmd) {
     case 
"liftItem":{
    for ( 
temp.04i++ ) {
      
tilesparams] + 2params] + int) ] = this.replaceTiles[    params] ][ ];
    }
    
updateBoardparams], params], 2);
    
client.carrying true;
  }
 }
}
function 
onCreated(){
 
addTileVars() ;
}
function 
addTileVars() {
  
this.replaceTiles = {
    { 
0x1C00x1C10x1D00x1D1 }, // sign 1
    
0x1C20x1C30x1D20x1D3 }, // pot 1
    
0x1C40x1C50x1D40x1D5 }, // pot 2
    
0x1C60x1C70x1D60x1D7 }, // rock 1
    
0x1C80x1C90x1D80x1D9 }, // bush 1
    
0x1CA0x1CB0x1DA0x1DB }, // rock 2
    
0x1CC0x1CD0x1DC0x1DD }, // sign 2
    
0x1CE0x1CF0x1DE0x1DF }  // bush 2
  
};
}
//#CLIENTSIDE
public function onDoGrab() {
     
player.ani "grab";
  if (
client.carrying == false){
     
onCheckLift();
  } else {
   
setAni"delt_carrythrow"player.attr] );
   
movement.pauseani(0.3);
   
throwItem();
  }
}

public function 
onCheckLift(){
    
temp.tx player.1.5 vecxplayer.dir ) * 1.5;
    
temp.ty player.vecyplayer.dir ) * 1.5;
    if ( 
onWalltxty ) ) {
      
temp.testx inttx );
      
temp.testy intty );
      
temp.tile tilestestxtesty ];
      
temp.px inttx );
      
temp.py intty );
      for ( 
0this.liftTiles.size(); i++ ) {
        for ( 
04t++ ) {
          if ( 
tile == this.liftTiles][ ] ) {
            
px -= 2;
            
py -= int) % 2;
            for ( 
04j++ ) {
              if ( 
tilespx 2py int) ] != this.liftTiles][ ] ) {
                return;
              }
            }
            
player.attr] = i;
            if ( 
i in 3} ) {
              
movement.freezeplayer(0.3);
              
onReleaseGrab();
              
scheduleEvent0.3"LiftItem"pxpy);
            }
            else {
              
onLiftItempxpy);
            }
            break;
            }
         }
      }
   }
}
function 
onLiftItempxpy) {
  
setAni"delt_lift", { pxpy} );
  
this.pauseani(0.3);
  
player.idleani "delt_carrystill";
  
player.walkani "delt_carry";
  
triggerServer"weapon"this.name"liftItem"pxpy);
}

function 
throwItem() {
  
cancelEvents"LiftItem" );
  
gravity 1;
  
this.pauseani(0.3);
  
//onReleaseGrab();

  
echo("thrownobj"player.attr], player.account );
   
setshootparams("thrownobj2",player.attr]);
  
// projectile with x,y,z,angle,zangle,strength,ani,aniparams
  //setShootParams( "thrownobj", player.attr[ 9 ], player.account );
  
shootplayer.xplayer.y1.5getanglevecxplayer.dir), vecyplayer.dir ) ), 01"delt_carryitem"player.attr] );
  
client.carrying false;
  
setani("iidle"nil);
  
player.idleani "iidle";
  
player.walkani "iwalk";
  
//replaceAni( "push", "push" );
  
player.attr] = null;


So All that works besides last part, the bush actual gets thrown with
shoot( bleh ), but when it lands nothing happens with setShootparams.
I made this NPC for the ActionProjectile2 Test and called it MDPROJECTILES and added it to my self.

PHP Code:
//#CLIENTSIDE
function onActionProjectile2(px,py,obj,dir,throwobj) {
 if (
obj == "thrownobj2") echo("Testing Projectiles");
}
/*
function onActionProjectile2( dx, dy, wpn ) {
  echo("Test Projectile:" SPC params[1]);
  // 0 - bush, 1 - grass, 2 - white rock,
  // 3 - brown rock, 4 - black pellets, 5 - splash
    temp.tile = tiles[ dx, dy ];
    if ( tile in | 0x40, 0x11F | ||
         tile in | 0x2C0, 0x2C5 | ||
         tile in | 0x2D0, 0x2D5 | ||
         tile in | 0x2E0, 0x2E3 | ||
         tile in | 0x2F0, 0x2F3 | ) {
      putLeaps( 5, dx - 1, dy - 1 );
    }
    else {
      temp.leaps = { 3, 2, 2, 3, 0, 2, 3, 0 };
      putLeaps( leaps[ params[ 3 ] ], dx - 1, dy - 1 );
    }
}
*/ 

Remember I cut this portion out of the movement system.
__________________
~Delteria Support
~Playerworld Support
~PWA Chief
http://support.toonslab.com
[email protected]




Last edited by MysticalDragon; 06-09-2012 at 08:15 PM..
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 11:40 AM.


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