create account

Tutorial #1 - Setting up OpenSeed in your project. by openseed

View this thread on: hive.blogpeakd.comecency.com
· @openseed · (edited)
$0.64
Tutorial #1 - Setting up OpenSeed in your project.
# Intro

This tutorial goes over how to start using OpenSeed in your next Godot based game project. The code is written in GDscript and is designed to remove as many hurtles as possible for the game developer. This tutorial wont go over any of the finer points of making a game in Godot, but the reader should be able to glean information on how certain things are done based on the info given here.

### Prerequisites

1. [Godot](https://www.godotengine.org): OpenSource Game engine we're using as a basis for development of OpenSeed
2. Developer ID on OpenSeed*
3. App ID on OpenSeed*
4. STEEM Account to use as a master account (not your personal account)
5. Private Posting Key of a STEEM account.


*At the time of writing there is no developer portal to create or manage your account. If you are planning on using OpenSeed for your game you will need to contact us on Discord by joining the [OpenSeed Server](https://discord.gg/87HjXNX). 


### Downloading OpenSeed

Before we begin you will need to get the latest version of OpenSeed from the git repository [here](https://github.com/bflanagin/openseed-steem-godot). If you don't know how to use git don't worry, you can just download the zip file.

Once the source code has been downloaded and extracted (if you used the zip file) you're ready to start. 

---

## Step 1

Start by copying these files from the openseed-steem-godot folder to your game project's folder:

* OpenSeed.gd
* Login.gd
* Login.tscn
* NewAccount.tscn
* NewAccount.gd

At the moment the scripts will look for each other in the root of the games directory (meaning the top most folder within the game project). If you would like to move the OpenSeed files to some place else you will need to update the gd scripts to point to the right place.

## Step 2

You will need to fill in some of the variables in the OpenSeed.gd script to make sure everything is pointing to the right place. You should leave everything else alone within the script to ensure everything works.

Please change the following to match your needs:

> var devId = ""
   var appId = ""
   var dev_steem = ""
   var dev_postingkey =""

Once these variables are set the program will be able to connect to the OpenSeed Server, and will be able to post things on behalf of the developer. Of course these fields are considered sensitive information and should be removed before uploading the data to a network source such as github. When you export your game this data is stored in the game itself and not easily accessible by those looking for the information. 

## Step 3

Using the Scene Tree you can now drag and drop Login.tcsn and NewAccount.tcsn into your project. NewAccount is mostly self contained and will function as expected. The Login scene uses signals to tell the game or application if the login was successful and will need the app to do the appropriate actions to finish the login dialog.

Here is how Code Breakers implements these first steps within the main scene of the application.

>var openseed = load("res://OpenSeed.gd")
var OpenSeed = openseed.new()

The above needs to be added to any script that you want to use the OpenSeed functions. This is useful if you want to create your own templates instead of using the ones provided. 

>func _ready():
OpenSeed.loadUserData() 
if OpenSeed.token:
emit.signal("Login",1)
else:
$Login.show()

The above will check for the existence of a user account within the game and if none exists it will prompt the user to log in using their OpenSeed account. However, if it finds a user it sends the signal that the player is logged in and their data has been loaded.

> func _on_login_login(status):
	if status == 1:
		$login.hide()

Finally you need to connect a signal from Login to the script you added the above code to. This will allow you to communicate back and forth to the Login dialog via signals. As you can see from the code once the signal has been received and the status is 1 the prompt closes. 

**Note:** I was unable to get the code block to indent correctly. Follow the code layout in Godot as necessary


### Next Up

In the next tutorial we will go over implementing a leader board so that players have bragging rights forever immortalized as long as the STEEM blockchain exists. 

---

OpenSeed is being developed by @bflanagin for the steem community and indie game developers alike. The development of OpenSeed and any project developed by @v-entertainment or @bflanagin are community funded. If you would like to help with the development of OpenSeed please join the discord server to find out how you can help.
👍  , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , and 138 others
properties (23)
authoropenseed
permlinktutorial-1-setting-up-openseed-in-your-project
categorygamedev
json_metadata{"app":"steempeak/1.14.19","format":"markdown","tags":["gamedev","tutorial","games","openseed"],"users":["bflanagin","v-entertainment"],"links":["https://www.godotengine.org","https://discord.gg/87HjXNX","https://github.com/bflanagin/openseed-steem-godot","/@bflanagin","/@v-entertainment","/@bflanagin"],"image":[]}
created2019-08-21 21:17:03
last_update2019-08-22 11:31:03
depth0
children4
last_payout2019-08-28 21:17:03
cashout_time1969-12-31 23:59:59
total_payout_value0.345 HBD
curator_payout_value0.295 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length4,594
author_reputation18,965,093,545,839
root_title"Tutorial #1 - Setting up OpenSeed in your project."
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id89,799,890
net_rshares2,819,883,904,939
author_curate_reward""
vote details (202)
@archdruid ·
<div class="pull-left">
https://i.imgur.com/OExRVwP.png
</div>
Your post was upvoted by the @archdruid gaming curation team in partnership with @curie to support spreading the rewards to great content. Join the Archdruid Gaming Community at https://discord.gg/6yD2Emr. Good Game, Well Played!
👍  
properties (23)
authorarchdruid
permlinkpwmas0
categorygamedev
json_metadata{"tags":["gamedev"],"users":["archdruid","curie"],"image":["https://i.imgur.com/OExRVwP.png"],"links":["https://discord.gg/6yD2Emr"],"app":"steemit/0.1"}
created2019-08-22 02:55:12
last_update2019-08-22 02:55:12
depth1
children0
last_payout2019-08-29 02:55:12
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length292
author_reputation662,521,596,261
root_title"Tutorial #1 - Setting up OpenSeed in your project."
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id89,807,805
net_rshares47,252,306,965
author_curate_reward""
vote details (1)
@c-squared ·
c-squared-comment
<div class="pull-left">https://cdn.steemitimages.com/DQmaSUWYsJ3AMUEMRqCSaoKJVNvtsbKm4fNAtmTidr8Uggc/C%20Squared%20Logo%20Transparency%20200px.png</div><br>This post was shared in the <a href="https://discord.gg/B8JFmJ4">Curation Collective Discord community</a> for curators, and upvoted and resteemed by the @c-squared community account after manual review.<br/>@c-squared runs a <a href="https://steemit.com/witness/@c-cubed/announcing-the-launch-of-the-new-c-squared-witness">community witness</a>. Please consider using one of your witness votes on us <a href ="https://steemconnect.com/sign/account-witness-vote?witness=c-squared&approve=1">here</a>
👍  
properties (23)
authorc-squared
permlink20190821t215837097z
categorygamedev
json_metadata{"tags":["c-squared"]}
created2019-08-21 22:04:00
last_update2019-08-21 22:04:00
depth1
children0
last_payout2019-08-28 22:04:00
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length655
author_reputation8,872,520,093,091
root_title"Tutorial #1 - Setting up OpenSeed in your project."
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id89,801,000
net_rshares44,882,012,413
author_curate_reward""
vote details (1)
@steemitboard ·
Congratulations @openseed! You have completed the following achievement on the Steem blockchain and have been rewarded with new badge(s) :

<table><tr><td><img src="https://steemitimages.com/60x60/http://steemitboard.com/img/notifications/firstpost.png"></td><td>You published your First Post</td></tr>
<tr><td><img src="https://steemitimages.com/60x60/http://steemitboard.com/img/notifications/firstvoted.png"></td><td>You got a First Vote</td></tr>
<tr><td><img src="https://steemitimages.com/60x70/http://steemitboard.com/@openseed/voted.png?201908212253"></td><td>You received more than 10 upvotes. Your next target is to reach 50 upvotes.</td></tr>
</table>

<sub>_You can view [your badges on your Steem Board](https://steemitboard.com/@openseed) and compare to others on the [Steem Ranking](https://steemitboard.com/ranking/index.php?name=openseed)_</sub>
<sub>_If you no longer want to receive notifications, reply to this comment with the word_ `STOP`</sub>



###### [Vote for @Steemitboard as a witness](https://v2.steemconnect.com/sign/account-witness-vote?witness=steemitboard&approve=1) to get one more award and increased upvotes!
properties (22)
authorsteemitboard
permlinksteemitboard-notify-openseed-20190821t235359000z
categorygamedev
json_metadata{"image":["https://steemitboard.com/img/notify.png"]}
created2019-08-21 23:54:00
last_update2019-08-21 23:54:00
depth1
children0
last_payout2019-08-28 23:54:00
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length1,145
author_reputation38,975,615,169,260
root_title"Tutorial #1 - Setting up OpenSeed in your project."
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id89,803,459
net_rshares0
@steemitboard ·
@openseed, thank you for supporting @steemitboard as a witness.

[![](https://steemitimages.com/70x70/http://steemitboard.com/img/notifications/supportboard.png)](https://steemitboard.com/@openseed) Here is a small present to show our gratitude
<sub>_Click on the badge to view your Board of Honor._</sub>

Once again, thanks for your support!

**Do not miss the last post from @steemitboard:**
<table><tr><td><a href="https://steemit.com/steemfest/@steemitboard/the-new-steemfest-badge-is-ready"><img src="https://steemitimages.com/64x128/https://cdn.steemitimages.com/DQmRUkELn2Fd13pWFkmWU2wBMMx39EBX5V3cHBEZ2d7f3Ve/image.png"></a></td><td><a href="https://steemit.com/steemfest/@steemitboard/the-new-steemfest-badge-is-ready">The new SteemFest⁴  badge is ready</a></td></tr></table>
properties (22)
authorsteemitboard
permlinksteemitboard-notify-openseed-20191011t004408000z
categorygamedev
json_metadata{"image":["https://steemitboard.com/img/notify.png"]}
created2019-10-11 00:44:09
last_update2019-10-11 00:44:09
depth1
children0
last_payout2019-10-18 00:44:09
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length785
author_reputation38,975,615,169,260
root_title"Tutorial #1 - Setting up OpenSeed in your project."
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id91,431,913
net_rshares0