Project

General

Profile

Feature #2960

Make Disable and SetDelete work on objects in containers

Added by Who Knows almost 2 years ago. Updated 23 days ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
World Model
Target version:
Start date:
10/06/2015
% Done:

0%

Severity:
Normal

Description

It would be nice if an object could eliminate itself.

I would like to address a specific instance out of some. I think you can use global variables, selfmade instance IDs, e.g. OnPCEquip (this is always unique) plus some if-blocks to achieve that.
The problem is, that you can not tell RemoveItem which instance to kill. So when an instance knows that it should kill itself, why not allow that in it's local script?

History

#1 Updated by Marc Zinnschlag almost 2 years ago

  • Category set to World Model
  • Target version set to openmw-future

https://github.com/OpenMW/openmw/pull/724

That is only for setDelete though. Wouldn't make any sense to allow disabling items in the inventory.

#2 Updated by Who Knows almost 2 years ago

... except one mod would want to allow access to an item only at full moon or such.

#3 Updated by Who Knows almost 2 years ago

Because it fits here - there is Equip() but no UnEquip().
Right now you need to check how many items of the equipped type are available to the PC, then RemoveItem <oID> <amount> and AddItem <oID> ( <amount> -1 ). All variables content will get lost when those items had scripts running.

#4 Updated by scrawl . 23 days ago

  • Subject changed from OpenMW: please make Disable and SetDelete work on a worn calling object to Make Disable and SetDelete work on objects in containers

Note: this feature would break compatibility with the original game (see PR above)

Also available in: Atom PDF