Quote:
Originally Posted by Raeiphon
Any basic examples on how to get an emitter to work inside a gani, and how to display that gani through showani?
|
If you're attaching the gani to the player, use an attribute. Example:
HTML Code:
player.attr[4] = "sword.gani";
You'd mainly use attributes if you were wanting something to follow a player that other people could also see. Let's say a light- or an aura; for example.
HTML Code:
showani(index, this.x, this.y, direction, gani, params);
showani(300, this.x, this.y, 2, "sword", NULL);
showani(1, this.x, this.y, 2, "sword", NULL);
As you can see, it's clientside and also serverside! You can modify this also, like so
HTML Code:
with(findimg(index))
{
//and ok
}
Not too sure why you'd decide to use this over the player.attr, maybe if you wanted to display something that wasn't connected to the player, yet interacted with the player in some way?
Gani scripting is generally used when you're wanting something to show for everyone, such as an effect. You'd most-likely use gani script in combination with the player.attr command.
Inside the gani, you'd insert something like this:
HTML Code:
SCRIPT
function onPlayerEnters()
{
with(findimg(200))
{
//doParticle effects
}
setTimer(0.05);
}
function onTimeout()
{
findimg(200).# = ##;
setTimer(0.05);
}
SCRIPTEND
As you can see, you can also pretty much add anything inside of the gani. You can't edit this locally, the NPC-server would read the script from the gani inside the servers FTP.
You'd now need to know more about particles, I suggest opening a few Graal Kingdoms spell effects, they're mostly particles and they help you to understand how they work. [They're the gani's, 'g2k2_spell#']