lua.wetgenes.gamecake.zone.scene.values
zone_scene = require("wetgenes.gamecake.zone.scene")
values = zone_scene.create_values()
Create and return a values object.
This is an array of objects representing the main object in values[1] and future predictions in values[2],values[3] etc etc.
The key values in the higher numbers overide key values in the lower numbers so essentially only changes need to be written into the predicted slots.
lua.wetgenes.gamecake.zone.scene.values.get
value=values:get(key)
value=values:get(key,topidx)
Get the current value for this key by searching from the top of the stack to the bottom and returning the first non nil value we find.
If topidx is given then get the value at this idx, this would normally be negative in which it counts back from the end. So it is easy to time travel back a frame into the cached values with -1 as the idx.
lua.wetgenes.gamecake.zone.scene.values.manifest
value=values:manifest(key,value)
Get the current value for this key if there is no current value then set the current value.
This uses values:get and values:set to perform these actions.
lua.wetgenes.gamecake.zone.scene.values.new
values2 = values:new()
Create and return a new values object with a single slot containing an empty object.
lua.wetgenes.gamecake.zone.scene.values.push
values:push()
Add a new slot to the end of the values array. Future values will be writen into this new slot.
lua.wetgenes.gamecake.zone.scene.values.set
values:set(key,value)
If this is different from the current value then write the value into the key of the object at the top of the stack. Hence future gets will get this new value.
lua.wetgenes.gamecake.zone.scene.values.tween
value=values:tween(key,tween)
Tween between the current value(1) and the previous value(0).
A tween of 0 gets the previous value, a tween of 1 gets the current value and any other tween will get a mix between the two if that is possible.
We can only mix numbers or tardis values, other values will round to either 0 or 1 whichever is closest and then get that whole value.
lua.wetgenes.gamecake.zone.scene.values.twrap
value=values:twrap(key,nmax,tween)
Tween wrap between the current value and the previous value.
Result will be in rang of 0>= n <nmax , blended in the shortest direction.
nmax may be a number or a tardis value for nmax per dimension
A tween of 0 gets the previous value, a tween of 1 gets the current value and any other tween will get a mix between the two if that is possible.
We can only mix numbers or tardis values, other values will round to
either 0 or 1 whichever is closest and then get that whole value.
lua.wetgenes.gamecake.zone.scene.values.unpush
values:unpush()
Remove top pushed slot.