Creating Object Definitions Without Instancing?

For questions about using Classic.

Post » Fri Oct 15, 2010 6:33 pm

Hi-

So I'd like to be able to create objects, without instancing them in a layout. Gamemaker lets you define and organize (w/ folders) objects without necessarily having to put them in your room (layout). For example, in my game, I plan on having several different tilesets for randomization as well as monsters. However, any sprite object I create seems to need to exist on some layout layer. If I delete it from the layout, it disappears from my object list.

Is there anyway to do this in construct that I'm missing?

Thank you very much,
Zomd
B
1
G
2
Posts: 6
Reputation: 637

Post » Fri Oct 15, 2010 7:18 pm

Once an object is added to a project, it is accessible from every layout.
To place an object into a layer's object list simply copy and paste from the layout it was added to, or already exists in.
So... basically, to get the organization your looking for, I'd suggest making a dummy layout, that you don't plan on running.
Image Image
B
161
S
48
G
90
Posts: 7,356
Reputation: 66,767

Post » Sat Oct 16, 2010 12:15 am

Ok, so I can create a dummy layout that isn't used other than to store objects? Will this run all the events associated with the object?

So let's say I have a mob layout with 10 mobs on it, each a sprite object with its own event behavior. I copy mobs 1-3 to my main layout (where the game takes place), will the event logic execute for all mobs (1-10) every tick or just for the mobs 1-3?

Thanks for the help. :)
B
1
G
2
Posts: 6
Reputation: 637

Post » Sat Oct 16, 2010 4:20 am

why go through all that trouble when you can just drag the instances to a corner off-level and enable destroy on startup.
B
52
S
7
G
6
Posts: 1,945
Reputation: 7,610

Post » Sat Oct 16, 2010 7:43 pm

Because it's sloppy? The game I'm making is a randomized platformer, where I want to be able to not only easily add and organize new tilesets but also mobs, traps, items, etc. Creating dummy layouts or dragging off mobs and then destroying them, etc just seems kludgy to me. When I work on something, I tend to organize it as I want it to be finished as I go. If I have 30 possible mobs, I don't want the event logic running for all of them if I'm only using 10 in a given level.

So here's a question then, if I destroy the last instance of an object in all layouts, does it prevent me from creating a new instance (like in the editor) or does it keep the object definition live? If I can create a dummy layout and then choose my enemies, destroy the others and then repeat the process at the beginning of a new level, that's workable but unwieldy.


Edit: Admittedly I'm new to Construct, so I'm still learning it's ins and outs. Event Groups seems to be the way to keep unwanted event logic from executing for anyone else that's interested.
B
1
G
2
Posts: 6
Reputation: 637


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 0 guests