Graal Forums

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

oralgnome 09-17-2011 09:31 PM

player.head
 
how would you select the 2nd frame of player.head? instead I get the first 4 frames

i'm using an emitter to show the player's head

PHP Code:

function onTimeout(){
    
setTimer(0.05);
        
with (findimg(100)) {
        
x = player.x;
        
y = player.y;
        
layer = 1;
        
emitter.delaymin = 0.1;
        
emitter.delaymax = 0.2;
        
emitter.nrofparticles = 1;
        
// Basic particle attributes
        
emitter.particle.lifetime = 3;
        
emitter.particle.image = player.head;
        
emitter.particle.mode = 1; // alpha transparent
        
emitter.particle.alpha = 0.5;
        
emitter.particle.zoom = 1;
        
// Movement
        
emitter.particle.speed = 0.2;
        
emitter.addlocalmodifier("range", 1, 3, "alpha", "replace", 0.8, 0);
        
emitter.addlocalmodifier("once", 0, 0, "spin", "replace", 2, 4);
  }
} 


fowlplay4 09-17-2011 09:47 PM

player.head - the image name of the player's current head.

You can draw the 'down' image of the head like this:

PHP Code:

//#CLIENTSIDE
function onCreated() {
  
with (findimg(200)) {
    
x = player.x;
    
y = player.y - 2; // Just drawing it above player for now...
    
image = player.head;
    
temp.dir = 2;
    
// Isolate the Head X: 0 Y: 32 * direction
    
partx = 0;
    
party = 32 * temp.dir;
    
partw = parth = 32; // Width and Height of Head is 32 pixels
  
} 
} 


oralgnome 09-17-2011 10:03 PM

i can't just do emitter.particle.image = findimg(index); though because it won't grab any of the attributes

fowlplay4 09-17-2011 10:13 PM

Quote:

Originally Posted by oralgnome (Post 1668462)
i can't just do emitter.particle.image = findimg(index); though because it won't grab any of the attributes

emitter.particle.image wants an image name not an object/TShowImg. It's partx/y/w/h that 'isolates' it to the one sprite. I don't think part works with emitter.particle though.

I don't know if it's possible to do what you want to do with particle emitters.

Crow 09-17-2011 10:33 PM

Quote:

Originally Posted by fowlplay4 (Post 1668463)
emitter.particle.image wants an image name not an object/TShowImg. It's partx/y/w/h that 'isolates' it to the one sprite. I don't think part works with emitter.particle though.

I don't know if it's possible to do what you want to do with particle emitters.

I believe there is something else for particles that basically does the same as partx, party, partw and parth, but I can't remember what it was.


All times are GMT +2. The time now is 06:37 AM.

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