Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Gralat gani script help (https://forums.graalonline.com/forums/showthread.php?t=134263706)

xuntasi 06-30-2011 07:58 PM

Gralat gani script help
 
5 Attachment(s)
I am very new to scripting and really dev of any kind. Could someone help me with a script of how to change the gralat image on my server? I made an image for the new gralats, but when I paste it into the area of the script that previously said gralats, it doesn't show up when I drop the actual gralats in the game. I'd post a copy of the script, but I've gone and accidently deleted it.

Also, when I try to make the gani for the gralat images, the new images don't show up in the gani editor... Idk what to do... I'll upload a copy of the images, and of the gani for what good it'll do...

callimuc 06-30-2011 10:31 PM

2 Attachment(s)
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>=100temp.type 4;
  else if (
rupees>=30temp.type 3;
  else if (
rupees>=5temp.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>=10000temp.type 8;
  else if (
rupees>=5000temp.type 7;
  else if (
rupees>=1000temp.type 6;
  else if (
rupees>=500temp.type 5;
  else if (
rupees>=100temp.type 4;
  else if (
rupees>=30temp.type 3;
  else if (
rupees>=5temp.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):

Attachment 53139

Attachment 53140



I hope I could have helped you with this post :)

xuntasi 07-02-2011 06:35 AM

Yeah, I got it to work now! Thanks! :D

callimuc 07-02-2011 01:51 PM

Np :)


All times are GMT +2. The time now is 05:36 AM.

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