Removing unremovable items

Questions about how to create your own dungeons and replacement graphics and sounds.

Moderator: George Gilbert

Forum rules
Please read the Forum rules and policies before posting. You may Image to help finance the hosting costs of this forum.
Post Reply
Chaos Awakes
Artisan
Posts: 187
Joined: Sat Jan 22, 2005 2:50 pm
Location: Ipswich, UK

Removing unremovable items

Post by Chaos Awakes »

If a character is wearing an "unremovable" (ie - cursed) item of clothing, how do I in the editor create a potion or spell to remove the item. I'm sure this is possible as I'm sure I've seen posts about it before, but I can't find an action for remove curse item.

Ideally, I'd like to create a potion which when drunk allows the character to remove an unremovable item of clothing, although a spell would be just as good. Or a spell which creates a potion to do it, even better.
User avatar
beowuuf
Archmastiff
Posts: 20686
Joined: Sat Sep 16, 2000 2:00 pm
Location: Basingstoke, UK

Post by beowuuf »

You are thinking of DM Java which handled curses this way

There is an unremoveable tag in items ,I believe, so there will be an action to set/unset this flag I would assume
User avatar
George Gilbert
Dungeon Master
Posts: 3022
Joined: Mon Sep 25, 2000 11:04 am
Location: London, England
Contact:

Post by George Gilbert »

No - if an object is unremovable, then it's unremovable; that's it - you can't change it at run-time.

What you can do however is swap the unremovable object that your character is wearing for one that is removable.

So, for your potion what you need to do is set its CONVERT_CONSUME action to perform the action SWAP_CHARACTER_BODY and give it the first object of your unremovable object and the second object of the removable one.

Does that make sense - if not, let us know...
Chaos Awakes
Artisan
Posts: 187
Joined: Sat Jan 22, 2005 2:50 pm
Location: Ipswich, UK

Hmm

Post by Chaos Awakes »

Hmmm,
The problem with this is that you would need to know in advance which item was being worn - and create a different potion to remove each type of cursed item. What is needed is a way to say "swap whatever item is being worn with the same one which is removable"

Otherwise, what exactly is the point of the unremovable flag? Why would anyone want to play a dungeon where they might end up wearing a cloth sack that they can't remove for the rest of the game?
User avatar
beowuuf
Archmastiff
Posts: 20686
Joined: Sat Sep 16, 2000 2:00 pm
Location: Basingstoke, UK

Post by beowuuf »

No, you can tell the potion to initiate all the actions and of course only one will be valid, if infact anythign is beign worn at all : )

You could even make a 'strength' for curses, by having cursed_item_steength_2 - > cursed item 1 and cursed item_1 - > normal item - so need two potions

Different levels of potion could then have broader swaps associted - all soudns complex, but then you have a large amount of optiosn instead of simple unsetting a cursed flag. You could even have a delayed effect whereby the normal item is swapped back to a cursed item again if they dont' take it off their body!

The idea of a flag in an item is Just like you can't uncurse an item now - there is no flag so no remove remove curse, instead you have sword and sword_cursed etc. Properties are hard coded but the engine can swap items really easily, rather than swag flags.
User avatar
George Gilbert
Dungeon Master
Posts: 3022
Joined: Mon Sep 25, 2000 11:04 am
Location: London, England
Contact:

Re: Hmm

Post by George Gilbert »

Chaos Awakes wrote:The problem with this is that you would need to know in advance which item was being worn - and create a different potion to remove each type of cursed item.
One could argue that that's a feature!

But anyway, you can have a potion that removes all cursed items with the current mechanics. For example, instead of your consume action directly activating the ACTION_SWAP, you could have it activate a special relay for removing curses - that relay then activates a whole bunch of ACTION_SWAP action wallitems; one for each type of cursed item that's in the dungeon. That way, when you drink your anti-curse potion it will swap any cursed item for its non-cursed equivalent.
Chaos Awakes wrote:What is needed is a way to say "swap whatever item is being worn with the same one which is removable"
There's no such concept of "the same one". To the engine, there's no difference between an apple / bow / suit of armour etc (at least in that respect); they're all just objects and you can swap any object for any other.

If you think about it, the only thing that makes them "the same" is the fact that you've presumably got similar, if not identical, graphics / name for them...neither of which the engine cares about as they are purely designed for the user.

It also makes the engine alot more flexible, for example you could create a potion that changes your armour into apples; although why you'd want to is another matter altogether ;-)
Chaos Awakes wrote:Otherwise, what exactly is the point of the unremovable flag?
It's to prevent items of that object type from being removed - nothing more, nothing less.
Chaos Awakes wrote:Why would anyone want to play a dungeon where they might end up wearing a cloth sack that they can't remove for the rest of the game?
Well you wouldn't - but the dungeon designer who would include such items would also include some way of removing it.

********************

I think what's missing here is the conceptual distinction between objects and items.

Objects are like templates - abstract concepts of how something should perform.

Items are specific instances of something.

For example; "apple" is an object with properties such as a weight and being edible. *THIS* apple is an item with properties such as a location in the dungeon.

The removable flag is a property of an object; i.e. an abstract property belonging to all items that have that object type. If you have a cursed item, it just means that the object type is unremovable (rather than the item itself). So if you want you character to remove *THIS* cursed armour, then you have to swap the item for a completely different item which has an object type that is removable.

To be more specific, the item itself does not have the property of removability and therefore there isn't a flag you can toggle for that item that the character is wearing.

I hope all that makes sense and gives you a better insight as to how the mechanics can be made to work under the covers. As ever, any questions just fire away...
Chaos Awakes
Artisan
Posts: 187
Joined: Sat Jan 22, 2005 2:50 pm
Location: Ipswich, UK

Cool

Post by Chaos Awakes »

Thanks George, I like the idea of firing a relay that swaps out all the cursed items.

The main problem is that there are no docs, so I have no idea what is available until I stumble across it. For example, whenever you release a new version there is a great list of new features but I never seem to be able to find any of them because I don't know where to look in the editor.
User avatar
beowuuf
Archmastiff
Posts: 20686
Joined: Sat Sep 16, 2000 2:00 pm
Location: Basingstoke, UK

Post by beowuuf »

Sophia will be trying to release a newer editing doc at some point I assume, and the 0.37 one is available already, but 0.38 / 39 has added alot of stuff.

All actions will be either direct items in the action menu, or wallitems in the wallitem list usually

Doens't take too long to scan through them by tryign to create new items etc and seeign the unusually named ones ; )
User avatar
TheMormegil
Adept
Posts: 213
Joined: Thu Apr 10, 2003 10:23 am
Location: Wales

Post by TheMormegil »

It also makes the engine alot more flexible, for example you could create a potion that changes your armour into apples; although why you'd want to is another matter altogether ;-)
This is interesting because then you would be wearing apples, which you can't do otherwise!
Maybe you could have a 'big pockets' spell where it swaps a large object into your pocket. Again, hard to see why you'd want to!
User avatar
George Gilbert
Dungeon Master
Posts: 3022
Joined: Mon Sep 25, 2000 11:04 am
Location: London, England
Contact:

Post by George Gilbert »

Yes - in fact, this is actually what happens under the covers when an item is rusted. It swaps from "proper" armour (which can be worn) to "rusted" armour (which can't). The end result is that your character is wearing something that once taken off can't be put back on again.
Post Reply