Getting the list of items in a surface

Ask for help about creating mods and scripts for Grimrock 2 or share your tips, scripts, tools and assets with other modders here. Warning: forum contains spoilers!
Post Reply
vieuxchat
Posts: 48
Joined: Wed Mar 02, 2016 3:14 pm

Getting the list of items in a surface

Post by vieuxchat »

I just can't make it work.
How do I get the list of the items in a surface ?
There's no SurfaceComponent:getItems() method :(

EDIT: It's always like that.. after spending an hour to look at the subjects here I finally found my answer several minutes after posting -___-
So the answer :
"for _,i in surface:contents() do"
Where the hell that "contents()" method is explained ? I didn't found it in the Scripting reference...
minmay
Posts: 2790
Joined: Mon Sep 23, 2013 2:24 am

Re: Getting the list of items in a surface

Post by minmay »

It's not listed in the grimrock.net scripting reference but you can find it in the component function list.
Grimrock 1 dungeon
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
vieuxchat
Posts: 48
Joined: Wed Mar 02, 2016 3:14 pm

Re: Getting the list of items in a surface

Post by vieuxchat »

Wow ! Nice :) My new favorite page.
Thanks a lot.
Post Reply