The default Gralat script from Graal should look like this (as class called Gralats):
PHP Code:
function onCreated() {
showcharacter();
updategani();
}
function onUpdategani() {
updategani();
}
function updategani() {
temp.type = 1;
if (rupees>=100) temp.type = 4;
else if (rupees>=30) temp.type = 3;
else if (rupees>=5) temp.type = 2;
setcharani("gralats", temp.type);
}
function onPlayerTouchsMe() {
player.rupees += rupees;
rupees = 0;
destroy();
}
There you see at function updategani() a following part:
PHP Code:
setcharani("gralats", temp.type);
So if you want to change that, just make a new gani (didn´t take a look at yours) and add there your new images (please make sure not to call the gani name and the images name like the default stuff thats annoying). After that you can change the setcharani() part which could look like:
PHP Code:
setcharani("YourGaniNameHere", temp.type);
If you want to know how to add additional Gralats, take a look at this. This is an edited version from the function updategani() :
PHP Code:
function updategani() {
temp.type = 1;
if (rupees>=10000) temp.type = 8;
else if (rupees>=5000) temp.type = 7;
else if (rupees>=1000) temp.type = 6;
else if (rupees>=500) temp.type = 5;
else if (rupees>=100) temp.type = 4;
else if (rupees>=30) temp.type = 3;
else if (rupees>=5) temp.type = 2;
setcharani("YourGaniName", temp.type);
}
Explanation:
The
PHP Code:
if (rupees>= Number)
is checking, how much "worth" the Gralat is. The temp.type is usually just the direction. Since normal gani´s dont have 8 directions, you will have to edit the gani a bit. Here is an example Gani with the new sprites (gralats where made by dusty and got a little recolor):
gralats-edited.gani
I hope I could have helped you with this post
