Buildbox 3 Api Documentation

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

  1. itzonator

    itzonator Serious Boxer

    Joined:
    Dec 18, 2017
    Messages:
    595
    Likes Received:
    230
    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
     
    TheGameAppStudio likes this.
  2. Clixo Games

    Clixo Games Boxer

    Joined:
    Mar 3, 2019
    Messages:
    51
    Likes Received:
    61
    @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. Clixo Games

    Clixo Games Boxer

    Joined:
    Mar 3, 2019
    Messages:
    51
    Likes Received:
    61
    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 :)
     
  4. itzonator

    itzonator Serious Boxer

    Joined:
    Dec 18, 2017
    Messages:
    595
    Likes Received:
    230
    @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
     
    Rameo and TheGameAppStudio like this.
  5. Clixo Games

    Clixo Games Boxer

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

    AaroArts Miniboss Boxer

    Joined:
    Jun 22, 2016
    Messages:
    1,546
    Likes Received:
    826
  7. TheGameAppStudio

    TheGameAppStudio Serious Boxer

    Joined:
    Nov 2, 2016
    Messages:
    927
    Likes Received:
    318
  8. TheGameAppStudio

    TheGameAppStudio Serious Boxer

    Joined:
    Nov 2, 2016
    Messages:
    927
    Likes Received:
    318
    Update :
    I used var money = this.scene().totalGlobalCoins() and
    this.scene().decreaseCoins(price);

    and the character gets unlocked but the problem is the entire coins get deducted.Say coins to unlock character is 3 and i have 4 coins.On click total coins become 0 instead of 1 in character selection screen.Did anyone noticed? @itzonator @Skyhub Games @Hanomax
     
    Bignathan7 likes this.

Share This Page