GetZoneLocation function?
Displaying 1-4 of 4 total.
1
Please enter a numerical value for the importance of this sticky.
Enter 0 to unsticky.
Cowbacca

Hello, I have recently started making my first game in Verge, and I have just added an inventory. I have put some berries on various tiles, which the character can pick up. However, I am finding that I have to use a seperate Zone for each berry as my script tells Verge to change a specific point on the map. I should probably show you my code:
void PickupBerries()
{
Berries++;
SetZone(24,19,0);
SetTile(24,19,2,639);
}

void PickupBerries2()
{
Berries++;
SetZone(25,17,0);
SetTile(25,17,2,639);
}

void PickupBerries3()
{
Berries++;
SetZone(27,17,0);
SetTile(27,17,2,639);
}


I don't want to have to do this for every berry tile, so is there some kind of GetLocation function that I have missed? Or is there another way? It may be really obvious but I'm pretty new to this, so please don't hurt me! =P

Posted on 2008-01-13 06:33:12

Kildorf

Hi there. What you're looking for, I would say, is the event variables.

Specifically, what you can do, is replace all of your different event functions with a single one, and then use event.tx and event.ty to get the current tile.

void PickupBerries()
{
Berries++;
SetZone(event.tx,event.ty,0);
SetTile(event.tx,event.ty,2,639);
}


Then, each zone for the berries just needs to call this function (in fact, you could just use one zone for all of the berries that calls this function. Since it works on tile coordinates, each instance would only remove itself.)

Hope that helps.

Posted on 2008-01-13 07:41:39 (last edited on 2008-01-13 07:42:48)

Cowbacca

Ah yes, thankyou.

That helps alot!

Posted on 2008-01-13 09:36:13

Kildorf

Glad I could help! :)

Make sure to make lots of noise on the forums here when you have something to look at. We like to look at stuff. :D

Posted on 2008-01-13 16:40:58


Displaying 1-4 of 4 total.
1
 
Newest messages

Ben McGraw's lovingly crafted this website from scratch for years.
It's a lot prettier this go around because of Jon Wofford.
Verge-rpg.com is a member of the lunarnet irc network, and would like to take this opportunity to remind you that regardless how babies taste, it is wrong to eat them.