Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   flying (https://forums.graalonline.com/forums/showthread.php?t=134256866)

Liberated 11-09-2009 05:57 PM

flying
 
i made this flying/hovering script, but i need help with 1 thing.
I need to turn the blocking off all objects off, and i need to turn the walking sound off.
Is there any way to accomplish this? This is the script.
PHP Code:

//#CLIENTSIDE
function onKeyPressed(code,key)
{
  if( 
key == "m" )
  {    
    if(
player.== 10)
    { 
      
player.chat="max altitude reached!";
    }
    else 
    {
      
player.z+= 0.5;
      if(
player.0)
      {
      
replaceAni("walk""idle");
      }      
    }   
    }   
  else if( 
key == "n" )
  {
    if(
player.0)
    {
      
player.z-= 0.5;
      if(
player.== 0)
      {
        
replaceAni("walk""walk"); 
      }     
    }
  }



Rufus 11-09-2009 05:59 PM

Quote:

Originally Posted by Liberated (Post 1537472)
i need to turn the walking sound off.

Now I'm no scripter, but I assume you just need to use a different walk gani when flying, and remove the walk sound playing from the gani file.

Liberated 11-09-2009 06:09 PM

Quote:

Originally Posted by Rufus (Post 1537473)
Now I'm no scripter, but I assume you just need to use a different walk gani when flying, and remove the walk sound playing from the gani file.

Im already using the idle gani, but i still hear the walking sound, i guess it's in the movement system.

Rufus 11-09-2009 06:15 PM

Quote:

Originally Posted by Liberated (Post 1537477)
Im already using the idle gani, but i still hear the walking sound, i guess it's in the movement system.

If it isn't showing the idle gani where it's supposed to show it then yeah, there is something affecting it and it could be the movement system if you're using something custom.

Liberated 11-09-2009 06:16 PM

Quote:

Originally Posted by Rufus (Post 1537478)
If it isn't showing the idle gani where it's supposed to show it then yeah, there is something affecting it and it could be the movement system if you're using something custom.

yeah it's showing the idle gani when it's supposed to, but it also still plays the walking sound, so i think the walking sound is in the default movement system, and not the gani.

Rufus 11-09-2009 06:24 PM

Quote:

Originally Posted by Liberated (Post 1537479)
yeah it's showing the idle gani when it's supposed to, but it also still plays the walking sound, so i think the walking sound is in the default movement system, and not the gani.

Oh you're right, I just tested it. I'm out of my depth here, but this might help you.

fowlplay4 11-09-2009 06:34 PM

Disable default movement, and then use code that you would find in Staff Boots.

Liberated 11-09-2009 06:54 PM

Quote:

Originally Posted by Rufus (Post 1537480)
Oh you're right, I just tested it. I'm out of my depth here, but this might help you.

Thanks, haven't tested it, but that should work, =]

Quote:

Originally Posted by fowlplay4 (Post 1537483)
Disable default movement, and then use code that you would find in Staff Boots.

Thanks, i'l play with it a little, i already had a look into the staffboots on testbed, but didn't really see any concrete fix, so left it.

Crow 11-09-2009 06:59 PM

Quote:

Originally Posted by Rufus (Post 1537480)
but this might help you.

:pluffy:

Liberated 11-09-2009 08:10 PM

so far its working, i've managed to use the thing found in staffboots, and apply it to my flying system,
and i've managed to replace the ganis with my own, so i don't hear the grass anymore, but 1 problem, i've uploaded my ganis, and the images needed for them to testbed, but nothing appears, im completely invisble.
PHP Code:

//#CLIENTSIDE
function onKeyPressed(code,key)
{
  if( 
key == "m" )
  {    
    if(
player.>= 10)
    { 
      
player.chat="max altitude reached!";
    }
    else 
    {
      
settimer(0.1);
      
player.z+= 0.2;
    }   
  }   
  else if( 
key == "n" )
  {
    if(
player.0)
    {
      
player.z-= 0.2;
    }
  }
}
function 
onTimeOut()
{
   if(
player.0)
  {
    
replaceAni("walk""myidle");
    
replaceAni("idle""myidle");
    
this.speed 0.1;
    
player.z-= 0.005;
     for ( 
temp.04++ )
      { 
      if ( 
keydown(i) )
      { 
// if the key for that direction is pressed
        
player.+= vecx(i) * this.speed;
        
player.+= vecy(i) * this.speed;
      }
     
settimer(0.05);
     }   
  }
  else
  {
   
    
replaceAni("idle""idle");
    
replaceAni("walk""walk");
    
settimer(0);
  }


oh, i've also made a jumpscript!
PHP Code:

//#CLIENTSIDE
function onKeyPressed(code,key)
{
  if( 
key == "f")
  {
   
    if(
player.)
    {
      
replaceAni("walk""idle");
      
temp.0;
      while(
temp.<= 3)
      {
        
settimer(0.05);
        
temp.++;
        
player.+= (1/temp.i);
        
sleep(0.03);
        if(
temp.== 3)
        {
          
replaceAni("walk""walk");
          
temp.0;
          while(
temp.<= 3)
          {
            if(
player.1)
             {
               
player.0;
             }
             else
             {  
               
temp.++;
               
player.-= (0.2*temp.i);
               
sleep(0.03);  
             }
           }  
        }  
      }
    }
  }


i'm still trying to make it that you can actually jump over stuff with this one tho, haven't gotten that to work yet.

Soala 11-09-2009 08:14 PM

Quote:

Originally Posted by Liberated (Post 1537496)
i'm still trying to make it that you can actually jump over stuff with this one tho, haven't gotten that to work yet.


Like with the boots NPC on N-Pulse =O ? Would be fun
Keep going ^^

Liberated 11-10-2009 11:21 AM

i've got my jumpscript to were i like it.
For the jumping part that is, but i haven't been able to add it so that i can jump over/on things, i can't seem to get the thing used for nthe staffboots in there working. i understand how it works, but i can't get it right.
PHP Code:

//#CLIENTSIDE
function onKeyPressed(code,key)
{
  if( 
key == "f")
  {
    if(
player.0)
    {
      
replaceAni("walk""idle");
      
temp.0;
      while(
temp.4)
      {
        
temp.+= 0.5;
        
player.+= 0.2/temp.i;
        
sleep(0.05);
        if(
player.1)
        {
          
settimer(0.05);
        }
        else if(
temp.== 4)
        {
          
temp.0;
          while(
temp.4)
          {
            
temp.+= 0.5;
            if(
player.0.5)
            {
              
replaceAni("walk""walk");
              
player.0;
            }
            else
            {
              
player.-= 0.2*temp.i;
              
sleep(0.05);
            }
          }
        }
      }
    }  
  }



Samposse 11-26-2009 07:08 PM

Fly !

fowlplay4 11-26-2009 07:27 PM

Quote:

Originally Posted by Samposse (Post 1540615)
Fly !

Really?


All times are GMT +2. The time now is 11:08 AM.

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