Author Topic: Some operational commands  (Read 1523 times)

Antikore

  • Developing Mortal Theater at day, developing depression at night.
  • Level 22: Trex
  • *
  • Posts: 2020
  • Enjoying Platform Builder from the very start
    • View Profile
    • PBuilder Resources
Some operational commands
« on: April 28, 2020, 06:37:24 PM »
Some operational commands that allow better usability for cps
Code: [Select]
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.
Sorry because my English is not very good because I'm Spanish ;) :P

TingThing

  • Admin and Developer
  • Level 20: Nobom
  • *
  • Posts: 1395
  • Creator and Developer of Platform Builder
    • View Profile
    • Platform Builder Home
Re: Some operational commands
« Reply #1 on: May 11, 2020, 05:53:26 AM »
What would you need these things for?

Antikore

  • Developing Mortal Theater at day, developing depression at night.
  • Level 22: Trex
  • *
  • Posts: 2020
  • Enjoying Platform Builder from the very start
    • View Profile
    • PBuilder Resources
Re: Some operational commands
« Reply #2 on: May 11, 2020, 06:33:04 AM »
What would you need these things for?
Specially clamp and seed.
Seed for my dungeon games maybe and clamp for clamping variables.
Sorry because my English is not very good because I'm Spanish ;) :P

CGM

  • Christian, 3D artist, former Platform Builder gamdev
  • Master Builder
  • *
  • Posts: 3836
    • View Profile
Re: Some operational commands
« Reply #3 on: May 11, 2020, 04:32:31 PM »
I think I know what the seed is for, but I have no clue what a clamp is.

Antikore

  • Developing Mortal Theater at day, developing depression at night.
  • Level 22: Trex
  • *
  • Posts: 2020
  • Enjoying Platform Builder from the very start
    • View Profile
    • PBuilder Resources
Re: Some operational commands
« Reply #4 on: May 14, 2020, 02:47:19 PM »
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
Code: [Select]
if var time > 300
var time = 300
if var time < 0
var time = 0
We can do
Code: [Select]
clamp var time = 0, 300
Sorry because my English is not very good because I'm Spanish ;) :P

CGM

  • Christian, 3D artist, former Platform Builder gamdev
  • Master Builder
  • *
  • Posts: 3836
    • View Profile
Re: Some operational commands
« Reply #5 on: May 14, 2020, 05:19:19 PM »
I sort of get it, but like TingThing said, I'm not 100% sure how important that is to PB.