==== Jacbo ==== My favorite coding language is pac3 proxies lol You can dm me for help with proxy related things on discord but for other stuff please use the help channel in the pac3 discord %%Jacbo#1222%%\\ \\ ==== Some useful proxy expressions ==== [[nopagesothistextisyellow|You can use """"variables""""!]]: You can use model scales as variables and even have 6 "variables" useable by 1 proxy. If you set the target part of a proxy to a model, owner_scale_x() will be the model that the proxy is a child of in the editor and parent_scale_x() will be the scale of the target part.\\ \\ Variables will be indicated like **__this__** * [[nopagesothistextisyellow|Rounding a number:]] floor(**__INPUT__** + 0.5) * [[nopagesothistextisyellow|Checking if A > B:]] clamp%%((%%**__A__**-**__B__**)*1000000,0,1) * This will return 1 if **__A__** is greater than (>) **__B__**, else it will return 0 * [[nopagesothistextisyellow|Checking if A < B:]] clamp%%((%%**__B__**-**__A__**)*1000000,0,1) * This will return 1 if **__A__** is less than (<) **__B__**, else it will return 0 * [[nopagesothistextisyellow|Checking if A < B < C:]] clamp%%((%%clamp(**__C__**-**__B__**,0,1)*clamp(**__B__**-**__A__**,0,1))*1000000,0,1) * This will return 1 if **__A__** < **__B__** and if **__B__** < **__C__**, else it will return 0 * [[nopagesothistextisyellow|Set and store a random number:]] **__SETRANDOM__**%%*%%(rand()*(**__MAX__**-**__MIN__**)+**__MIN__**)+(1-**__SETRANDOM__**)*owner_scale_x() * This would go in a proxy setting the x part of the scale of its parent. When **__SETRANDOM__** is 0, it keeps the current value. When **__SETRANDOM__** is 1, it will set a new random value **every frame**. You could replace **__SETRANDOM__** with owner_scale_y() so it can be controlled by other proxies * [[nopagesothistextisyellow|Fade A to B:]] owner_scale_x()+clamp(**__FADETO__**-owner_scale_x(),-**__SPEED__**%%*%%ftime(),**__SPEED__**%%*%%ftime()) * This will fade the x scale of the parent to **__FADETO__** at a constant **__SPEED__** that is the same at any FPS. You could replace **__FADETO__** with owner_scale_y() so it can be controlled with other proxies. ==== Animation proxies ==== You can play animations at the original rate with proxies. At the time of writing this, the animation part currently does not play animations at 1x speed for a rate of 1, and the value you need to use for 1x speed is different for each animation. Set the rate on the animation part to 0, and set the proxy's "variable name" field to "Offset". **__DURATION__** = duration of the animation **__RATE__** = playback speed multiplier **__MIN__**, **__MAX__**, and **__OFFSET__** are the same as on the animation part * [[nopagesothistextisyellow|Looping 1x speed:]] (timeex()/**__DURATION__**)%1 * [[nopagesothistextisyellow|Looping 1x speed with offset:]] (timeex()/**__DURATION__**+**__OFFSET__**)%1 * [[nopagesothistextisyellow|Looping with speed multiplier:]] (timeex()***__RATE__**%%/%%**__DURATION__**)%1 * [[nopagesothistextisyellow|Looping with min and max:]] **__MIN__**+(timeex()/**__DURATION__**/(**__MAX__**-**__MIN__**))%1*(**__MAX__**-**__MIN__**) * [[nopagesothistextisyellow|Looping with min, max, and offset:]] **__MIN__**+%%((%%timeex()/**__DURATION__**+**__OFFSET__**)/(**__MAX__**-**__MIN__**))%1*(**__MAX__**-**__MIN__**) * [[nopagesothistextisyellow|Ping pong loop at 1x speed:]] abs(1-(timeex()/**__DURATION__**+1)%2) * [[nopagesothistextisyellow|Ping pong loop with min and max:]] **__MIN__**+abs(1-(timeex()/**__DURATION__**/(**__MAX__**-**__MIN__**)+1)%2)*(**__MAX__**-**__MIN__**) * [[nopagesothistextisyellow|Ping pong loop with min, max, and offset:]] **__MIN__**+abs(1-%%((%%timeex()/**__DURATION__**+**__OFFSET__**)/(**__MAX__**-**__MIN__**)+1)%2)*(**__MAX__**-**__MIN__**) * Note: When using ping pong looping, **__OFFSET__** is 0 to 2 for a **__MIN__** of 0 and **__MAX__** of 1. You may have to multiply it by 2 to get the results you expect. * [[nopagesothistextisyellow|No loop or X loops:]] min(**__LOOPCOUNT__**,timeex()/**__DURATION__**)%1 * Use a **__LOOPCOUNT__** of 1 to make it not loop. Use a **__LOOPCOUNT__** to make it play twice, etc. * [[nopagesothistextisyellow|No loop or X loops, ping pong:]] abs(1-(min(**__LOOPCOUNT__**%%*%%2,timeex()/**__DURATION__**)+1)%2)