So, I have a solution to this. But it took a while for me to figure out what was wrong so I thought I'd post anyway.
TweenCustom's initial values are always zero, no matter what value is supplied. The desired initial value seems to be its second value. I've tested and this isn't the case for TweenSprite. The simple solution is to call UpdateTweenCustom twice when first starting it (once in the main loop, plus once after calling PlayTweenCustom), but it isn't desirable. Alternative solution is to just not use TweenCustom and make blank non-visible sprites to handle all positional non-sprite related tweens (like for particles) via TweenSprite. This probably isn't intended behavior, right? Here's an example:
// WINDOW
SetWindowTitle( "tween custom zero bug" )
SetVirtualResolution ( 1024, 768 )
SetOrientationAllowed( 1, 1, 1, 1 )
SetSyncRate ( 60, 0 )
// SETUP RESOURCES
global tweens as integer []
for i = 1 to 10
CreateImageColor ( i, 255, 255, 255, 255 )
CreateSprite ( i, i )
SetSpriteSize ( i, 32, 32 )
SetSpritePosition( i, 500, 300 )
next i
// MAIN LOOP
do
// I'm putting all sprites in the center of the screen.
// This is to demonstrate that the 0,0 location is caused by the tween.
for i = 1 to 10
SetSpritePosition( i, 500, 300 )
next i
// If the tweens array is empty I set up the tweens.
if tweens.length = -1 then SetupBurst( 500, 300, 10 )
// I update all sprite positions based on the tween output.
for i = 1 to 10
SetSpritePosition( i, GetTweenCustomFloat1(tweens[i-1]), GetTweenCustomFloat2(tweens[i-1]) )
next i
// If the tween isn't playing I delete them and prepare a restart on next loop.
if not GetTweenCustomPlaying( tweens[0] )
for i = 0 to tweens.length
DeleteTween( tweens[i] )
next i
tweens.length = -1
endif
// Update everything and sync.
// Note on tween restart that the sprites are located at (0, 0) for one frame.
UpdateAllTweens( GetFrameTime() )
Sync()
loop
// TWEEN INITIALIZATION
function SetupBurst( x, y, n )
radius = 200
au = 360.0 / n
for i = 1 to n
angle = i * au
tx = (radius * Cos(angle)) + x
ty = (radius * Sin(angle)) + y
t = CreateTweenCustom( 0.5 )
// These tweens should start at (x, y), but actually spend one frame at (0, 0)
SetTweenCustomFloat1( t, x, tx, TweenEaseOut1() )
SetTweenCustomFloat2( t, y, ty, TweenEaseOut1() )
PlayTweenCustom( t, 0 )
tweens.insert( t )
next i
endfunction
As you'll see, the sprites will relocate to the location 0, 0 for one frame when the tweens are restarted.