Remember Item forgets

Pluging along with my plug-in. I made an item and one of those bags to put it in to set on the map. I placed several on a POG tile. The NPC there gives me the quest. I dutifully open the bags. They change to used. I take the special items. When I got them all, the NPC says to deliver them someplace and takes off to meet me there. Everything works right to that point. However, if I return to the map, somebody zipped up my bags again and refilled them with the items. They do not stay with the used picture. If I walk off before getting everything, this happens too, but the NPC continues the storyline saying I am only partly done. If all are gathered the first time, the NPC does not return due to a global that removes it. I tried making another new item I called special cheese and put it near the tents south of Fantrima. Same problem. I launched a regular apple next to the cheese. Same problem.

I have OS9. Items are special or various, remember/take/back. Bags are special, block/remember/back. Using normal instead of back did not help. Maybe I am using "Plug-in load calls" wrong. I create an event to add everything to a location: stamps, NPCs, blocked cell access, items and so forth. I then add this event and its location to the load calls.

Thank you board citizens.

------------------
Insert profound thought
or clever witticism here

Quote

Originally posted by Codewizard:
**Pluging along with my plug-in. ...
**

I haven't gotton to that point in my building. But if a stamp is used to call the items to appear, then are you checking to see if the items have been used before you place them? There has to be a way. They are stored in the map file, right?

still thinking...

I think I see your problem. "Remember" only works if you place the items directly via the map editor (not advised...). When you place them with load-calls you need to use a global to stop the item from being taken twice (note: != means not equal to):

If gb_PLUGINITIALS_bagtaken != 5 then
Place bag item
Else
Place Empty bag item

That would be how you would do it. A conditional (the if/then statement) and 2 linked actions, the place bag, and place empty bag item actions. If you ARE placing things via the map editor, then remember should work.

Just a note: When making a plugin ALWAYS have something, initials, name, etc. to distinguish your globals, pictures, events, etc. from other plugins, hence the PLUGININITIALS part of the global name.

------------------
CI-I@()s
(url="http://"http://www.evula.org/world-of-cha0s/")The Homepage of Cha0s(/url)

Quote

Originally posted by Codewizard:
Pluging along with my plug-in. .... I placed several on a POG tile. .. However, if I return to the map, somebody zipped up my bags again and refilled them with the items.

Hi Codewizard. The problem you are having is one that I ran into early on in my plugin. Remember only works on maps of your own creation. Since you are not changing the PoG map other than to add things to it with a plugin load call, every time you return to that map the load call puts down all the things you wanted there originaly. The way to get around this is with globals and conditionals.

If gb_goodybag < 1, place goodybag at x,y.
Open bag event: set gb_goodybag = 1.
If gb_goodybag = 1, place stamp of empty goodybag at x,y.

CHa0s had the same idea, but I don't think he realized that you are trying to do this on a PoG map where you have no access to the map editor. You will have to create the stamp of the empty goodybag or make another item which is the empty goodybag which you do not take.

If you place an item on a map of your own creation and have 'take' and 'remember' checked, all works fine up to a point. The point where it doesn't work is if the player gets the item and then quits the game and re-opens that game without the plugin checked. If the player then starts that game with your plugin checked, the map is in memory and the item is no longer available. If this is a quest item he needs, again you will have to use globals and conditionals to make sure that the item is indeed available. The globals all reset to null if one de-selects the plugin, but the maps are remembered.

What I had to do for important items is set it up so that a conditional checked two things. First, was the global less than 1. Second, was the item not in inventory. If both were true, only then did the item appear. Because my items could not be sold or dropped, this worked. I hope this all helps. ~RD

------------------
My Doctor said I was having too much wine, women, and song - so I gave up singing because 2 out of 3 is not so bad.
The (url="http://"http://www.evula.org/rduck/")Kingdom of Garendall(/url) sectional map is easily printed from gif format pages.
Find those areas you missed the first time around. You'll want to explore those hidden areas now made accessible with Spells Expander.

Thanks everybody. Yes, I thought, maybe it was something like that. I was sure I was doing something wrong with the remember & take that I did not want to try the globals, conditionals and stamps bit until I was certain I wasn't overlooking something simple. Sigh. Several perfectly good coding hours wasted. 😛 Well, that is what is called experience ... or denting the wall with my head.

Quote

Originally posted by CI-Ia0s:
**(note: != means not equal to)
**

I know. 🙂 I am multi-lingual, C++, BASIC, COBOL, HTML, C, assembler, Visual Basic, Visual C++, FORTRAN, Visual InterDev, SQL, and a bunch of things I can read if I have to, am forgetting, or have long since forgot. One of my favorite signatures is "Writing code for over 25 years. I expect it to be ready for release any day now." Coldstone is proving quite challenging without classes, SELECT-CASE and as many Else-If's as I want. These posts are meant for everybody, so I am glad you included that explanation.

Quote

**Just a note: When making a plugin ALWAYS have something, initials, name, etc. to distinguish your globals, pictures, events, etc. from other plugins, hence the PLUGININITIALS part of the global name.
**

Yes, I am trying to remember to do that and remember to not do it for item names. I am using "ac", without the quotes, of course. It refers to some characters in the game. If anyone has used this already, tell me and I will change it before things get even farther along.

Mr. Ducky, do you know which would create less overhead the goodybag item or stamp? Not that I plan to make 1000 of them, but it would be useful to know for large programs.
------------------
Insert profound thought
or clever witticism here

Edited to attempt to fix quoting.
(This message has been edited by Codewizard (edited 04-28-2003).)

(This message has been edited by Codewizard (edited 04-28-2003).)

Quote

Originally posted by Codewizard:
Mr. Ducky, do you know which would create less overhead the goodybag item or stamp? Not that I plan to make 1000 of them, but it would be useful to know for large programs.

They both ought to be about the same. I wouldn't worry about it.

Items are easier to work with, in my opinion, with what you are doing. You can just set both to load in the same map coordinate, as opposed to a stamp which you will have to do some guess and check work to establish the exact pixel coordinate.

------------------
(url="http://"http://stark.evula.net/pogwalkthrough.htm")PoG Walkthrough and Compendium(/url) | (url="http://"http://stark.evula.net/plugins/dev_tools.htm")PoG Dev Tools(/url) | (url="http://"http://stark.evula.net/plugins/spells_expander.htm")Spells Expander(/url)
(url="http://"http://stark.evula.net")Stark.evula.net(/url) | (url="http://"http://www.evula.net")EVula.net(/url) | (url="http://"http://mail.ambrosiasw.com/mailman/listinfo/coldstone_dev")Coldstone-dev mailing list(/url) | (url="http://"http://ucplugs.evula.net/pog.html")PoG Upcoming Plug-Ins Directory(/url)

Quote

Originally posted by Codewizard:
Mr. Ducky, do you know which would create less overhead the goodybag item or stamp?

Hi Ms. Codewizard. "RD" will do just fine. 🙂 I do not know for sure but I believe you will have less trouble with a stamp. I'm sure someone here will correct me if I'm wrong.

I have an item in my plugin which has to be counted, as the character "pays" for information by collecting a large number of them. There are about 300 of them in the plugin. When I used take/remember, each time I returned to a map the ones I'd picked had grown back. Not good. If I put each one in place with a global/conditional, then the inventory list would show each as a unique item. Also not good. Solution: I created a lot of numbered "pseudo-items" with the picture of the real item and an action link that adds one of the real items to inventory and sets the global to prevent its being picked twice. This pseudo-item does not have "take" checked because that would place each "wrong" one in inventory. The pseudo-item does disappear off the map as you pluck it and the only down side is that the "label" does not float up over your head as it does when you pick up an apple. On the maps of my own, the real item (with take/remember) works just fine including the floating label.

Back to the point: When I create about 25 of these items, my machine starts to slow down and gives a message that CGE is running low on memory. I have to quit Coldstone and re-start or the program will crash. When I make a whole bunch of stamps, this does not happen. In my case, stamps will not work because removing a stamp will not take the right one off the map since removal takes the top one off the list which might not be the one I found.

I hope that all helps. BTW, I wish I had your codeing knowledge. I grew up with black and white TV instead of computers. ~RD

Edit: Listen to Stark (who posted while I was typing this), he knows more than I do. 🙂

------------------
My Doctor said I was having too much wine, women, and song - so I gave up singing because 2 out of 3 is not so bad.
The (url="http://"http://www.evula.org/rduck/")Kingdom of Garendall(/url) sectional map is easily printed from gif format pages.
Find those areas you missed the first time around. You'll want to explore those hidden areas now made accessible with Spells Expander.

(This message has been edited by Rubber Ducky (edited 04-28-2003).)

Quote

Originally posted by Rubber Ducky:
Edit: Listen to Stark (who posted while I was typing this), he knows more than I do.

Heh.

If he were going to create a massive number of "empty bags" then I would agree that a stamp is the way to go. But since he really only needs 1 empty bag item(since it doesn't do anything but sit there), then I'd just go the item route and load it anytime a bag is opened. Less math hassle. 🙂

------------------
(url="http://"http://stark.evula.net/pogwalkthrough.htm")PoG Walkthrough and Compendium(/url) | (url="http://"http://stark.evula.net/plugins/dev_tools.htm")PoG Dev Tools(/url) | (url="http://"http://stark.evula.net/plugins/spells_expander.htm")Spells Expander(/url)
(url="http://"http://stark.evula.net")Stark.evula.net(/url) | (url="http://"http://www.evula.net")EVula.net(/url) | (url="http://"http://mail.ambrosiasw.com/mailman/listinfo/coldstone_dev")Coldstone-dev mailing list(/url) | (url="http://"http://ucplugs.evula.net/pog.html")PoG Upcoming Plug-Ins Directory(/url)

And what is the correct stamp coordinates again? Upper left of the size of the image? Is that what you look for?

Quote

**
I am multi-lingual, C++, BASIC, COBOL, HTML, C, assembler, Visual Basic, Visual C++, FORTRAN, Visual InterDev, SQL
**

Holy whaa! I'm impressed! Cool! I've managed to harness English and html, but that's about it.

------------------
-- Debra
Danillitphil Productions

Quote

Originally posted by Debra:
And what is the correct stamp coordinates again? Upper left of the size of the image? Is that what you look for?

Stamp coordinates are done in pixels. So take your movement tile coordinate and multiple them by their size. (ie, if you have a 32X32 movement tile and want to place a stamp at the movement tile coordinate (10,10), then the lower right hand corner of this tile would be (320, 320). You get the upper left by subtracting 1 tile from it, so it would be (288, 288) ).

However, there is a problem in this. Most pictures aren't exact and have "white space" behind them. When you place an item, I'm not entirely sure how Coldstone determines where within the tile to put the object, since the object could be smaller or larger than that space. So if you convert to a stamp you will have to look where the object is placed via Coldstone, then adjust your stamp coordinate to fit.

Granted, this is only if you want to be exact. But then, the details are many times important... 🙂

------------------
(url="http://"http://stark.evula.net/pogwalkthrough.htm")PoG Walkthrough and Compendium(/url) | (url="http://"http://stark.evula.net/plugins/dev_tools.htm")PoG Dev Tools(/url) | (url="http://"http://stark.evula.net/plugins/spells_expander.htm")Spells Expander(/url)
(url="http://"http://stark.evula.net")Stark.evula.net(/url) | (url="http://"http://www.evula.net")EVula.net(/url) | (url="http://"http://mail.ambrosiasw.com/mailman/listinfo/coldstone_dev")Coldstone-dev mailing list(/url) | (url="http://"http://ucplugs.evula.net/pog.html")PoG Upcoming Plug-Ins Directory(/url)

When I look at a map, any map, in the map editor, I see the pixel coordinates at the bottom of the editor. Can I use that to figure out my pixels on the map instead of using movement tiles? Then do I know how far it is from the lower right of the image to the upper left to determine where the image will land?

------------------
-- Debra
Danillitphil Productions

Quote

Originally posted by Debra:
When I look at a map, any map, in the map editor, I see the pixel coordinates at the bottom of the editor.

That works for me. When you select a stamp picture, it also gives the pixel dimensions of the stamp. For all of my own pictures, I use Graphics Converter and under the Edit Menu is an operation "smart trim" which will remove all the surrounding white area. Then the pixel dimensions are accurate. ~RD

Edit: You can either use those co-ordinates to place the stamp southeast of where your pointer is, or subtract the stamp's pixel count to place it northwest of the pointer.

------------------
My Doctor said I was having too much wine, women, and song - so I gave up singing because 2 out of 3 is not so bad.
The (url="http://"http://www.evula.org/rduck/")Kingdom of Garendall(/url) sectional map is easily printed from gif format pages.
Find those areas you missed the first time around. You'll want to explore those hidden areas now made accessible with Spells Expander.

(This message has been edited by Rubber Ducky (edited 04-28-2003).)

Quote

Originally posted by Debra:
When I look at a map, any map, in the map editor, I see the pixel coordinates at the bottom of the editor. Can I use that to figure out my pixels on the map instead of using movement tiles?

Yep. this works fine if you have the maps to work with(CodeWizard is designing a plug-in and thus will not have access to many of the maps that she may wish to drop an item or stamp into).

Quote

Then do I know how far it is from the lower right of the image to the upper left to determine where the image will land?

If you plan on placing a stamp on one of your own maps, an easy way to get the coordinates is to drop the stamp onto your map where you want it placed, take note of the coordinates of its upper left pixel, and then remove it/place it with your stamp control event action.

(edit) made some corrections (/edit)
------------------
(url="http://"http://stark.evula.net/pogwalkthrough.htm")PoG Walkthrough and Compendium(/url) | (url="http://"http://stark.evula.net/plugins/dev_tools.htm")PoG Dev Tools(/url) | (url="http://"http://stark.evula.net/plugins/spells_expander.htm")Spells Expander(/url)
(url="http://"http://stark.evula.net")Stark.evula.net(/url) | (url="http://"http://www.evula.net")EVula.net(/url) | (url="http://"http://mail.ambrosiasw.com/mailman/listinfo/coldstone_dev")Coldstone-dev mailing list(/url) | (url="http://"http://ucplugs.evula.net/pog.html")PoG Upcoming Plug-Ins Directory(/url)

(This message has been edited by Stark Bledfast (edited 04-29-2003).)

Okay, so it's the upper right pixel to shoot for? Thanks for your help.

------------------
-- Debra
Danillitphil Productions

Nono!!! Its the upper left!

Stark made a typo 😛

------------------
CI-I@()s
(url="http://"http://www.evula.org/world-of-cha0s/")The Homepage of Cha0s(/url)

Stark's wrong? Stark's WRONG!!!??? STARK'S WRONG!!!!!! Let's alert the media!!!!

------------------
-- Debra
Danillitphil Productions

Quote

Originally posted by CI-Ia0s:
Stark made a typo

I think that was very generous calling it a typo. And I thought I knew a Miss Steak when I saw one.

------------------
My Doctor said I was having too much wine, women, and song - so I gave up singing because 2 out of 3 is not so bad.
The (url="http://"http://www.evula.org/rduck/")Kingdom of Garendall(/url) sectional map is easily printed from gif format pages.
Find those areas you missed the first time around. You'll want to explore those hidden areas now made accessible with Spells Expander.

Debra,
It helps that I am a geek with no life. :frown:

RD,
I watched black & white television sets, too. I was born in the 1960's, 31 days into the 1960's.

Stark,
Just for reference, I am not a he. I am one of those other people you may have seen walking around from time to time. 😄 Although, I was once mistaken for a he many years (and a few pounds) ago in a dark nightclub during a Halloween party by a man who then decided he had had his last drink of the night. Apparently, Oxford, IA is a man's kind of town.

I will try to implement these ideas in the next couple of days.

------------------
Insert profound thought
or clever witticism here

Quote

Originally posted by Debra:
Stark's wrong? Stark's WRONG!!!??? STARK'S WRONG!!!!!! Let's alert the media!!!!

Heh. 🙂

Indeed, typo/mistake/typed too fast and my brain couldn't keep up. Yeah, one of those things, heh. I've corrected my post above.

Stamps are indeed placed by the upper left hand corner of the picture being the pixel coordinates that you specify. However, if you simply convert movement coods -> pixel coords by simply multiplication, then you will get the bottom right hand corner of the movement tile. Thus, you need to subtract 1 movement tile(x and y coord) to get the upper left hand corner.

So the formula is to convert movement tile coords to pixel coords is:
( (X coordinate x movement tile size) - movement tile size ),
( (Y coordinate x movement tile size) - movement tile size )

------------------
(url="http://"http://stark.evula.net/pogwalkthrough.htm")PoG Walkthrough and Compendium(/url) | (url="http://"http://stark.evula.net/plugins/dev_tools.htm")PoG Dev Tools(/url) | (url="http://"http://stark.evula.net/plugins/spells_expander.htm")Spells Expander(/url)
(url="http://"http://stark.evula.net")Stark.evula.net(/url) | (url="http://"http://www.evula.net")EVula.net(/url) | (url="http://"http://mail.ambrosiasw.com/mailman/listinfo/coldstone_dev")Coldstone-dev mailing list(/url) | (url="http://"http://ucplugs.evula.net/pog.html")PoG Upcoming Plug-Ins Directory(/url)

Quote

Originally posted by Codewizard:
**Stark,
Just for reference, I am not a he. I am one of those other people you may have seen walking around from time to time. 😄 Although, I was once mistaken for a he many years (and a few pounds) ago in a dark nightclub during a Halloween party by a man who then decided he had had his last drink of the night. Apparently, Oxford, IA is a man's kind of town. **

My mistake, please forgive me. 🙂

I've corrected my above post and shall remember for future responses. hehe.

And no, Oxford, IA isn't a "man's kind of town." It's actually a very small town; a farming community. I live within the towns border claims, thus it is the address I list, but I live out in the country. I do tend to address people more formally until I get to know them, and I do tend towards the masculine unless corrected. Just consider it a throw-back to the days of respectful chauvinism that is not intended in anyway to be disrespectful. It is kind of hard to see a person behind the screen, and gender-neutral / gender-difficult screen names give me fits for addressing a person correctly. 🙂

------------------
(url="http://"http://stark.evula.net/pogwalkthrough.htm")PoG Walkthrough and Compendium(/url) | (url="http://"http://stark.evula.net/plugins/dev_tools.htm")PoG Dev Tools(/url) | (url="http://"http://stark.evula.net/plugins/spells_expander.htm")Spells Expander(/url)
(url="http://"http://stark.evula.net")Stark.evula.net(/url) | (url="http://"http://www.evula.net")EVula.net(/url) | (url="http://"http://mail.ambrosiasw.com/mailman/listinfo/coldstone_dev")Coldstone-dev mailing list(/url) | (url="http://"http://ucplugs.evula.net/pog.html")PoG Upcoming Plug-Ins Directory(/url)