Graal Forums  

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

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 02-09-2010, 10:31 PM
Engine Engine is offline
Registered User
Join Date: Jan 2010
Posts: 70
Engine is on a distinguished road
My ungodly amount of questions thread.

Instead of creating a new thread for every possible problem I come across, I have decided that it would be a better idea just to keep all my questions in one thread.

Right now I'm currently attempting to make it so every time I press 'f' fire comes out in the direction the player is facing and then disappears 2 seconds later. I cannot figure out why it's not working correctly. Can anyone try to walk me through what I'm doing wrong?


Weapon
PHP Code:
//#CLIENTSIDE
function onKeyPressed() {
  if(
params[1] = "f"){
    
player.attr[12] = "enginetest7.gani";
    
scheduleevent("2","ClearFire""");
 }
}
function 
onClearFire(){
player.attr[12] = NULL;
findimg(200).destroy();


Gani
PHP Code:
//#CLIENTSIDE
function onCreated(){

  
with(findimg(200){
    
emitter.delaymin 0.01;
    
emitter.delaymax 0.01;
    
emitter.nrofparticles 1;
    
emitter.particle.image "g4_animation_fire.gif";
    
emitter.particle.alpha 0.99;
    
emitter.particle.lifetime 0.5;
    
emitter.particle.speed 10;
    
emitter.particle.spin 2;
    
emitter.particle.red 1;
    
emitter.particle.green .4;
    
emitter.particle.blue .4;
  }
  
this.showtime=timevar2 2;
  
setTimer(0.05);
}

function 
onTimeout(){
  
showimg(200);
  if(
this.showtime >timevar2){
    
this.fireangles= {-4.7,-3.1,-1.6,0};
    
=player.x;
    
player.y;
    for(
i=0;i<4;i++){
      if(
player.dir=i){
      
findimg(200).emitter.particle.angle this.fireangles[i]+random(-.5,.5);
    }
  }
  
setTimer(0.05);
  } 

Edit: I removed //#CLIENTSIDE from the gani, I assume I don't need it twice. I forgot I had it in there from when I was testing it as a class.
Reply With Quote
 

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 08:21 AM.


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