Couple of questions, part 3
Displaying 1-4 of 4 total.
1
Please enter a numerical value for the importance of this sticky.
Enter 0 to unsticky.
ErayMan

1. What is hookretrace used for? I have search in vergec.txt, but i'm not sure to understand what it says. I read a post some time ago about someone that wanted to put a textbox with the amount of gp in the corner of each map, and somebody (sorry for not remembering the name) answer:

hookretrace(GPTextBox);

(well, something like that) in every autoexect event.
But, can't i just say GpTextBox(); in the autoexect?
What's the difference?

2. I know malloc have something to do with allocating memory. Is it vital to a program? Will the use of malloc will make a game more stable? What if i never use it? Will it change something?

3. What is GrabRegion use for? i have seen it in many code source but still i'm not sure of it,s meaning even after reading the .txt file.

Sorry for all this questions recently:)

thanks
-ErayMan



Beans are an excellent source of proteines! So please, be nice with them ...

Posted on 2000-12-30 22:46:01

andy

1. Hookretrace is for when you want a function to be drawn every time the map is drawn. So, calling GPTextBox would draw your GP box, sure, but as soon as the tiles are redrawn, your GP box is gone. (since the tiles were just dumped on top) Putting it in a hookretrace would cause it to be drawn every time the map was rendered, so the box would "stick", even while the player entity was walking around the map.

Personally, I try to avoid using HookRetrace for things like that, and reserving it for special effects, like weather.

2. You got that one right. Malloc asks the OS for a chunk of memory, and hands it over to you. To be honest, most users won't need this except for grabregion.

It's important to know that you must free any memory you malloc (loadimage and loadraw too) with the free() command.

3. GrabRegion is basicly the opposite of copysprite. You create a buffer (with malloc) and call it, and it'll dump that part of the screen in your buffer. You can then use copysprite to blit it back on-screen.



'Never confuse a single defeat with a final defeat.' -F. Scott Fitzgerald

Posted on 2000-12-31 00:04:07

Lunarbeam

But...why? Why would you wanna dump the thing back on right after you pulled it off? Is there anything you can do to it while it's in memory?



Posted on 2000-12-31 07:32:29

Feyr

Here's a couple things I've used GrabRegion for in the past:

1. Taking screenshots of portions of the screen. I used this in a birdwatching minigame. It wasn't much fun, but it used GrabRegion ;) I wrote the partial screenshots to files and loaded them when the player looked at the scrapbook.

2. I copied the tile in front of the player, blew it up to twice normal size and put it on the screen with informational text. I had modifying tiles over the standard dirt, stone, grass, etc that changed the fertility of the ground (in a farming sim I started a long while back) and I didn't want to be copying several tiles from the VSP data when I could copy use a single copy.

3. Um...okay, I can't think of anything else I've done, and there's probably better ways to accomplish the above (It's been about a year since I last downloaded a copy of Verge ;) In short, GrabRegion isn't necessary for a good game, but there are a couple neat applications for it if you look hard enough.

--Feyr pops up from nowhere with a ramble



Posted on 2000-12-31 13:33:55


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.