[help]Some questions and reflections to think about..

For questions about using Classic.

Post » Tue Jun 21, 2011 6:08 am

It's possible create a new sprite that wasn't in the game before executing? It's not a new instance of some sprite that already exist but a newly sprite with empty image and everything..

Another question is how do I use the 'files' resource of Construct? I add files to it but how do I access it?
Could be possible create a sprite and load the frame from a file resource? Or I would need to use the plugin resource access?

and finally.. I have a lot of images that I have to add to the game and they could be accessed from the game.. but not sure the best way(less loadings, more fps, etc) to do it..
first idea was just make a new sprite for every image to a specific layout and then they could be accessed later from another place during the game...but I think so many sprites with complex images already inside the game wouldn't be a good idea.. so the next idea was making just many blank sprites and access each image from a directory of the game when asked.. the problem is... I'm not sure how many blank sprites I would need, the game would always evolve so the ideal was to find some way that with only sprite show diferent images or hability to create new sprites like mentioned at the beginning of the post..
B
30
S
6
G
5
Posts: 433
Reputation: 6,061

Post » Tue Jun 21, 2011 11:20 am

1.) No, you would need to have an existing sprite object, but you can load the graphics from a file if you are thinking of putting modable graphics in your game.

2.)I think there is a plugin to provide resource access on the forums, I've not used it however. The built-in resources only work for the XAudio2 plugin (eg: only sound works from resources by default).

3.)I am doing something similar to this in my game, I created a bunch of blank animations and just loaded graphics into them at run-time. Increasing the number of graphics that can be loaded can be pretty easy, you just add more blank animations. You can call animations like this "Animation(LoopIndex)" when setting an animation meaning a for loop from 1 to Sprite.AnimationCount or something like that will loop through animations (eg: Animation1, Animation2, Animation3)

Then you just load some graphics into each animation.
"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 » Tue Jun 21, 2011 5:59 pm

Yea the animation thing i was trying yesterday and I think I found a yet better way.. just add X frame animations, where X is the number of images you want.. so just make sure the animation doesn't run and select what frame u want to show.. from what I tested, this would be the best way.

but then comes some other problems... each image could have their own behavior and making by this way.. would be something complicate cuz it's all the same sprite... instead of doing sprite per sprite you could define their own behavior for each one but then again... this would take very long time by adding that much sprite..
B
30
S
6
G
5
Posts: 433
Reputation: 6,061

Post » Tue Jun 21, 2011 8:56 pm

You can give multiple behaviours, and then deactivate or activate them depending on which animation frame they display.
"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 » Wed Jun 22, 2011 12:13 am

[quote="Jayjay":309iwut8]You can give multiple behaviours, and then deactivate or activate them depending on which animation frame they display.[/quote:309iwut8]
Ya I though that after.. well.. I think ill give it a try :D
B
30
S
6
G
5
Posts: 433
Reputation: 6,061

Post » Wed Jun 22, 2011 6:00 pm

Hey... Do you know a way to get the number of objects with opacity = 100??
I'm trying
condition:
pick 'object' with opacity=100
action:
text: set text to object.Count

but it's getting objects with different opacities too..
B
30
S
6
G
5
Posts: 433
Reputation: 6,061

Post » Wed Jun 22, 2011 6:01 pm

Maybe just have a private variable that is equal to their opacity as a workaround, and pick by that.
"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 » Wed Jun 22, 2011 6:31 pm

[quote="Guif0DA":17pm4skv]Hey... Do you know a way to get the number of objects with opacity = 100??
I'm trying
condition:
pick 'object' with opacity=100
action:
text: set text to object.Count

but it's getting objects with different opacities too..[/quote:17pm4skv]


object.Count always gives the total number of instances.
Use CountMatching(object.OID) to get the number of picked objects.
B
79
S
24
G
54
Posts: 4,751
Reputation: 40,765

Post » Wed Jun 22, 2011 7:08 pm

[quote="R0J0hound":3l4qwumq][quote="Guif0DA":3l4qwumq]Hey... Do you know a way to get the number of objects with opacity = 100??
I'm trying
condition:
pick 'object' with opacity=100
action:
text: set text to object.Count

but it's getting objects with different opacities too..[/quote:3l4qwumq]


object.Count always gives the total number of instances.
Use CountMatching(object.OID) to get the number of picked objects.[/quote:3l4qwumq]
Thanks! Never took a look at that condition in the system..
B
30
S
6
G
5
Posts: 433
Reputation: 6,061

Post » Wed Jun 22, 2011 7:15 pm

taking advantage of the topic.. Do u know a way that I could add a object 100 X points after another object of the same instance?
The layout have 20 objects of the same instance and they all are at the same X and Y, and the game would organize them every 100 x.points? after all of the objects were organized them it would stop?
I'm trying so many ways to try that but having some dificulties... I already made that by creating the object and get the last one and add more 100 x.points to it but I have to organize them AFTER they were created to work what I'm planning after..
B
30
S
6
G
5
Posts: 433
Reputation: 6,061

Next

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 7 guests