Graal Forums  

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

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 09-17-2011, 09:31 PM
oralgnome oralgnome is offline
doesnt afraid of anything
oralgnome's Avatar
Join Date: Sep 2011
Posts: 34
oralgnome is an unknown quantity at this point
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)) {
        
player.x;
        
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"13"alpha""replace"0.80);
        
emitter.addlocalmodifier("once"00"spin""replace"24);
  }


Last edited by oralgnome; 09-17-2011 at 09:48 PM..
Reply With Quote
  #2  
Old 09-17-2011, 09:47 PM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
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)) {
    
player.x;
    
player.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
  


__________________
Quote:
Reply With Quote
  #3  
Old 09-17-2011, 10:03 PM
oralgnome oralgnome is offline
doesnt afraid of anything
oralgnome's Avatar
Join Date: Sep 2011
Posts: 34
oralgnome is an unknown quantity at this point
i can't just do emitter.particle.image = findimg(index); though because it won't grab any of the attributes
Reply With Quote
  #4  
Old 09-17-2011, 10:13 PM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
Quote:
Originally Posted by oralgnome View Post
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.
__________________
Quote:
Reply With Quote
  #5  
Old 09-17-2011, 10:33 PM
Crow Crow is offline
ǝɔɐɹq ʎןɹnɔ
Crow's Avatar
Join Date: Dec 2006
Location: Germany
Posts: 5,153
Crow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond repute
Quote:
Originally Posted by fowlplay4 View Post
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.
Reply With Quote
Reply


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 10:16 AM.


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