Sine behavior

Bugs will be moved here once resolved.

Post » Mon Oct 01, 2012 1:30 pm

Sine behavior is missing some actions to allow setting the following:

Period Random
Period Offset
Period Offset Random
Magnitude Random

To reproduce:
Add sprite, add sine behavior.
Add every tick event, add action to sprite.
"View" missing sine actions.


B
7
S
1
Posts: 74
Reputation: 1,232

Post » Mon Oct 01, 2012 2:32 pm

Comfirmed. I thought that was how it was supposed to be but thinking about it, there's no sense in those options not being available at runtime. Unless it's a technical issue.
B
19
S
5
G
4
Posts: 208
Reputation: 3,960

Post » Mon Oct 01, 2012 4:56 pm

These values are only applied the moment the object is created, then they're never used again. So it's impossible to use the proposed actions, because by the time you use one of these actions it's too late, the value being changed is never used.

Workaround: use 'set period' or 'set magnitude' and apply the offset and randomness yourself. For example, set the magnitude to MyMagnitude + random(MyMagnitudeRandom).
Scirra Founder
B
359
S
214
G
72
Posts: 22,949
Reputation: 178,574

Post » Sat Jan 26, 2013 4:22 pm

But, what about offset?... you can't do those tricks :(
B
3
Posts: 9
Reputation: 693

Post » Sat Jan 26, 2013 7:57 pm

@gameron: it works the same.
You offset is simply a value, use global (constant) variable.

Set the magnitude to MyMagnitude + (or -) MyOffset in the same way it was proposed in Ashley's post.
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 6,999
Reputation: 57,793

Post » Wed Feb 13, 2013 1:56 pm

If you set an offset you have the same magnitude but start en different point. You cannot randomize the point you start if you cant modify the offset, can you?
Thanks!

Update:
To add details... I spawn 3 enemies with this behavior and the first i want to be randomized and the rest I want to set the same offset.gameron2013-02-13 14:09:07
B
3
Posts: 9
Reputation: 693

Post » Fri Feb 07, 2014 8:27 am

+1 on This.

I'm generating strings of objects on the fly, and they're supposed to have a "snake like" motion, with the same exact parameters (magnitude and period needs to be the exact same one on all objects in a group) but with a time offset. Without access to the "offset" parameter I can't figure out a good way to do it.

Thanks!
B
5
S
1
G
2
Posts: 8
Reputation: 1,271

Post » Fri Feb 07, 2014 10:22 am

I figured a way to do this, but had to use two timers (a short one for object generation, a long one to stop generating objects).

Being able to access the offset would be much easier. Since the offset is only used when the object is created, maybe a "Reset" method could force the offset to be read at any point in the game?

Here's a little example, using timers instead of the offset:
http://www.leosantos.com/storage/test/example/index.html

B
5
S
1
G
2
Posts: 8
Reputation: 1,271


Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 2 guests