Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Exactly what is... (https://forums.graalonline.com/forums/showthread.php?t=73638)

killerogue 04-24-2007 08:18 AM

Exactly what is...
 
A gani script? Where does it go? What does it do? Does it have any special things I should know about?

Admins 04-24-2007 10:03 AM

It's in the ganis :D In a SCRIPT SCRIPTEND block
In GS1 it is limited in functionality (since it can be edited), in GS2 it is compiled on the server and can do everything that other client scripts can do as well.

You can either use it in a gani with setani/this.ani, or you "attach" it to a player or npc by doing object.attr[index] = "mygani.gani";

One thing that is special is that you can access the object to which the gani belongs / is attached to by "player". Also onPlayerEnters() receives the gani parameters (setani("aniname",param1,param2,...)) as function parameters.

Rapidwolve 04-24-2007 09:22 PM

Quote:

Originally Posted by killerogue (Post 1302594)
A gani script? Where does it go? What does it do? Does it have any special things I should know about?

It obiviously goes inside a gani <_<.

Example

PHP Code:

player.attr[10] = "hp.gani";
player.attr[11] = {hpflagmaxhpflag}; 

PHP Code:

SCRIPT
function onCreated() onTimeout();
function 
onPlayerEnters() onTimeout();

function 
onTimeout()
{
  
showtext10, (player.6), (player.3), "Arial""b"format("HP:%f/%i"player.attr[11][0], player.attr[11][1]);
  
changeimgvis(102);
  
changeimgzoom(100.50);

  
setTimer(.05);
}
SCRIPTEND 

From what I hear its much better to use GANI scripting gives off less lag then other types of scripting

Skyld 04-24-2007 09:54 PM

Quote:

Originally Posted by Rapidwolve (Post 1302699)
From what I hear its much better to use GANI scripting for certain types of script as

as...?

Pretty much, GANI scripts are good when you want to display something about the player to all other players but clientside.

Since the GANI is displayed to everyone, they all see the same clientside effects when they are in a GANI script. If you've ever been on Era and seen those floating text messages saying "-5" or "Dead" or whatever, those are a GANI script.

Rapidwolve 04-24-2007 10:35 PM

Quote:

Originally Posted by Skyld (Post 1302721)
as...?

Pretty much, GANI scripts are good when you want to display something about the player to all other players but clientside.

Since the GANI is displayed to everyone, they all see the same clientside effects when they are in a GANI script. If you've ever been on Era and seen those floating text messages saying "-5" or "Dead" or whatever, those are a GANI script.

Sorry fixed and reworded

zokemon 04-24-2007 11:27 PM

Gani scripts are awesome :)
They can be a pain though especially when it comes to sending params to it (was alot easier in GS1) when it is attached to an object using obj.attr[i] = "file.gani"
Most people get around this buy just making the params into a string though and tokenizing the param when it gets to the gani.


All times are GMT +2. The time now is 06:02 PM.

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