Construct Limits

For questions about using Classic.

Post » Fri May 04, 2012 1:13 pm

Dear Arima,
Dear Silver,

Thanks for trying to help...
Please give me your e-mails. I suppose you are honest people - I did much as for the game - and I trust you.

My characters are warships - they are about 60 now in the game - I have planned 400. And every ship has guns (every gun is a sprite) and some ships have up to 60 guns. Also I am to show the ship figures - ammunition, crew, speed, qn-ty of guns, etc. That gives something about 20 text fields per ship. That's why 1500 bjects. In fact I need much much more - 10000 objects...((((((((Dima1112012-05-04 13:15:12
B
5
Posts: 37
Reputation: 499

Post » Fri May 04, 2012 5:17 pm

You seem to not have a grasp on creating multiples of the same Sprite through events. YOu can have a single text object and create "instances" of it and they write completely different texts. Also, I'm gonna assume the ships don't animate, which would make it even easier to just have one sprite and then 400 animation frames within it, the animations having a speed of 0, and then you just change the animation frame per ship (or weapon).

You probably just need to mess around with Construct a lot more to actually learn it. Try smaller projects, or at least prototype experiments.

Also, Arima, if you've once had event sheets that take MINUTES to open, I probably have no serious memory leak issues to worry about for quite a long while, haha. Nothing I've opened in Construct has taken me longer than a second or two.
B
5
S
2
G
3
Posts: 234
Reputation: 1,818

Post » Fri May 04, 2012 6:37 pm

Konjak,
That's great - you grant the hope) You are quite right - I am absolutely far of using the same sprite through events.

Where could I find the info how to use "instances"? Or could you please post the respective cap? Please - teach!

I will rush to optimize the game!
B
5
Posts: 37
Reputation: 499

Post » Fri May 04, 2012 7:13 pm

As far as I found in the Forum - instances are the pasted (not cloned) copies of one object? And the only difference between them is in properties by animation frames number?

Konjak - you are quite right - the gun sprites are not animated. Dima1112012-05-04 19:16:04
B
5
Posts: 37
Reputation: 499

Post » Fri May 04, 2012 7:30 pm

In the event sheet editor you can use the System object action Create Object to spawn a second instance of whatever you would like.

You can even configure it with unique values if you add the settings right after the action that makes it (eg:

-Create "Sprite" on layer "Objects" at 0, 0
-Sprite: Set color filter to Red
-Sprite: Set private variable "Life" to 100

But, if you want to create multiple sprites at once, you need to do it like this:

-Create "Sprite" on layer "Objects" at 0, 0
-Sprite: Set color filter to Red
-Sprite: Set private variable "Life" to 100
-Create "Sprite" on layer "Objects" at 0, 0
-Sprite: Set color filter to Red
-Sprite: Set private variable "Life" to 100

as any settings after the "Create" action will apply only to the newest sprite you made.
"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 May 04, 2012 7:51 pm

OK! Got you!
And in that case - the special feature, let's say - the name of the ship and the number of the ship gun - I can write in the private variable (after the "Create")?

Which event is responsible for the GunSprite creation - the ShipSprite appears on the Screen?
In that case what if it is (I mean - the GunSprite) completely destroyed? Everytime the ShipSprite appears on the screen - the GunSprite will ressurect...   

Or Always - in that case (as far as I can guess) all my 10000 sprites that are not destroyed will be computed?
B
5
Posts: 37
Reputation: 499

Post » Fri May 04, 2012 8:19 pm

Now my "gun work" algorythm is (the ship name is AAAA)

When AAAAGunSprite1 overlaps Enemy
>> When Enemy: Do not Pick closest to AAAA X,Y ---> Enemy private variable "AAAA" set to 0 (means that the Enemy ship is not under the AAAA fire)
>>>> Nothing happens

>> When Enemy: Pick closest to AAAA X,Y => Enemy private variable "AAAA" set to 1 (means that the Enemy ship is under the AAAA fire)
>>>> Every 10 (let suppose AAAAGunSprite1 gun rate) => AAAA "Ammunition" private variable subtract 1 (AAAAGunSprite1 shoots)
>>>>>> Random (1 to 100) (let suppose - AAAAGunSprite1 shooting accuracy)    /and/    if the Enemy private variable "AAAA" = 1 (the Enemy is under AAAA fire)    /and/   if AAAAGunSprite1 overlaps Enemy (the Enemy is in the AAAAGunSprite1 range)   /and/   if Enemy is detected(discovered) (overlaps another Sprite - DetectionSprite)    /and/     the Enemy is closest to AAAA     =>   the Enemy recieves 1 hit.


What will it be in that case for created instances?Dima1112012-05-04 20:32:49
B
5
Posts: 37
Reputation: 499

Post » Fri May 04, 2012 8:23 pm

Yep, you can configure the object as much as you like with actions after the create action and it will only applied to that instance.

That second set of events should work with all of your instances already I believe.
"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 May 04, 2012 8:46 pm

Jayjay,
A bit simplier question)))

I have 25 destroyers that are alike each other and every destroyer has 1 (suppose) gun. So all 25 guns can be instances of a single GunSprite. Am I right?

To differ the 25 instances from each other need I to create for my GunSprite the PV "Ship name" and after "Create" to write in the Instance PV - AAAA, BBBB, CCCC etc?Dima1112012-05-04 20:48:34
B
5
Posts: 37
Reputation: 499

Post » Fri May 04, 2012 11:02 pm

[QUOTE=Dima111] Jayjay,
A bit simplier question)))

I have 25 destroyers that are alike each other and every destroyer has 1 (suppose) gun. So all 25 guns can be instances of a single GunSprite. Am I right?

To differ the 25 instances from each other need I to create for my GunSprite the PV "Ship name" and after "Create" to write in the Instance PV - AAAA, BBBB, CCCC etc?[/QUOTE]

Absolutely, you can match them up with a private variable on each (eg: "ShipNumber" on ship and on GunSprite, then have conditions saying "GunSprite: Value "ShipNumber" = Ship.value('ShipNumber')" and then do positioning events)

Or you can use containers. Add the GunSprite object into the container of Ship in the object properties (in layout editor), and whenever you create one of the objects its pair will be created too. Plus, any event relating to one Ship object will automatically refer to its specific GunSprite too!

Edit: Careful with containers, if you destroy one of the objects in a container their pairs are destroyed too, same with creation. However, each group of objects (Ship and GunSprite) will act separately from other groups.Jayjay2012-05-04 23:03:14
"Construct 4 lets YOU make advanced games! (maybe)" Construct Classic - Examples Kit
B
86
S
28
G
13
Posts: 2,092
Reputation: 15,009

PreviousNext

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 3 guests