Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Simple Script Issue / Plants on GK (https://forums.graalonline.com/forums/showthread.php?t=87267)

Drakeero 08-05-2009 11:15 PM

Simple Script Issue / Plants on GK
 
Alright, anyone on GK long enough to see Bomboria has probably seen the farming patch there. In the farming patch are npcs that appear as the different growing stages of corn.

I'm trying to change them to different stages of another plant. Now, I've looked at the script itself and it says:

setcharani corn,4;

When I check the images/download folder I find one image for corn.png with 4 seperate images inside. I'm trying to do wheat now. The wheat image name is g2k2wheat0.png so I try typing in:

g2k2wheat0,6;

I use 6 because wheat has more images then corn. When I close the window I get stuck with something very very dead and very twiggy. I went back and tried 4,; without any luck.

So how can I create a farm area with different plants?

cbk1994 08-05-2009 11:56 PM

I'm not sure exactly what you mean, but you're going to have to put the image in a GANI. The way it works is that the image in it is showing an index in that GANI, but it's using "PARAM1". PARAM1 is the second part of setCharAni. When you do setChairAni("corn", 3); you are then showing the third index.

To make one for wheat, you need to create a GANI with one frame, place a single sprite inside the first frame, and then set the index to "PARAM1" (note that you may want to specify a default param1 at the bottom right). You've then got to import all your image steps as sprites into the GANI. You can upload that, and then you'd do

PHP Code:

setCharAni("wheat"3); 

You may want to take a look at the way it's done for "corn.gani" in your levels/ganis/* folder ("corn" in the script is referring to corn.gani).

http://img406.imageshack.us/img406/5928/corn.png

kia345 08-05-2009 11:58 PM

Quote:

Originally Posted by cbk1994 (Post 1513228)
I'm not sure exactly what you mean, but you're going to have to put the image in a GANI.

He wants to put a farming level similar to that in a town on Zormite

cbk1994 08-06-2009 12:06 AM

Quote:

Originally Posted by kia345 (Post 1513230)
He wants to put a farming level similar to that in a town on Zormite

In that case there's no doubt already a GANI with what he wants. Probably named "wheat", but I don't have it downloaded.

PHP Code:

function onCreated() {
  
setCharAni("wheat"6);



Drakeero 08-06-2009 01:57 AM

Quote:

Originally Posted by cbk1994 (Post 1513228)
I'm not sure exactly what you mean, but you're going to have to put the image in a GANI. The way it works is that the image in it is showing an index in that GANI, but it's using "PARAM1". PARAM1 is the second part of setCharAni. When you do setChairAni("corn", 3); you are then showing the third index.

To make one for wheat, you need to create a GANI with one frame, place a single sprite inside the first frame, and then set the index to "PARAM1" (note that you may want to specify a default param1 at the bottom right). You've then got to import all your image steps as sprites into the GANI. You can upload that, and then you'd do

PHP Code:

setCharAni("wheat"3); 

You may want to take a look at the way it's done for "corn.gani" in your levels/ganis/* folder ("corn" in the script is referring to corn.gani).



Wow. Magic. Thanks for the help, I really appreciate it. Now I can add a lot more customization to the town.


All times are GMT +2. The time now is 08:29 PM.

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