Behavior Action that modifies SOL

For developers using the Construct 2 Javascript SDK

Post » Wed Feb 12, 2014 7:23 pm

Hi all,

I'm developing a Behavior that has an Action which will narrow down the selected instances (of the object with that behavior) by comparing some parameters and properties. The problem I have is that the SOL does not reset to select_all after an Event block.

e.g.

-> Every Tick
--> [Action] Sprite | Pick instances where Property value is "Parameter value" #Selects 1 sprite.

-> Every Tick
--> [Action] Sprite | Set X to Sprite.X + 50 * dt

Expected result:
- All sprite objects to move.
Actual result:
- Only the selected sprite object moves. (It stays that way until another condition picks all of the object type)

However, it works as intended if I simply add an object parameter to the action (even without modifying the runtime code to use the object type).

Any ideas? (Is it actually OK to change the SOL of an object type through an action?)

Thanks!aruche2014-02-12 19:25:48
B
163
S
120
G
9732
Posts: 42
Reputation: 4,875,331

Post » Wed Feb 12, 2014 9:51 pm

In the Construct 2 engine, you are not allowed to modify the SOL of any object types other than the self type unless the type you want to modify is given in an object parameter, so this is by design. If arbitrary modifications were allowed, we would have to turn off a very important optimisation that prevents a slowdown proportional to the number of objects in the project.
Scirra Founder
B
402
S
238
G
89
Posts: 24,632
Reputation: 196,031

Post » Wed Feb 12, 2014 11:08 pm

Okay I'll forget about the idea then.

Thanks for clarifying! :)
B
163
S
120
G
9732
Posts: 42
Reputation: 4,875,331


Return to Javascript SDK

Who is online

Users browsing this forum: No registered users and 0 guests