Spawn object without Instance

Get help using Construct 2

Post » Mon Nov 18, 2013 1:24 am

Hello guys, coming back for some of your knowledge. (yummy?)

Anyway, do you know if there is a chance to spawn a new object without having to include an instance in the layout?

I dont know if it affect the performance by that much but I think its kind of annoying to have an instance of the object in the layout, and more when its an object that when its bounded to the layout, because the instance will appear in the layout but its not supposed to until it is spawned kind of destroying my head actually.

So, is there a way to do this?

Thanks in advance!
B
9
S
2
Posts: 19
Reputation: 850

Post » Mon Nov 18, 2013 1:28 pm

on start of layout destroy object and you're done.
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Mon Nov 18, 2013 1:43 pm

Or put it on another layout where you put all stuff that's not supposed to be on your layout from the start.
Visual Novel 'Engine' in 100 Events
if you ever have to choose between buying Construct 2 on scirra.com or on Steam, read this: Review
B
22
S
9
G
1
Posts: 787
Reputation: 3,786

Post » Mon Nov 18, 2013 6:15 pm

try create object
B
40
S
11
G
7
Posts: 514
Reputation: 9,646

Post » Mon Nov 18, 2013 9:22 pm

I usually just destroy them on layout start.

Depending on the type of object, you can also start it with 0 opacity if you don't want to destroy it for behavior reasons. That way it won't show until you intend it to.
B
15
S
5
G
2
Posts: 24
Reputation: 2,054

Post » Mon Nov 18, 2013 9:30 pm

I place all object which i dont need from the start on a sepperate layout without an eventsheet.   then when I need them on another layout, you can have any object spawn a new instance of that object on the current layout :)

Its a great approach :)


Having objects rendered and destroyed on layout start is a waste of load time.lennaert2013-11-18 21:31:17
Who dares wins
B
57
S
17
G
21
Posts: 1,878
Reputation: 19,562

Post » Sun Jan 12, 2014 8:20 am

Lenneart,
I'm trying to migrate to using your technique of placing all the graphics on a layout sheet that acts as a "pool" for me to create instances from as I need them. I'm having one problem though. I have a family of sprites that each have distinct names as a name instance variable. At any given moment, I need to spawn a particular sprite from that family. Usually, I'd just loop through that family in order to find the sprite that has the correct name. However, I am unable to do that using the technique you mentioned. I'm assuming it is because those sprites do not exist on this particular layout sheet yet. Have you figured out a way around this problem?
B
5
Posts: 11
Reputation: 272


Return to How do I....?

Who is online

Users browsing this forum: plinkie and 25 guests