Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Read Data from txt file

Requesting a Script


Script Title:
Read Data from txt file

RMXP or RMVX:
RMXP

Detailed Description:
What I'd like the script to do is read data from a text file. The text file would look something like;
Data1 = 100
Data2 = "hello"
Data3 = "something"
Data4 = 5000
etc..
I would also like the file to be an unencrypted file, this way users can open the file and make minor changes. An example of this Black and white 2, users could edit a ini file(I think that's what the file was) and change prices of items.

The data that's called from the text file I'd like to be able to set that to an in game variable, global variable, and others ie.

$fake_global_var = Data4
$game_variables[1] = Data2
$data_weapons[2].price = Data1

I hope I explained this with enough details...

Screen shots:
I don't know how to show a screen shot of this Idea.

Thanks in advance.

Edit:
I found this: viewtopic.php?f=155&t=19653&hilit=Loading+Data+From+Text+Files

It seems to do what I want, but I'm not sure of how to exactly use it, i got this far;
test_data = Trickster.load_data_from_txt("Config/config.txt", ['id','name','variable'], [0], [2], 0)

So I tried to just display the properties of id, so I tried this;
p ''+test_data[1].to_s
p ''+test_data.id.to_s

but;
p ''+test_data.to_s
will print all the info in the text file.
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top