How to destroy items in a sack ?

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
Post Reply
User avatar
Xanathar
Posts: 629
Joined: Sun Apr 15, 2012 10:19 am
Location: Torino, Italy
Contact:

How to destroy items in a sack ?

Post by Xanathar »

Has anyone found a way to destroy an item in a sack ?
The sack has no removeItem, and destroy() seems to leave a zombie object there which will crash the game sooner or later.
Waking Violet (Steam, PS4, PSVita, Switch) : http://www.wakingviolet.com

The Sunset Gate [MOD]: viewtopic.php?f=14&t=5563

My preciousss: http://www.moonsharp.org
Batty
Posts: 509
Joined: Sun Apr 15, 2012 7:04 pm

Re: How to destroy items in a sack ?

Post by Batty »

Those great methods in the GrimQ don't do it? I'm working through them now, thanks for that.

If you move the sack using your methods couldn't you just replace the sack sans said item?

Using your methods, you could try spawning a "ghost party" in a far off square and spread the contents of the sack into a ghost champ's inventory slots. Destroy (removeItem()) the item, then reinstall the items into a sack and return to the origin.

Keep in mind I've only sent single items back & forth to the ghost party so this is 95% untested fiction. :D

edit: coffee just hit so I'm full of ideas. You could just leave the offending item in a holding square to sit in purgatory forever. It wouldn't be destroyed but would be effectively removed from the game.
User avatar
Xanathar
Posts: 629
Joined: Sun Apr 15, 2012 10:19 am
Location: Torino, Italy
Contact:

Re: How to destroy items in a sack ?

Post by Xanathar »

Those great methods in the GrimQ don't do it? I'm working through them now, thanks for that.
It's exactly to fix a bug in grimq :D
If you move the sack using your methods couldn't you just replace the sack sans said item?
In theory, yes, it's feasible and without a big effort too (just a slightly modified version of copyItem). The problem is that contents in sacks are rearranged when copying (as we can get the content and add them back, but without the exact cell because of limits of the current scripting functions offered by the game) and I was hoping for a cleaner solution (one more transparent for the player).

I'll try to implement some of this later today (better than crashing, which is what the current version does :oops:), unless someone with infinite knowledge (maybe, I don't know, living in Finland and working for some well known company making dungeon crawlers in the XXI century cough cough) has a clever trick to pull out :lol:

Thanks!
Waking Violet (Steam, PS4, PSVita, Switch) : http://www.wakingviolet.com

The Sunset Gate [MOD]: viewtopic.php?f=14&t=5563

My preciousss: http://www.moonsharp.org
User avatar
petri
Posts: 1917
Joined: Thu Mar 01, 2012 4:58 pm
Location: Finland

Re: How to destroy items in a sack ?

Post by petri »

Oops, it looks like I've completely forgotten to add Item:removeItem(). Thanks!
User avatar
Xanathar
Posts: 629
Joined: Sun Apr 15, 2012 10:19 am
Location: Torino, Italy
Contact:

Re: How to destroy items in a sack ?

Post by Xanathar »

Thanks to you! :)
Waking Violet (Steam, PS4, PSVita, Switch) : http://www.wakingviolet.com

The Sunset Gate [MOD]: viewtopic.php?f=14&t=5563

My preciousss: http://www.moonsharp.org
User avatar
Komag
Posts: 3659
Joined: Sat Jul 28, 2012 4:55 pm
Location: Boston, USA

Re: How to destroy items in a sack ?

Post by Komag »

wait a sec, you mean that's currently available but undocumented, or will be in the future patch? :shock:
Finished Dungeons - complete mods to play
Post Reply