Project

General

Profile

Feature #3005

Make HasItemEquipped return true on substrings

Added by Who Knows over 2 years ago. Updated 14 days ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
Scripting
Target version:
Start date:
11/10/2015
% Done:

0%

Severity:
Normal

Description

example

if ( player->HasItemEquipped "common_pants_01" )
elseif ( player->HasItemEquipped "common_pants_02" )
elseif ( player->HasItemEquipped "common_pants_03 )
[...]
endif

If HasItemEquipped would work like GetPCCell already does this would simply become

player->HasItemEquipped "common_pants_0"

; to see if the PC wears pants at all
player->HasItemEquipped "pants"

Like pants I'd like to give items different looks (color, shape…) there's nothing else different. Now there is the same script attached to all of them. To check if (further) action shall be taken by the script the equipped status of common_pants_* would be checked, if true nothing is done.
While OnPCEquipped works on the instance level, HasItemEquipped could work on the object level.

In the best case there would be a way to create a type of item and assign different looks, so the object ID would stay the same. What I ask for would not be needed then.

openmw-future, I know ;)

History

#1 Updated by Stuart Moore over 2 years ago

Should probably be a specific function to do this, otherwise you might get unexpected breakages.

#2 Updated by Who Knows over 2 years ago

In that case here are some ideas

HasEquippedIDLike <substring> ; sounds best for me 
HasEquippedGrepID <substring> ; would be an alternative but not easy for Windows modders and might look like regexp can be used

; "Item" is not needed, you can only equip items.
; "ID" could be dropped as well. That searching is done on IDs should be clear.

#3 Updated by Stuart Moore over 2 years ago

Well, allowing a function to use regexp-like search strings might be useful.

#4 Updated by Alexei Dobrohotov 7 months ago

  • Category set to Scripting

#5 Updated by Alexei Dobrohotov 14 days ago

  • Subject changed from Engine: make HasItemEquipped return true on substrings to Make HasItemEquipped return true on substrings
  • Target version set to openmw-future

Also available in: Atom PDF