3d box - change Z on creation by name

For questions about using Classic.

Post » Thu Nov 29, 2012 11:35 pm

Title says it all. Basically, I have the system object create a 3d box object by name, using a private variable of another object. However, I have no idea how to then select that object specifically so I can alter it's Z elevation.

It's a small problem, and one I can work around with more events, but I'd rather not have to make new events for every time I make a different 3d box, I'd like to keep my event sheets small and manageable.
B
3
S
1
G
3
Posts: 105
Reputation: 1,312

Post » Thu Nov 29, 2012 11:46 pm

It should be that in the same event you create the object, it is automatically picked, so any events just after should apply to the new object.
"Construct 4 lets YOU make advanced games! (maybe)" Construct Classic - Examples Kit
B
86
S
28
G
13
Posts: 2,092
Reputation: 15,009

Post » Fri Nov 30, 2012 1:01 am

I'm aware that it will automatically pick the object, but let me explain my dilemma. The event 'pick by name' is used, which does not specify any object in particular. So therefore, how do I say on the next line to change the Z elevation of the object that was just created by name? I can't pick any object out of the list of existing objects, because it could be any one of them.
B
3
S
1
G
3
Posts: 105
Reputation: 1,312

Post » Fri Nov 30, 2012 8:04 am

Ok, I've been working on this problem for hours with no luck. I've moved on to some different method which I'm sure should work, but it just doesn't. My code looks like this:


If "view" (an object) overlaps "terrain" (a family),

subevent - pick "3dblocks" (another family) by comparison: if 3dblocks private variable "name" is the same as terrain private variable "name",

then:

System: create object 3dblocks
3dblocks: set Z to "view" private variable "Z"


To me, that seems like it should work. It looks as though I'm specifying the correct 3d box within the "3dblocks" family, but when the family instance is created it is a random 3d box from the family. I really need help with this one :/
B
3
S
1
G
3
Posts: 105
Reputation: 1,312


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 2 guests