Graal Forums

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

Emera 05-07-2011 02:39 PM

Lantern
 
Quick question. How would i make a light2.png follow me?

maximus_asinus 05-07-2011 06:02 PM

Back in my day we would make a gani and then use replaceani when the weapon was fired, not sure if that is the case now.

cbk1994 05-07-2011 06:30 PM

Elaborate on what you want to do. Sounds to me like you want to put a GANI in a player attribute.

Emera 05-07-2011 07:09 PM

I want to have a light effect follow me like a glow around a player.

Twaina 05-10-2011 06:49 PM

player-x player-y

Emera 05-10-2011 07:52 PM

Care to extend on that at all?

Twaina 05-10-2011 08:20 PM

use gani or settime then try so thats changing the x or y position

Emera 05-10-2011 08:34 PM

Um k...

fowlplay4 05-10-2011 11:48 PM

The best method is using a player.attr[n] and a gani script with findimg and the attachtoowner variable set.

yourlightaura.gani

PHP Code:

SCRIPT
function onCreated() {
  
with (findimg(200)) {
    
player.x;
    
player.y;
    
layer 1;
    
attachtoowner true;  // Attaches the light to the player.
    
image "light2.png";
    
red 0;
    
blue 0;
    
green 1;
    
alpha 0.99;
  }
}
SCRIPTEND 

then in a weapon you can set the gani to player's attr:

PHP Code:

//#CLIENTSIDE
function onCreated() {
  
player.attr[2] = "yourlightaura.gani";


Also valid is using light2.png as a sprite in your lantern gani, and setting it's COLOREFFECT.


All times are GMT +2. The time now is 04:57 AM.

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