Graal Forums  

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

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 08-05-2009, 11:15 PM
Drakeero Drakeero is offline
Registered User
Join Date: Jan 2004
Posts: 507
Drakeero will become famous soon enough
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?
__________________
"Wait.... what?"
Reply With Quote
  #2  
Old 08-05-2009, 11:56 PM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
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).

__________________
Reply With Quote
  #3  
Old 08-05-2009, 11:58 PM
kia345 kia345 is offline
z0rbi 4 life 🤘
kia345's Avatar
Join Date: Dec 2006
Location: delteria
Posts: 6,737
kia345 has a reputation beyond reputekia345 has a reputation beyond reputekia345 has a reputation beyond reputekia345 has a reputation beyond reputekia345 has a reputation beyond reputekia345 has a reputation beyond reputekia345 has a reputation beyond reputekia345 has a reputation beyond reputekia345 has a reputation beyond reputekia345 has a reputation beyond reputekia345 has a reputation beyond repute
Quote:
Originally Posted by cbk1994 View Post
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
__________________
pojo
Reply With Quote
  #4  
Old 08-06-2009, 12:06 AM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by kia345 View Post
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);

__________________
Reply With Quote
  #5  
Old 08-06-2009, 01:57 AM
Drakeero Drakeero is offline
Registered User
Join Date: Jan 2004
Posts: 507
Drakeero will become famous soon enough
Quote:
Originally Posted by cbk1994 View Post
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.
__________________
"Wait.... what?"
Reply With Quote
Reply


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 09:12 AM.


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