Is it bug or is it me?

For questions about using Classic.

Post » Fri Jul 08, 2011 2:35 pm

I am trying to set a condition to create random number of objects of one type. For this i use GV that is being set at the start of layout. then, right under it i set that
Value compare if ObjectX.Count is less then GV: create ObjectX

sounds reasonable.
But it doesnt work. Instead - when debuggin ive get and error saying:
"ESpression 'Count': No 'ObjectX' object exists. returning zero.

Well gee wiz, i know that theres no ObjectX and thats why i want the event to create them. Why its not working?
B
16
S
5
G
4
Posts: 211
Reputation: 3,767

Post » Fri Jul 08, 2011 5:03 pm

The object you're checking - is it a family or something else? Because using a family name and the .count expression, such as enemy.count doesn't work and always returns 0. You can work around this by using an event at the base level, then system>compare> is countmatching("enemy") less than x.
Moderator
B
88
S
32
G
33
Posts: 3,005
Reputation: 27,432

Post » Fri Jul 08, 2011 7:01 pm

thats why its so weird, i am not using fammilies at all O.o
i just use "value compare" from system expresion. then in value one i click on the objectX from bottom microwindow and pick "number of objects"
then as a value i just use GV.
B
16
S
5
G
4
Posts: 211
Reputation: 3,767


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 4 guests