GET Items possess in array ???

Jonforum

Veteran
Veteran
Joined
Mar 28, 2016
Messages
1,623
Reaction score
1,440
First Language
French
Primarily Uses
RMMV
hi
There would be a class, method or function to quickly get the list of items possess. ?
I would like to avoid using Object.keys($gameParty._items);

In fact I would like to know the most [effective&&performance] way to get the list of items possess in an array ???
thanks
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
2,604
Reaction score
1,961
First Language
English
Primarily Uses
RMMV
$gameParty.items()
 

Jonforum

Veteran
Veteran
Joined
Mar 28, 2016
Messages
1,623
Reaction score
1,440
First Language
French
Primarily Uses
RMMV
$gameParty.items()
this.SETitemList = function() {
var list = [];
for (var id in $gameParty._items) {
list.push($dataItems[1].id);
}

}

i add .id to the function.
thats was i want.
is the most short way performance i think
 
Last edited:

Jonforum

Veteran
Veteran
Joined
Mar 28, 2016
Messages
1,623
Reaction score
1,440
First Language
French
Primarily Uses
RMMV

LTN Games

Indie Studio
Veteran
Joined
Jun 25, 2015
Messages
704
Reaction score
631
First Language
English
Primarily Uses
RMMV
Just go with object.keys with a forEach() or your filter().
These are just micro-optimizations. Unless you're performing the calculation thousands a time per frame you have nothing to worry about. I notice you seem to really care about the highest performant methods but again unless you have a noticeable slowdown and you have optimized your code already and still need speed, then you can worry about these micro-optimizations but it's really pointless to try and find the best performance of native JS functions.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

Day 9 of giveaways! 8 prizes today :D
He mad, but he cute :kaopride:

Our latest feature is an interview with... me?!

People4_2 (Capelet off and on) added!

Just beat the last of us 2 last night and starting jedi: fallen order right now, both use unreal engine & when I say i knew 80% of jedi's buttons right away because they were the same buttons as TLOU2 its ridiculous, even the same narrow hallway crawl and barely-made-it jump they do. Unreal Engine is just big budget RPG Maker the way they make games nearly identical at its core lol.

Forum statistics

Threads
106,040
Messages
1,018,476
Members
137,824
Latest member
dobratemporal
Top