How do I load game resources

Just started using Construct 2? Post your questions here

Post » Mon Sep 22, 2014 5:31 pm

Right now I have a "GUI" layout with global objects that contains all of the GUI and is beginning to collect all of the sprites/enemies/etc off in the margin as well. I've noticed I have to be very careful with this because if you don't test the sprite before doing an action it will effect the source sprite as well!

How do I load up all my resources so that there's no extra hanging around ?
Developing Surolace, the survival role playing space game.

surolace-survival-role-playing-space-game_t116953
B
14
S
4
Posts: 303
Reputation: 1,730

Post » Tue Sep 23, 2014 3:20 pm

Sorry, I have to bump this. I'm running into problems where sprites in the margin that I use as a base for spawning objects, are being treated as active. What is the normal way to do this? C2 makes it easy to put a bunch of "and is not in the margin" conditions, but that's going to be a lot of work already and I sense that's not the best way.

?
Developing Surolace, the survival role playing space game.

surolace-survival-role-playing-space-game_t116953
B
14
S
4
Posts: 303
Reputation: 1,730

Post » Tue Sep 23, 2014 3:26 pm

Could you provide an example capx?

What do you mean by treated as active?
If I understand correctly you could either put the sprites needed in a different layout or destroy them on start of layout..
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 » Tue Sep 23, 2014 3:31 pm

http://surolace.com/play

(swipe screen for virtual joystick)

If you move the ship along the left edge and your screen res is high enough, you'll see the turrents on your ship aiming at something not accessible.

If I delete the objects they will not be available for spawning, since C2 handles resources on a per layout basis. I've made them global so I can reuse them for (in the future) many instances.

A simple solution might be something like, on every action "if not on resource layer" or something, but it's sloppy and won't scale with what I'm trying to do well.

Edit: To reword more succinctly:

I need to be able to spawn objects, but do not want to use or keep the original that they are based from.
Last edited by skelooth on Tue Sep 23, 2014 3:37 pm, edited 1 time in total.
Developing Surolace, the survival role playing space game.

surolace-survival-role-playing-space-game_t116953
B
14
S
4
Posts: 303
Reputation: 1,730

Post » Tue Sep 23, 2014 3:37 pm

Did you try my solutions?
I have been working with C2 for about 2 years, so you might want to try..
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 » Tue Sep 23, 2014 3:38 pm

I will give that a try when I get home this evening. So once they are loaded in a layout, they are there forever? won't I need to reload them again when changing layouts?
Developing Surolace, the survival role playing space game.

surolace-survival-role-playing-space-game_t116953
B
14
S
4
Posts: 303
Reputation: 1,730

Post » Tue Sep 23, 2014 3:40 pm

As long as the objects are available on any layout C2 knows what the starting point will be when created and or spawned..
So you could do either of my suggestions

on start of layout - destroy objects

or create a layout witch isn't used for anything else than storing your assets..
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 » Tue Sep 23, 2014 4:07 pm

Does not work. Just tried. The object needs to be present somewhere on the layout or system->create object does not work.
Developing Surolace, the survival role playing space game.

surolace-survival-role-playing-space-game_t116953
B
14
S
4
Posts: 303
Reputation: 1,730

Post » Tue Sep 23, 2014 4:16 pm

What did you try to do?

put the object on a different layout or use the event on start of layout - destroy?
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 » Tue Sep 23, 2014 4:25 pm

Here are the examples (although it shouldn't be necessary):
You do not have the required permissions to view the files attached to this post.
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

Next

Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 6 guests