View Single Post
  #16  
Old 08-15-2014, 03:45 AM
PiX PiX is offline
Registered User
PiX's Avatar
Join Date: Jul 2014
Posts: 9
PiX will become famous soon enough
For future references, this is how a particle emitter which follows the owner can be created in a gani file. Test by setting some attr of a player or npc to the gani file name including the file extension.
PHP Code:
GANI0001
SCRIPT
function onPlayerEnters() {
  
with (findimg(200)) {
    if (
this.iscreated)
      return;
    
player.0.5;
    
player.1;
    
attachtoowner true;
    
with (emitter) {
      
delaymin delaymax 0.05;
      
nrofparticles 1;
      
with (particle) {
        
lifetime 1;
        
image "block.png";
      }
    }
    
this.iscreated true;
  }
}
SCRIPTEND 
If you want to put the effect into a gani which also has animation part, you can put everything SCRIPT through SCRIPTEND at the end of the gani file. If it does not work, check in a npc script or weapon script that the emitter portion of your script actually works. Sometimes the behavior of certain code in a gani script can be unexpected, so be aware.
Reply With Quote