Buildbox 3 Api Documentation

Discussion in 'Technical Discussion' started by itzonator, Oct 25, 2019.

  1. itzonator

    itzonator Serious Boxer

    Joined:
    Dec 18, 2017
    Messages:
    521
    Likes Received:
    191
    Hey boxers,

    Does anyone know if there's the newest API reference for Buildbox 3?

    This seems to be an old one: http://download.buildbox.com/buildbox/assets/documentation/api-3.0.0.2250.html (from Buildbox 3.0.0, #2250). Not all functions are there. ...

    @Sean Buildbox
    We seem to have:
    -> this.scene().totalPoints()
    -> this.scene().decreaseTotalPoints(amount);

    But do we have totalCoins() and decreaseTotalCoins? Something is off and I cannot make it work with Coins.

    @Skyhub Games -> can this be used for the Character System you have made? I can't make it work with Coins. I have a sufficient amount of coins, but when attempt to unlock the character, it says, "No Coins." I have changed totalPoints to totalCoins and decreaseTotalPoints() to decreaseTotalCoins(), but not sure if that's in the API for Buildbox :) Thoughts? It works however, if I purchase a Coin Pack and attempt to unlock. But cannot unlock with collected coins in the game. I feel like it unlocks with Session Coins, not with Total Coins -> maybe that's a Buildbox 3 bug?

    Thanks,
    Itzo
     
  2. Skyhub Games

    Skyhub Games Boxer

    Joined:
    Mar 3, 2019
    Messages:
    47
    Likes Received:
    43
    @itzonator You can use:

    let obj = this.entity()
    for(m in obj)
    log(m);

    This will list all functions of an object in JS
    + You can use like this.entity(), this.scene(), this.camera() and etc etc etc

    If the api isn't updates. This is the best way to get knowledge if you code :)
     
  3. Skyhub Games

    Skyhub Games Boxer

    Joined:
    Mar 3, 2019
    Messages:
    47
    Likes Received:
    43
    For your question.

    You can use this.scene.All things below()


    addScorePoint
    setScorePoint
    addScoreCoin
    decreaseCurrentPoints
    decreaseTotalPoints
    decreaseCoins
    currentPoints
    bestPoints
    totalPoints
    currentGlobalPoints
    bestGlobalPoints
    totalGlobalPoints
    currentCoins
    bestCoins
    totalCoins
    currentGlobalCoins
    bestGlobalCoins
    totalGlobalCoins
    coins

    This is all the points or coins function you can use for now :)
     
    weboha and itzonator like this.
  4. itzonator

    itzonator Serious Boxer

    Joined:
    Dec 18, 2017
    Messages:
    521
    Likes Received:
    191
    @Skyhub Games — thanks for providing those, I think you need to update your character system node as it will not unlock character if points / coins are not set to global.

    In Selector system + price node, you should have it like this:

    var money = this.scene().totalGlobalPoints()

    not
    var money = this.scene().totalPoints()

    This solved the problem for me :)

    Itzo
     
  5. Skyhub Games

    Skyhub Games Boxer

    Joined:
    Mar 3, 2019
    Messages:
    47
    Likes Received:
    43
    Will do thx :)
     
  6. AaroArts

    AaroArts Miniboss Boxer

    Joined:
    Jun 22, 2016
    Messages:
    1,532
    Likes Received:
    812

Share This Page