Page 1 of 1

Thyme event values

PostPosted: Sun Aug 05, 2018 2:39 pm
by FRA32
I've been taking a look at the exact contents of the (e) value in each event, to see how many additional values besides e.this etc. existed. Here is a list of all values I found (e.this, e.other, e.geom and e.laser are left out)

Poststep:
float dt - The elapsed time since the last scene frame

Update:
float dt - The elapsed time since the last update;

OnCollide:
array normal: The collision normal
array pos: The point of collision
float soundGain: Appears to scale with collision impact force.

onClick:
array pos: Position of the cursor
int clickCount: how many clicks have occured in short succession
bool handled: still unsure about this


OnKey:
bool pressed: True when a key was pressed, false when released
string keyCode: The name of the key being held
string keyChar: The text symbol created by the key(If no symbol exists, i.e. arrow keys, this value does not exist either)
bool handled: Unsure about this

OnLaserHit:
array normal: normal of the hit surface
array pos: Point of hit

OnHitByLaser: Identical to above

OnDie: No additional values

OnSpawn: No additional values

Re: Thyme event values

PostPosted: Thu Aug 09, 2018 6:57 am
by Xray
Thanks, FRA32, for that list of event values! I already was familiar with many of them, but there are some new ones which might be very useful in a future project. I plan to experiment with them. :geek:

I am curious as to how you "found" those values. Did you reverse-engineer one of the Algodoo files?

Thanks again for your helpful information! :thumbup:

Re: Thyme event values

PostPosted: Thu Aug 09, 2018 9:17 pm
by FRA32
I found those out while thinking about the algodoo "class" type, which is what algodoo complains about if you try making var={val1=x,val2=y} variables, which algodoo can't cast into classes. I wanted to see how exactly this looks like in existing classes, so I did scene.my.text = ""+e on all events and then displayed that, thus allowing me to see the exact structure and content without it being interpreted by thyme, which would cause it to error away(as you might know from storing entityByGeomId's in vars).