From Test-Scratch-Wiki

m (Bloklar ve başlıklar çevrildi, birkaç düzeltme yapıldı. HighFlyer222, yardımların için teşekkür ederim.)
 
(One intermediate revision by one other user not shown)
Line 5: Line 5:
 
Scratch 1.3 sürümünde listelerin eklenmesiyle birlikte, artık bunu yapmak daha kolaylaştı. Bir listeye sağ tıklanınca listeyi içeriye veya dışarıya aktarma seçenekleri veriliyor. Ve bu da istenen yerde listein [[Wikipedia:Text file#.TXT|.txt]] dosyasını oluşturuyor.
 
Scratch 1.3 sürümünde listelerin eklenmesiyle birlikte, artık bunu yapmak daha kolaylaştı. Bir listeye sağ tıklanınca listeyi içeriye veya dışarıya aktarma seçenekleri veriliyor. Ve bu da istenen yerde listein [[Wikipedia:Text file#.TXT|.txt]] dosyasını oluşturuyor.
  
=== İyi yönleri ===
+
=== İyi yanları ===
 
Bir oyunda kaldığın yeri kaydedebilmek pek çok oyun geliştiricisi için çok kullanışlı bir özelliktir. Bazı faydaları şunlardır:
 
Bir oyunda kaldığın yeri kaydedebilmek pek çok oyun geliştiricisi için çok kullanışlı bir özelliktir. Bazı faydaları şunlardır:
  
Line 21: Line 21:
 
*Scratch’i iyi bilmeyen kullanıcıların kafası karışabilir.
 
*Scratch’i iyi bilmeyen kullanıcıların kafası karışabilir.
  
=== How to Prevent Problems ===
+
=== Problemler Nasıl Önlenebilir? ===
 
There are several ways to try and prevent the above cons from happening:
 
There are several ways to try and prevent the above cons from happening:
  
Line 31: Line 31:
 
#Include detailed instructions on how the game works for new players so that they can understand exactly how to play it.
 
#Include detailed instructions on how the game works for new players so that they can understand exactly how to play it.
  
=== Examples ===
+
=== Örnekler ===
 
[http://scratch.mit.edu/projects/1343237 Farmville V1.5] by [https://scratch.mit.edu/users/dazman/ dazman]
 
[http://scratch.mit.edu/projects/1343237 Farmville V1.5] by [https://scratch.mit.edu/users/dazman/ dazman]
  
 
[https://scratch.mit.edu/projects/24646371/ Shaper] by [https://scratch.mit.edu/users/jerry1000/ jerry1000]
 
[https://scratch.mit.edu/projects/24646371/ Shaper] by [https://scratch.mit.edu/users/jerry1000/ jerry1000]
  
===Tutorial===
+
===Öğretici===
This tutorial will go over making a simple save system which stores values in a list.
+
Bu öğretici bir listede değerleri kaydeden basit bir sistem yapmayı gösterecek.
  
 
All the data will be stored in a single string which will be put back into the project at a later date to load the old data the player had.
 
All the data will be stored in a single string which will be put back into the project at a later date to load the old data the player had.
Line 43: Line 43:
 
To start, make a list called "Save Data". Next, make the following [[Eng:Proc|custom block]] which will save data:
 
To start, make a list called "Save Data". Next, make the following [[Eng:Proc|custom block]] which will save data:
 
<scratchblocks>
 
<scratchblocks>
define save (value)
+
tanımla kaydet (değer)
add (join (value) [;]) to [Save Data v]
+
((değer) ve [;] 'i birleştir) i [Veri Kaydet v] ye ekle
 
</scratchblocks>
 
</scratchblocks>
  
 
You can then make a script to save any variables you want:
 
You can then make a script to save any variables you want:
 
<scratchblocks>
 
<scratchblocks>
save (x position) //category=custom
+
kaydet (x pozisyonu) :: custom-arg
save (health) //category=custom
+
kaydet (can) :: custom-arg
save (money) //category=custom
+
kaydet (para) :: custom-arg
 
</scratchblocks>
 
</scratchblocks>
  
 
The next step is to give the save code to the user so they can enter it in later. First you want to make a variable called code. You can do so like this:
 
The next step is to give the save code to the user so they can enter it in later. First you want to make a variable called code. You can do so like this:
 
<scratchblocks>
 
<scratchblocks>
set [code v] to [] //Make sure there is nothing inside the second input
+
[kod v] i [] yap // İkinci girdinin boş olduğundan emin olun
repeat until <(length of [Save Data v]) = [0]>
+
<([Veri Kaydet v] 'in uzunluğu) = [0]> olana kadar tekrarla
set [code v] to (join (code) (item (1 v) of [Save Data v]))
+
  [kod v] i ((kod) ve ([Veri Kaydet v] nin (1 v) öğesi) 'i birleştir) yap
delete (1 v) of [Save Data v]
+
  [Veri Kaydet v] nin (1 v) ini sil
 
end
 
end
add (code) to [Save Data v]
+
(kod) i [Veri Kaydet v] ye ekle
show list [Save Data v]
+
[Veri Kaydet v] listesini göster
 
</scratchblocks>
 
</scratchblocks>
 
The user can then export the list or copy and paste the code somewhere.
 
The user can then export the list or copy and paste the code somewhere.
Line 68: Line 68:
 
Finally, the user needs to be able to load data. Make a list called "Loaded Data" and a variable called "i", then make the following custom block:
 
Finally, the user needs to be able to load data. Make a list called "Loaded Data" and a variable called "i", then make the following custom block:
 
<scratchblocks>
 
<scratchblocks>
define load data (data)
+
tanımla veri yükle (veri)
set [i v] to [1]
+
[i v] i [1] yap
set [value v] to [] //Make sure the second input is blank
+
[değer v] i [] yap // İkinci girdinin boş olduğundan emin olun
repeat until <(i) > (length of (data))>
+
<(i) > ((veri) 'in uzunluğu)> olana kadar tekrarla
repeat until <(letter (i) of (data)) = [;]>
+
  <((veri) in (i) . harfi) = [;]> olana kadar tekrarla
set [value v] to (join (value) (letter (i) of (data)))
+
    [değer v] i ((değer) ve ((veri) in (i) . harfi) 'i birleştir) yap
change [i v] by (1)
+
    [i v] i (1) kadar değiştir
end
+
  end
add (value) to [Loaded Data v]
+
  (değer) i [Yüklenmiş Veri v] ye ekle
change [i v] by (1)
+
  [i v] i (1) kadar değiştir
set [value v] to [] //Make sure the second input is blank
+
  [değer v] i [] yap // İkinci girdinin boş olduğundan emin olun
end
+
end</scratchblocks>
</scratchblocks>
 
  
 
Now you simply need to load the data in the order that you saved it. You first ask the player for their save code, then load the data, and then store the loaded data. So for the above example where "x position" is stored, then "health", then "money". The loading script would look like this:
 
Now you simply need to load the data in the order that you saved it. You first ask the player for their save code, then load the data, and then store the loaded data. So for the above example where "x position" is stored, then "health", then "money". The loading script would look like this:
 
<scratchblocks>
 
<scratchblocks>
ask [Save code?] and wait
+
[Save code?] diye sor ve bekle
load data (answer) //category=custom
+
veri yükle (cevap) :: custom-arg
set x to (item (1 v) of [Loaded Data v])
+
x konumunu ([Yüklenmiş Veri v] nin (1 v) öğesi) yap
set [health v] to (item (2 v) of [Loaded Data v])
+
[can v] i ([Yüklenmiş Veri v] nin (2 v) öğesi) yap
set [money v] to (item (3 v) of [Loaded Data v])
+
[para v] i ([Yüklenmiş Veri v] nin (3 v) öğesi) yap
 
</scratchblocks>
 
</scratchblocks>
  
 
If you get lost you can look here for help: https://scratch.mit.edu/projects/56698396/
 
If you get lost you can look here for help: https://scratch.mit.edu/projects/56698396/
  
== Saving Data with Encryption==
+
== Şifreleme ile Veri Kaydetme ==
 
Another method for saving data in Scratch is through the use of . With this method, the user is prompted to enter a code when the game starts and is given a new code when he or she wishes to leave. These codes can be used to determine where in the game players left off. For example, let's say that you were playing a scrolling game and you had 2 lives left and 5 cash. When you saved the game, you would get a code of 25. When you resumed the game, it would set your lives to the first letter of the code and set your cash to the second letter.
 
Another method for saving data in Scratch is through the use of . With this method, the user is prompted to enter a code when the game starts and is given a new code when he or she wishes to leave. These codes can be used to determine where in the game players left off. For example, let's say that you were playing a scrolling game and you had 2 lives left and 5 cash. When you saved the game, you would get a code of 25. When you resumed the game, it would set your lives to the first letter of the code and set your cash to the second letter.
  
=== Pros ===
+
=== Artıları ===
 
This method of saving your game can be just as effective, if not more effective than [[Eng:Saving Data#Saving Data in Scratch (Lists)|the first method]] listed. Here are some benefits of this method as compared to it:
 
This method of saving your game can be just as effective, if not more effective than [[Eng:Saving Data#Saving Data in Scratch (Lists)|the first method]] listed. Here are some benefits of this method as compared to it:
  
Line 103: Line 102:
 
*The scripts are simpler.
 
*The scripts are simpler.
  
=== Cons ===
+
=== Eksileri ===
 
Although this method is a great way to save games, it does have quite a few cons:
 
Although this method is a great way to save games, it does have quite a few cons:
  
Line 148: Line 147:
 
This is typically accomplished by creating two [[Eng:Cloud_Lists#Cloud List Engines|cloud lists]]. The first is a list of users who have stored data. The second is a list with the saved data, corresponding to the users in list number 1.
 
This is typically accomplished by creating two [[Eng:Cloud_Lists#Cloud List Engines|cloud lists]]. The first is a list of users who have stored data. The second is a list with the saved data, corresponding to the users in list number 1.
  
=== Pros ===
+
=== Artıları ===
 
*No need to remember or write down any codes or encrypted text.
 
*No need to remember or write down any codes or encrypted text.
 
*Data can be loaded back after clicking the [[Eng:Green Flag|green flag]].
 
*Data can be loaded back after clicking the [[Eng:Green Flag|green flag]].
 
*Data can be stored separately for each individual Scratcher
 
*Data can be stored separately for each individual Scratcher
  
=== Cons ===
+
=== Eksileri ===
*If cloud data were to be lost in any way, all saves would be gone.
+
*Eğer bulut veri herhangi bir sebepten dolayı kaybolmuşsa, tüm kayıtlar gidecektir.
*There is a limit of how many people can use it
+
*Kaç tane kişinin kullanabileceğine dair bir limit var.
*Cloud data can be confusing to use
+
*Bulut veri kullanmak kafa karıştırıcı olabilir.
  
=== How to Prevent Problems ===
+
=== Problemler Nasıl Önlenebilir? ===
 
#Test out the cloud data system, before publishing a project with cloud saving in it.
 
#Test out the cloud data system, before publishing a project with cloud saving in it.
 
#Include a back-up variable to store information on.
 
#Include a back-up variable to store information on.
  
  
[[Category:Diğer Öğreticiler]]
+
[[Category:Tur/Diğer Öğreticiler]]
[[Category:Nasıl Sayfaları]]
+
[[Category:Tur/"Nasıl?" Sayfaları]]
[[Category:Betik Oluşturma Öğreticileri]]
+
[[Category:Tur/Betik Oluşturma Öğreticileri]]

Latest revision as of 16:02, 22 May 2020

Translate: - English - Türkçe 

Veriyi kaydetmek, bir değişkeni veya bir listeyi bir Scratch projesinde kaydetmektir, böylece okunabilir, veya daha sonra kullanılabilir.

Veriyi liste halinde kaydetme

Scratch 1.3 sürümünde listelerin eklenmesiyle birlikte, artık bunu yapmak daha kolaylaştı. Bir listeye sağ tıklanınca listeyi içeriye veya dışarıya aktarma seçenekleri veriliyor. Ve bu da istenen yerde listein .txt dosyasını oluşturuyor.

İyi yanları

Bir oyunda kaldığın yeri kaydedebilmek pek çok oyun geliştiricisi için çok kullanışlı bir özelliktir. Bazı faydaları şunlardır:

  • Oyunu bıraktığın yerden daha sonra yeniden başlayabilmek.
  • Kendi oyun dosyalarını oluşturabilmek.
  • Oluşturanlar projelerini daha kolay bir şekilde güncelleyip değiştirebilir.
  • Oyuncular oyunun belli yönlerini değiştirebilirler.

Kötü yanları

Bir oyunda veriyi kaydetmek çok kullanışlı olsa bile, yine de problemler olabilir:

  • Eğer kod iyi yazılmamışsa, proje doğru çalışmaz.
  • Oyuncular oyunda “hile yapmak” için kolayca .txt dosyasını düzenleyebilir.
  • Oyuncular oyunun değişmemesi gereken özelliklerini değiştirebilir.
  • Scratch’i iyi bilmeyen kullanıcıların kafası karışabilir.

Problemler Nasıl Önlenebilir?

There are several ways to try and prevent the above cons from happening:

  1. Test your save scripts multiple times. Ensure they work under all circumstances.
  2. Make sure that users download your project and not play it online. This can be done with the obsolete block.
  3. You can attempt to encrypt or code your list so that only the computer can decipher your saved data. This, however, is extremely time consuming as well as difficult to do.
  4. Try not to label the items in your save list; labeling them makes it easier for hackers to correctly edit their saves.
  5. You can use a mathematical checker to only allow logical data.
  6. Include detailed instructions on how the game works for new players so that they can understand exactly how to play it.

Örnekler

Farmville V1.5 by dazman

Shaper by jerry1000

Öğretici

Bu öğretici bir listede değerleri kaydeden basit bir sistem yapmayı gösterecek.

All the data will be stored in a single string which will be put back into the project at a later date to load the old data the player had.

To start, make a list called "Save Data". Next, make the following custom block which will save data:

tanımla kaydet (değer)
((değer) ve [;] 'i birleştir) i [Veri Kaydet v] ye ekle

You can then make a script to save any variables you want:

kaydet (x pozisyonu) :: custom-arg
kaydet (can) :: custom-arg
kaydet (para) :: custom-arg

The next step is to give the save code to the user so they can enter it in later. First you want to make a variable called code. You can do so like this:

[kod v] i [] yap // İkinci girdinin boş olduğundan emin olun
<([Veri Kaydet v] 'in uzunluğu) = [0]> olana kadar tekrarla 
  [kod v] i ((kod) ve ([Veri Kaydet v] nin (1 v) öğesi) 'i birleştir) yap
  [Veri Kaydet v] nin (1 v) ini sil
end
(kod) i [Veri Kaydet v] ye ekle
[Veri Kaydet v] listesini göster

The user can then export the list or copy and paste the code somewhere.

Finally, the user needs to be able to load data. Make a list called "Loaded Data" and a variable called "i", then make the following custom block:

tanımla veri yükle (veri)
[i v] i [1] yap
[değer v] i [] yap // İkinci girdinin boş olduğundan emin olun
<(i) > ((veri) 'in uzunluğu)> olana kadar tekrarla 
  <((veri) in (i) . harfi) = [;]> olana kadar tekrarla 
    [değer v] i ((değer) ve ((veri) in (i) . harfi) 'i birleştir) yap
    [i v] i (1) kadar değiştir
  end
  (değer) i [Yüklenmiş Veri v] ye ekle
  [i v] i (1) kadar değiştir
  [değer v] i [] yap // İkinci girdinin boş olduğundan emin olun
end

Now you simply need to load the data in the order that you saved it. You first ask the player for their save code, then load the data, and then store the loaded data. So for the above example where "x position" is stored, then "health", then "money". The loading script would look like this:

[Save code?] diye sor ve bekle
veri yükle (cevap) :: custom-arg
x konumunu ([Yüklenmiş Veri v] nin (1 v) öğesi) yap
[can v] i ([Yüklenmiş Veri v] nin (2 v) öğesi) yap
[para v] i ([Yüklenmiş Veri v] nin (3 v) öğesi) yap

If you get lost you can look here for help: https://scratch.mit.edu/projects/56698396/

Şifreleme ile Veri Kaydetme

Another method for saving data in Scratch is through the use of . With this method, the user is prompted to enter a code when the game starts and is given a new code when he or she wishes to leave. These codes can be used to determine where in the game players left off. For example, let's say that you were playing a scrolling game and you had 2 lives left and 5 cash. When you saved the game, you would get a code of 25. When you resumed the game, it would set your lives to the first letter of the code and set your cash to the second letter.

Artıları

This method of saving your game can be just as effective, if not more effective than the first method listed. Here are some benefits of this method as compared to it:

  • It works online and offline.
  • Codes can be used on any computer.
  • The scripts are simpler.

Eksileri

Although this method is a great way to save games, it does have quite a few cons:

  • The player has to remember or write down the code. This can be very annoying for the player as some advanced games could involve codes with as many as 20-30 characters!
  • Unless you have great experience with encrypting and decrypting files, your codes may be very easy to crack. This can allow players to modify their saves with ease.
  • Players may share "cracked" codes with other players, allowing others to cheat on your game.
  • This method is difficult to use in situations involving numbers with a wide range. A player's money could reach heights of millions, so programming a script that would understand how to deal with any value for these numbers could be very tedious and time consuming.

How to Prevent Problems

  1. Try to make codes as short as possible or show the code in a list so users can copy and paste the code.
  2. Leave instructions on how to use the code in the project notes.
  3. Encrypt your codes.
  4. Have all valid codes fall under a single mathematical equation and all codes checked with it - some false codes may go against the equation and will therefore not be accepted.
  5. Make sure that your scripts will work for very long codes with a range of values.

Example

SAvegame test by kwickgamer

Saving Data in Variables

Another method to save data is through variables. When you save your project, all the current variable values are saved. This is one of the most popular methods as it is easy and straight forward. It is easy for the player to save their progress. The project creator although, has to create a way to initiate the saved variables when the game starts.

Pros

This method is most commonly used because:

  • It is quick and easy for the player.
  • It is easy for the Scratcher to do, even with little knowledge.

Cons

Despite how easy it might seem, this method has a con: It cannot be used on online project players.

How to Prevent Problems

  1. Try to "hide" your variables so people will not try and change them
  2. Use a mathematical checker so that people do not change the variables.
  3. Make sure that your project calls on the variables before the game starts, so that the data is properly restored.
  4. Test the project to ensure that this method works with your project and the code works to restore a saved game.

Example

SynOS 7: Purple Crystal by 08jackt

Saving Data in the Cloud

Main article: Cloud Data
See also: Global High Scores

Cloud data is stored in the "cloud", or on the Scratch server, meaning it is stored on the web. Cloud data does not reset when you view a project; it gets globally updated by anyone changing the cloud variable. For example, if User A views a project and changes the variable from "1" to "2", when User B views the project, the variable will stay as "2". The variables globally update, with the speed of typically 2 seconds with a Firewall on to update the value. Storing data on the cloud is difficult, as Scratch 2.0 has disabled strings to be saved on cloud temporarily.

This is typically accomplished by creating two cloud lists. The first is a list of users who have stored data. The second is a list with the saved data, corresponding to the users in list number 1.

Artıları

  • No need to remember or write down any codes or encrypted text.
  • Data can be loaded back after clicking the green flag.
  • Data can be stored separately for each individual Scratcher

Eksileri

  • Eğer bulut veri herhangi bir sebepten dolayı kaybolmuşsa, tüm kayıtlar gidecektir.
  • Kaç tane kişinin kullanabileceğine dair bir limit var.
  • Bulut veri kullanmak kafa karıştırıcı olabilir.

Problemler Nasıl Önlenebilir?

  1. Test out the cloud data system, before publishing a project with cloud saving in it.
  2. Include a back-up variable to store information on.