Graal Forums  

Go Back   Graal Forums > Development Forums > Gani Construction
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 05-30-2010, 10:00 AM
Jiroxys7 Jiroxys7 is offline
Hazard to Graal
Jiroxys7's Avatar
Join Date: Apr 2009
Posts: 343
Jiroxys7 will become famous soon enough
Trying to attach a particle effect gani to the player.

I've never been sure how to do this and i cant seem to find answers. I have a particle effect gani and i'm trying to get it to stick to a particular coordinate on the player and move around with them and such. the closest i can seem to get is using attachplayertoobj or something similar, in which case itll only appear at the player's 0,0. then of course it doesnt move around with me.
__________________
MY POSTS ARE PRONE TO EDITS!
Reply With Quote
  #2  
Old 05-30-2010, 10:01 AM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Try adding 'attachtoowner = true;'
__________________
Reply With Quote
  #3  
Old 05-30-2010, 10:25 AM
Jiroxys7 Jiroxys7 is offline
Hazard to Graal
Jiroxys7's Avatar
Join Date: Apr 2009
Posts: 343
Jiroxys7 will become famous soon enough
cool thanks!

now i dont suppose there would be any way to treat this as an object and place it in the player's hand so it can move based on where their hands are, would there? :9
__________________
MY POSTS ARE PRONE TO EDITS!
Reply With Quote
  #4  
Old 05-30-2010, 10:32 AM
Fulg0reSama Fulg0reSama is offline
Extrinsical Anomaly
Fulg0reSama's Avatar
Join Date: Sep 2009
Location: Ohio
Posts: 3,049
Fulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant future
Uhm... Creative particle scripting might be a way.. Or make graphics that go around the hand for the ganis you are doing and make the illusion of what particles could do (depends how you want to do it)
__________________

Careful, thoughts and opinions here scare people.
Reply With Quote
  #5  
Old 05-30-2010, 10:54 AM
Jiroxys7 Jiroxys7 is offline
Hazard to Graal
Jiroxys7's Avatar
Join Date: Apr 2009
Posts: 343
Jiroxys7 will become famous soon enough
i found a solution! i have it so the particle will trail off while you move. so i'm going to see if i can make the offset change based on your direction. this way, it doesnt look like it's not moving with the arm, and it collects back together when the player stops moving.

ok 2 more questions. 1: whats the best way to do a check to see what the player's direction is, in a gani script?
2: it seems my gani disappears once i leave the room. more specifically, it's only visible to other players in the same room that i activated it. why would this be?
__________________
MY POSTS ARE PRONE TO EDITS!

Last edited by Jiroxys7; 05-30-2010 at 01:02 PM..
Reply With Quote
  #6  
Old 06-02-2010, 12:28 AM
taylor taylor is offline
Chi Patrol
taylor's Avatar
Join Date: Jul 2009
Location: Ventura, California
Posts: 395
taylor is a name known to alltaylor is a name known to alltaylor is a name known to alltaylor is a name known to all
How are you displaying the gani?
Reply With Quote
  #7  
Old 06-02-2010, 12:33 AM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Post the GANI script.
__________________
Reply With Quote
  #8  
Old 06-02-2010, 09:33 PM
Jiroxys7 Jiroxys7 is offline
Hazard to Graal
Jiroxys7's Avatar
Join Date: Apr 2009
Posts: 343
Jiroxys7 will become famous soon enough
PHP Code:
GANI0001


DEFAULTATTR1 hat0
.png
DEFAULTHEAD head19
.gif
DEFAULTBODY body
.png

SCRIPT
function onPlayerEnters()
{
  if (!
particleeffectsenabled) return;
  
with (findimg(200))
  {
    
spin degtorad(0);
    
rotation degtorad(0);

    
with (emitter)
    {
      
delaymin 0.1;
      
delaymax 0.3;
      
nrofparticles 1;
      
emitautomatically true;
      
autorotation false;
      
firstinfront false;
      
emissionoffset = {1.6,1.5,0};
      
attachposition false;
      
checkbelowterrain false;
      
continueafterdestroy false;
      
maxparticles 100000;
      
particleTypes 1;
      
attachtoowner=true;
      
// Light
      
with (particles[0])
      {
        
image "light2s.png";
        
zoom 1;
        
red random(0,0.1);
        
green 1;
        
blue 1;
        
alpha 0.7;
        
mode 0;
        
lifetime 1;
        
angle degtorad(32);
        
zangle degtorad(0);
        
speed 0.25;
        
rotation degtorad(80);
        
spin degtorad(0);
        
partx 0;
        
party 0;
        
partw 0;
        
parth 0;
        
stretchx 1;
        
stretchy 1;
        
sound "";
        
layer 2;
      }
      
      
addlocalmodifier("impulse"0.050.05"movey""add", -0.1, -1); // Wind
      
addlocalmodifier("once"00"angle""replace"degtorad(-200), degtorad(200)); // Random Angle
      
addlocalmodifier("impulse"0.20.2"alpha""add", -0.2, -0.2); // Dim
      
addlocalmodifier("range"12"speed""add"1020); // Spread
      
addlocalmodifier("impulse"2020"red""replace"01); // Recolor
    
}
  }
}
SCRIPTEND 
I was thinking about putting something in another weapon that generated client.vars that i could place in the offset here that change based on the player's direction. but that feels like it might be unnecessary clutter.

edit: urg. yet another problem =X it seems that when i change levels with this, the local modifiers stop working. What would cause that to happen?
__________________
MY POSTS ARE PRONE TO EDITS!
Reply With Quote
  #9  
Old 08-15-2010, 02:47 AM
Admins Admins is offline
Graal Administration
Join Date: Jan 2000
Location: Admins
Posts: 11,693
Admins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud of
Add a call to removemodifiers(); before adding new modifiers (otherwise it will add all the modifiers again on onPlayerEnters and mess it up).
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 Off
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 03:35 PM.


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