How to NOT edit all instances of an object?

Get help using Construct 2

Post » Mon Mar 23, 2015 10:39 pm

Yeah, if you first click the object in the project tree on the right, then go changing things in behavior properties, they will be applied to all the objects. Also newly created.

When you put an instance on the layout, and click that first, and then change properties, you will change the properties for that object instance in the layout. And newly created objects will have the ones from the default values in the project tree.

You can double check, because, after you give one instance a new value in the layout, then click the same object again in the project tree, you will notice the property has gone blank, indicating at least one instances exist with varying values.
would you now change the behavior value from the one in the project tree, the ones in the layout will receive the same value ...
Who dares wins
B
56
S
16
G
21
Posts: 1,875
Reputation: 19,406

Post » Tue Mar 24, 2015 1:56 pm

thx, but this somehow doesnt work for me. I drag and drop a new object from the object tree into the layout -> new instance. I change the properties of this instance and it also changes automatically the ones in the object tree :/
B
12
S
3
Posts: 208
Reputation: 1,471

Post » Tue Mar 24, 2015 2:30 pm

Fireche wrote:thx, but this somehow doesnt work for me. I drag and drop a new object from the object tree into the layout -> new instance. I change the properties of this instance and it also changes automatically the ones in the object tree :/



When you drag from the project tree ... the selection is still in the project tree ....

click in the layout somewhere (not the object) then click the object ..
Who dares wins
B
56
S
16
G
21
Posts: 1,875
Reputation: 19,406

Post » Tue Mar 24, 2015 3:28 pm

i did that..it doesnt work lol..do you mind uploading a test project where the setup is correct? i really dont know why it doesnt work for me
B
12
S
3
Posts: 208
Reputation: 1,471

Post » Tue Mar 24, 2015 3:51 pm

You can try this:

1. disable the bullet behavior for your object in the editor (Initial State: Disabled)
2. give the object an instance bool variable (for example call it isMoving and set to true)
3. create the objects you don't want to move and set their isMoving variable to false
4. in a for each loop check all your objects and set the bullet behavior enabled for every object,
with the isMoving bool variable set to true
B
11
S
2
Posts: 213
Reputation: 1,266

Post » Tue Mar 24, 2015 4:08 pm

yea i tried this but if I set the isMoving variable to false it changes all the vars from the other objects aswell~
B
12
S
3
Posts: 208
Reputation: 1,471

Post » Tue Mar 24, 2015 4:17 pm

Fireche wrote:i did that..it doesnt work lol..do you mind uploading a test project where the setup is correct? i really dont know why it doesnt work for me


Nope ... would be no use seeing as the issue is on your end.

You could post your capx ....
Who dares wins
B
56
S
16
G
21
Posts: 1,875
Reputation: 19,406

Post » Tue Mar 24, 2015 4:26 pm

here you go..i want the sprite in the bottom right to stay where it is..and the new instances which spawn to move

file-upload(dot) net / download-10460583/prokect.zip.html

lol i cant upload files, so ~
B
12
S
3
Posts: 208
Reputation: 1,471

Post » Tue Mar 24, 2015 5:22 pm

@Fireche: Where you created the new objects? In the editor? Because there it doesn't work. What i meant is, that you need to create the new objects at runtime (with code in the eventsheet) : system -> create object [https://www.scirra.com/manual/125/system-actions]

Then you can set the instance variable for the currently created object. If you want to create more objects, you can use a loop for this.
B
11
S
2
Posts: 213
Reputation: 1,266

Previous

Return to How do I....?

Who is online

Users browsing this forum: ankas, iBarin, whitephon, WhosWho and 12 guests