In Inventory tag weirdness

Ask and answer questions about making games and related topics. Unrelated topics go in that other forum.

Moderators: marionline, SDHawk

Post Reply
User avatar
Foxley
Metal Slime
Posts: 832
Joined: Sat Nov 09, 2013 5:54 pm

In Inventory tag weirdness

Post by Foxley »

In the dungeon area I'm working on, there are some objects that can be taken and stored as inventory items. I set a tag for "if in inventory" and then set the object NPC to only appear if that tag is off. It works as intended when the player is asked "do you want to take this?" and Yes is answered: the NPC disappears while an appropriate item is added to inventory.

But disposing of the item (i.e. removing it from inventory) doesn't cause the NPC to reappear... Which makes me think either that autoset tag isn't being set to off, or something else is going on where the NPC conditional isn't being checked. Is this a bug or is there something I'm missing here?
TMC
Metal King Slime
Posts: 4101
Joined: Sun Apr 10, 2011 9:19 am

Post by TMC »

Opps! You're right, it was a bug. I've fixed it.
User avatar
Matokage
Slime Knight
Posts: 275
Joined: Sat May 26, 2012 11:48 pm
Contact:

Post by Matokage »

>Opps!
"I can't buy food with glory"
User avatar
Foxley
Metal Slime
Posts: 832
Joined: Sat Nov 09, 2013 5:54 pm

Post by Foxley »

Woohoo! Will the fix be in nightlies soon?
TMC
Metal King Slime
Posts: 4101
Joined: Sun Apr 10, 2011 9:19 am

Post by TMC »

Ack!

Yes, it's in the latest nightlies. (Which seem to be getting uploaded correctly now.)
User avatar
Foxley
Metal Slime
Posts: 832
Joined: Sat Nov 09, 2013 5:54 pm

Post by Foxley »

Awesome. I think I may go a different route, though, because I got the "item respawn" (basically, the in inventory tag being autoset back to off) thing to work by interacting with a different object. But the object NPC spawns as a regular walkabout, not a walktall one, which certainly looks off because it's just a placeholder. So I might work with something else, like an autorun script that checks tags and spawns an appropriate NPC on map entry.
User avatar
sheamkennedy
Liquid Metal Slime
Posts: 1110
Joined: Mon Sep 16, 2013 9:29 pm
Location: Tama-shi, Tokyo, Japan
Contact:

Post by sheamkennedy »

Foxley wrote:Awesome. I think I may go a different route, though, because I got the "item respawn" (basically, the in inventory tag being autoset back to off) thing to work by interacting with a different object. But the object NPC spawns as a regular walkabout, not a walktall one, which certainly looks off because it's just a placeholder. So I might work with something else, like an autorun script that checks tags and spawns an appropriate NPC on map entry.
If you are creating (spawning) new NPCs or new Heroes join your party they will automatically be shown as the small placeholder sprites. Be sure to run your "walktall" script right after a new NPC or Hero is added to the map. The "walktall" script has to re-update so that any new sprites are also changed to tall sprites. In my own game when I want a smaller NPCs like a chest, I draw it as a walktall sprite but only use the bottom half of the drawing area to illustrate it so once "walktall" is run, the chest will still appear shorter than the characters.
⊕ P E R S O N A L M U S I C: https://open.spotify.com/album/6fEo3fCm5C3XhtFRflfANr
� C O L L A B M U S I C: https://dustpuppets.bandcamp.com/releases
User avatar
Foxley
Metal Slime
Posts: 832
Joined: Sat Nov 09, 2013 5:54 pm

Post by Foxley »

I think I'm gonna figure out a way to have the objects respawn on map re-entry instead of immediately, that way it gets included in the map autorun scripts. It would also occur offscreen, which I think would be better than it potentially appearing out of nowhere in a room the player is in.

Barring that I might just make the items undroppable and unsellable and use a script to remove extra unneeded objects from inventory after the area is completed.

After this, I'll have half of the scripts done for this area!
User avatar
sheamkennedy
Liquid Metal Slime
Posts: 1110
Joined: Mon Sep 16, 2013 9:29 pm
Location: Tama-shi, Tokyo, Japan
Contact:

Post by sheamkennedy »

Nice! You should make a video or something when your done. I'd like to see this!
⊕ P E R S O N A L M U S I C: https://open.spotify.com/album/6fEo3fCm5C3XhtFRflfANr
� C O L L A B M U S I C: https://dustpuppets.bandcamp.com/releases
TMC
Metal King Slime
Posts: 4101
Joined: Sun Apr 10, 2011 9:19 am

Post by TMC »

One solution is to put "if (checktag(tag:that item is in inventory)) then (deletenpc(whichever npc it is)" in your map autorun script instead of putting a tag condition on the npc in the npc editor.
User avatar
Foxley
Metal Slime
Posts: 832
Joined: Sat Nov 09, 2013 5:54 pm

Post by Foxley »

Bingo, that sounds like the most straightforward way to go about it. Thanks TMC!
Post Reply