Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 06-30-2011, 07:58 PM
xuntasi xuntasi is offline
Registered User
xuntasi's Avatar
Join Date: Jun 2011
Location: Deadaccountsville, Internet
Posts: 14
xuntasi is on a distinguished road
Question Gralat gani script help

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...
Attached Files
File Type: mng Xunasi_token1.mng (2.0 KB, 318 views)
File Type: mng Xuntasi_token2.mng (2.0 KB, 223 views)
File Type: mng Xuntasi_token3.mng (2.0 KB, 222 views)
File Type: mng Xuntasi_token4.mng (2.0 KB, 234 views)
File Type: gani xuntokens.gani (371 Bytes, 250 views)
__________________
This account is DEAD!
Reply With Quote
  #2  
Old 06-30-2011, 10:31 PM
callimuc callimuc is offline
callimuc's Avatar
Join Date: Nov 2010
Location: Germany
Posts: 1,015
callimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to behold
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):

Name:  gralats-edited.png
Views: 1263
Size:  2.3 KB

gralats-edited.gani



I hope I could have helped you with this post
__________________
MEEP!
Reply With Quote
  #3  
Old 07-02-2011, 06:35 AM
xuntasi xuntasi is offline
Registered User
xuntasi's Avatar
Join Date: Jun 2011
Location: Deadaccountsville, Internet
Posts: 14
xuntasi is on a distinguished road
Yeah, I got it to work now! Thanks!
__________________
This account is DEAD!
Reply With Quote
  #4  
Old 07-02-2011, 01:51 PM
callimuc callimuc is offline
callimuc's Avatar
Join Date: Nov 2010
Location: Germany
Posts: 1,015
callimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to behold
Np
__________________
MEEP!
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 03:24 AM.


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