How do I let objects communicate in a layered spawn system?

Get help using Construct 2

Post » Wed Nov 25, 2015 3:42 pm

I'm working on a game right now, where you dig deep down underground. And there are many different levels (as in strata underground) and "loot" you'll find.

Now, I've already created a system where each level is divided into 4 parts.
Code: Select all
[Loot]                              (Like crystals or whatever)
[The coming up Base level]          (For the Transition level Dest. out.)
[A Transition level with Dest. out] (For transitioning to another type of base level)
[Base level]                        (Dirt for example)


Now, my problem is, since the level that has the "Health" variable is the base level, how do I let the other 3 levels know that they are supposed to be destroyed?

Since the base level will not always be the same one(dirt/granite/basalt/whatever), I cannot say: "set level.Hp to dirt.Hp", and if I use the family of the base level, it sets the HP of ALL other levels currently on the screen to the HP of the base level.

Containers don't work too, since then the dest. out. of the trans. level fucks everything up.

I am clueless. How would go and fix this/any other ideas?
Last edited by Vhantaar on Wed Nov 25, 2015 4:46 pm, edited 1 time in total.
B
6
S
1
Posts: 11
Reputation: 422

Post » Wed Nov 25, 2015 3:57 pm

I don't understand your question..
What are you trying to achieve?

"How do objects communicate?
How do I let the other 3 layers know that they are supposed to be destroyed?
"set layer.Hp to dirt.Hp""

You want to destroy something, obviously, but the whole layer?
Why does the layer have hp (Layers don't have variables, do they?)?
Why do other layers get the same hp?
Couldn't you use a condition to determine what the hp should be if dirt = 50 if granite = 100, etcetera?
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 » Wed Nov 25, 2015 4:57 pm

I changed language a bit to be more precise.

By "layer" I didn't mean the layer where you place objects, but the dirt "layer" itself.

Maybe a link to the current version of the game will help: http://www.kongregate.com/games/Lexoria ... irt-2-beta

There are 5 Dirtlayers, or Dirtblocks.

And in the new version, each of them will be composed of 4 parts, to make it more diverse and easier to add new content.


Here's a screenshot of my problem: https://i.imgur.com/qG8jDQ7.png

Now, I set the "LayerHP" var to the BaseLayers HP.

But then, when I want to set the Basalt layers HP to "LayerHP" it sets EVERY object of the "layers" family to "LayerHP", which I don't want.

The Basalt layer is interchangeable.


Is it now a bit clearer?
B
6
S
1
Posts: 11
Reputation: 422

Post » Wed Nov 25, 2015 5:06 pm

Not really, Your second action of event 28 is setting HP of all familymembers of the "layer" family to LayerHP..
If you don't want this to happen, why have that action?
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 » Wed Nov 25, 2015 7:01 pm

How else would I set the HP of it?

Since it's not always "basalt", there will be over 60 different Objects.

How do I show the game which one is the correct one?
How do I specify it?
B
6
S
1
Posts: 11
Reputation: 422

Post » Wed Nov 25, 2015 7:13 pm

if there is any logic in the way the value increases, there should be a way to tell the program that..
You might have a variable already present in the object(s) that you can use..

Another option might be adding a condition "is on layer" or something similar before setting the variable..
Setting everything is not what you want, so in the worst case even using 60 conditions would get more satisfactory results..
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


Return to How do I....?

Who is online

Users browsing this forum: Exabot [Bot] and 5 guests