Platform Builder Forums
Main => Suggestions => Topic started by: Antikore on April 28, 2020, 06:37:24 PM
-
Some operational commands that allow better usability for cps
absolute game var nonegatives //Sets the game variable nonegatives to its absolute (Removes the sign)
[sign course var direction] //Returns -1, 0 or 1, depending on the value inside. If its negative, positive or 0.
clamp var i = 3, 10 //Clamps the var i aka keeps the value of var i inside two values (3 and 10 in this case)
seed = 1 //Sets the seed for randomizing
[seed] //Returns the seed used currently for randomizing.
-
What would you need these things for?
-
What would you need these things for?
Specially clamp and seed.
Seed for my dungeon games maybe and clamp for clamping variables.
-
I think I know what the seed is for, but I have no clue what a clamp is.
-
I think I know what the seed is for, but I have no clue what a clamp is.
Clamp is for keeping a variable between two values
So instead of doing
if var time > 300
var time = 300
if var time < 0
var time = 0
We can do
clamp var time = 0, 300
-
I sort of get it, but like TingThing said, I'm not 100% sure how important that is to PB.