Graal Forums  

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

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 07-24-2007, 04:39 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
Gassy!!!

PHP Code:
//#CLIENTSIDE
// Made by Mr. Omega
//Inspired by a script of Napo
function onCreated() {
  
onTimeOut();
  
this.on 0;
}

function 
onWeaponFired() {
  if ( 
this.on == 0)
  {
    
this.on 1;
  
    
with findimg200)) {     
      
layer 2;
      
emitter.delaymin 0.1;
      
emitter.delaymax 0.5;
      
emitter.nrofparticles 1;

      
emitter.particle.lifetime 3;
      
emitter.particle.image "g4_particle_smoke.png";
      
emitter.particle.mode  1;
      
emitter.particle.red   0;
      
emitter.particle.green 1;
      
emitter.particle.blue  0;
      
emitter.particle.alpha 0.6;
      
emitter.particle.zoom  0.5;
      
emitter.particle.speed 4;
      
      
emitter.addglobalmodifier("range"01000"movex""add", -4, -10);
      
emitter.addglobalmodifier("impulse"0.20.2"spin""multiply"0.90.9);
      
emitter.addlocalmodifier("once"00"angle""add", -0.20.2);
      
emitter.addlocalmodifier("once"00"rotation""replace"02*pi);
      
emitter.addlocalmodifier("range"13"alpha""replace"0.60);
      
emitter.addlocalmodifier("range"03"zoom""add"0.50.25);
      
emitter.addlocalmodifier("range"00.5"speed""replace"84);
      
emitter.addlocalmodifier("range"0.53"speed""replace"41.5);
      
emitter.addlocalmodifier("once"00"spin""replace"24);
    }
  }

  else if ( 
this.on == 1)
  {
    
hideImg200);
    
this.on 0;
  }
}

function 
onTimeOut() {
  if (
this.on == 1)
  {
    
withfindImg200)) {
      if (
player.dir == 0)
      {
        
player.x-0.5;
        
player.y+1;
        
layer 2;
        
emitter.particle.angle pi*3/2;
      }
      
      if (
player.dir == 1)
      {
        
player.x+1;
        
player.y+0.3;
        
layer 2;
        
emitter.particle.angle 0;
      }
      
      if (
player.dir == 2)
      {
        
player.x-0.3;
        
player.y-0.5;
        
layer 0;
        
emitter.particle.angle pi/2;
      }
      
      if (
player.dir == 3)
      {
        
player.x-2;
        
player.y+0.3;
        
layer 2;
        
emitter.particle.angle pi;
      }
    }
  }
  
  
setTimer0.05);

Just press D to use it ;]

Here's a vid of what it does.
Attached Files
File Type: zip gas.avi.zip (9.43 MB, 120 views)
__________________
Deep into the Darkness peering...

Last edited by Angel_Light; 07-24-2007 at 04:59 PM..
Reply With Quote
  #2  
Old 07-24-2007, 04:56 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 Angel_Light View Post
Here's a vid of what it does.
I can almost see the video! So close....

Anyhoo, the else if () isn't really necessary...it's a boolean condition. You could have also done if (this.on) {} else {}. Also, do setTimer(0) in the else part and add setTimer(0.05); to save the timeout from running when it's not needed.

Last edited by Twinny; 07-24-2007 at 05:06 PM..
Reply With Quote
  #3  
Old 07-24-2007, 05:01 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
sorry the vid took some time to upload, and also because I choose not too :P
__________________
Deep into the Darkness peering...
Reply With Quote
  #4  
Old 07-28-2007, 06:48 PM
theHAWKER theHAWKER is offline
**FLIP OUT**
theHAWKER's Avatar
Join Date: Mar 2006
Location: canada, vancouver
Posts: 768
theHAWKER is an unknown quantity at this point
good job xD, the video's a bit much of a file size...
__________________
**FLIP OUT**
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 06:12 AM.


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