Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   gui displays with ganis and particles effects with imgs (https://forums.graalonline.com/forums/showthread.php?t=134259385)

Rave_J 06-01-2010 11:49 PM

gui displays with ganis and particles effects with imgs
 
is it possible to have ganis and particles to display health and other things then just a basic img like example hearts the can spin around when u lost health red particles effect when u gain a heart its blue ect just a example

cbk1994 06-01-2010 11:50 PM

Yes, look into GANI scripts. There are some posts about it here.

Rave_J 06-02-2010 05:42 AM

where? i dont c no link

fowlplay4 06-02-2010 05:54 AM

Quote:

Originally Posted by Rave_J (Post 1579855)
where? i dont c no link

Search.

cbk1994 06-02-2010 11:06 AM

Quote:

Originally Posted by cbk1994 (Post 1389184)
All you do is make a text file and save it with a .gani extension. In the text file, it should look like this:

PHP Code:

SCRIPT
function onCreated()
{
  
doBlah();
}
SCRIPTEND 

It is just like any other script, but it is clientside. There is no need to have //#CLIENTSIDE, as it is always clientside.

You also cant use triggerserver to trigger the GANI to perform serverside functions.

You will want to put the variables (health, etc) that you want access to into player attributes (read this thread). Then, you can display them however you want.

PHP Code:

function onCreated() {
  
this.trigger("timeout", null);
}

function 
onPlayerEnters() {
  
this.trigger("created", null);
}

function 
onTimeOut() {
  
with (findimg(200)) {
    
image = "myhealthbar.png";
    
    
x = player.x + 1;
    
y = player.y - 3;
    
    
attachtoowner = true; // follow player
    
temp.shouldBe = (50/100) * player.attr[5];
    
    if (
partW < shouldBe) {
      
partW ++;
    } else if (
partW > shouldBe) {
      
partW --;
    }
  }
  
this.setTimer(0.05);
} 

This is a simple example of how you could make a health bar that "slides" from one HP to another instead of jumping (width decreases over time instead of immediately). You can also add particle effects or whatever in another showimg.

Rave_J 06-02-2010 04:26 PM

ty chris rep++


All times are GMT +2. The time now is 10:08 PM.

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