[Plugin] Ethereum

1 favourites
  • 3 posts
From the Asset Store
The I18N (Translation) is a Construct plugin created to translate text in game.
  • Here are two plugins to integrate the Ethereum Blockchain in your game.

    Some details

    They both use the Web3 Javascript API version 0.2, so it works with all compatible browsers, like Metamask or Mist.

    Like in Web3, there are 2 ways to call most functions: synchronous or asynchronous (although some nodes like Metamask don't support synchronous calls).

    To call a function synchronously:

    • Just use the corresponding Expression or Action

    To call a function asynchronously:

    • Add the corresponding action, with a chosen callbackID parameter
    • Add an OnCallback condition with the same callbackID
    • Use Ethereum(or the EthereumContract).CurrentCallbackResponse to get the function's response

    The plugins

    :

    Ethereum

    Contains most functions in the Web3 API (let me know if some useful ones are missing). Go to the page linked higher for a complete list and descriptions.

    Ethereum Contract

    Facilitates communication with a smart contract. The contract's ABI and address are properties of the plugin, so an instance is created on the plugin's creation.

    The main actions are:

    • Call : Calls a constant function of the contract
    • Send : Sends a transaction to the contract

    Examples

    There is a simple example project in the github project.

    You can also look at this real life project that uses the plugin.

    Possible Improvements

    • Multiple contract addresses for the different networks
    • Implement CallSuchFunctionAndWait actions to use asynchronous functions like if they were synchronous (in the meantime, you can use WaitForSignal to do that)
    • Other improvements you will suggest
  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • This looks interesting. Thanks. Do you have any experience with other blockchains/currencies that can be programmed like Ethereum?

  • No, I've only messed around with Ethereum for now.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)