[Help]Getting the geom count

About advanced scenes, and the Thyme scripting language used in Algodoo.

[Help]Getting the geom count

Postby Luezma » Wed Sep 04, 2013 8:40 pm

Hello everyone, does there is any function or method to obtain the full number of disponible geoms?

Also an array with the geoms id will be useful, but how to obtain array's count?

Before all, thanks
Luezma
 
Posts: 14
Joined: Thu Dec 13, 2012 7:19 pm
Location: Argentina

Re: [Help]Getting the geom count

Postby Ivan » Wed Sep 04, 2013 9:18 pm

Hi Luezma!

I think there is no accesible function for getting the number of geoms and their IDs. Could you tell us what you need this for as there might theoretically be some hard, complicated and unefficient ways to accomplish it.

The only thing I can give you the answer to is how to obtain an array's count - the function string.length, which accepts both strings and arrays as arguments.
User avatar
Ivan
 
Posts: 203
Joined: Tue Oct 06, 2009 2:01 pm
Location: Croatia

Re: [Help]Getting the geom count

Postby Xray » Sun Sep 08, 2013 11:56 pm

In the tool-bar in the upper-left hand corner, left click on "File", then click on "Show sim-info". This may be what you are looking for.
User avatar
Xray
 
Posts: 501
Joined: Sun Jun 17, 2012 6:12 am
Location: USA

Re: [Help]Getting the geom count

Postby Luezma » Sat Mar 08, 2014 6:54 am

Sorry, but I need real time geom id list to analize exact geoms with special properties
Luezma
 
Posts: 14
Joined: Thu Dec 13, 2012 7:19 pm
Location: Argentina

Re: [Help]Getting the geom count

Postby Kilinich » Sat Mar 08, 2014 1:27 pm

Add to all geoms onSpawn event some code to put their IDs into array.

scene.my.tick = 0;
scene.my.IDs = [];

select all,
onSpawn = (e) => {scene.my.tick == sim.tick ? {scene.my.IDs = scene.my.IDs ++ [e.this.entityID]}:{scene.my.IDs=[]; scene.my.tick = sim.tick}}
Dream of Algodoo as game development engine...
User avatar
Kilinich
[Best bug reporter 2010]
 
Posts: 2098
Joined: Mon Aug 31, 2009 8:27 pm
Location: South Russia


Return to Thyme scripting

Who is online

Users browsing this forum: No registered users and 2 guests