[C2 109] call function after delay (with picking)

Bugs will be moved here once resolved.

Post » Thu Nov 08, 2012 8:32 pm

Little example of how to use the new function object with system wait to carry out a function after delay that also preserves picking.
Something CC couldn't do... at least not this easily.

Nice one Ashley.

https://dl.dropbox.com/u/666516/callfunctionafterdelay.capx

Also in case you were wondering, you can break the picking by just moving the call function sub event up a tier.newt2012-11-08 20:41:45
Image Image
B
161
S
48
G
89
Posts: 7,347
Reputation: 66,249

Post » Fri Nov 09, 2012 2:40 am

Hmm... this is actually a bug, I didn't intend for it to work this way. 'On function' should be working with a clean slate and not involve any objects that were previously picked. If you add the condition 'Sprite: is on screen' to the 'On function' event it stops working as expected. So I'm afraid I think this will be fixed to work consistently in a future release.
Scirra Founder
B
359
S
214
G
72
Posts: 22,946
Reputation: 178,468

Post » Fri Nov 09, 2012 3:46 am

Well that sucks.
Then again I don't see why you couldn't use the iid in the functions parameter.

Edit link:
https://dl.dropbox.com/u/666516/callfunctionafterdelay.capx
Now shows it using the iid. With a possible bug below.

Also @Ashley I may now have another bug. It seems the expression Function.Param(0) isn't working. Unless I'm using it wrong.

Either way I guess this can now go to the bugs forum so as to not confuse people.newt2012-11-09 04:38:03
Image Image
B
161
S
48
G
89
Posts: 7,347
Reputation: 66,249

Post » Fri Nov 09, 2012 7:13 pm

Function.Param(0) seems to be working fine here.

I've fixed SOLs being accidentally re-used for the next build though.
Scirra Founder
B
359
S
214
G
72
Posts: 22,946
Reputation: 178,468

Post » Fri Nov 09, 2012 7:28 pm

Ok, yeah the value is being passed. Pick nth wasn't picking it up.
Ive changed the example capx to show what I did.

Also compare variable works.
Image Image
B
161
S
48
G
89
Posts: 7,347
Reputation: 66,249

Post » Fri Feb 22, 2013 9:39 am

Not sure if this is my error or a functional error:
Or if it is even related to this...


Example:

SYSTEM - On Start of Layout
Create TEXTBOX
Dictionary add Key BOX1 with value TEXBOX.UID
Create TEXTBOX
Dictionary add Key BOX2 with value TEXBOX.UID
Function SetBOX1
Function SetBOX2
Function FillBOXES

FUNCTION FillBOXES
TEXTBOX Pick Instance with UID Dictionary.Get("BOX1")
TEXTBOX set text to Array.At(0,0,0)
TEXTBOX Pick Instance with UID Dictionary.Get("BOX1")
TEXTBOX set text to Array.At(0,1,0)

FUNCTION SetBOX1
Array Set value at(0,0,0) to "John"

FUNCTION SetBOX2
Array Set value at(0,0,0) to "Doe"


================================================
The Issue:
================================================
In runs through fine and fires the FillBOXES function but will NOT fire the:

TEXTBOX Pick Instance with UID Dictionary.Get("BOX1")
TEXTBOX set text to Array.At(0,0,0)
TEXTBOX Pick Instance with UID Dictionary.Get("BOX1")
TEXTBOX set text to Array.At(0,1,0)

UNLESS I put a "Wait" on action of the Function FillBOXES like this:

FUNCTION FillBOXES SYSTEM Wait 0.5
TEXTBOX Pick Instance with UID Dictionary.Get("BOX1")
TEXTBOX set text to Array.At(0,0,0)
TEXTBOX Pick Instance with UID Dictionary.Get("BOX1")
TEXTBOX set text to Array.At(0,1,0)

==================================================

Is it me not understanding the order of events to fire or is there something else?
Thanks


    
B
13
S
1
Posts: 17
Reputation: 946


Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 6 guests