Jump to content

game specific files


Recommended Posts

This question might sound a bit naive (i am new to web programming), but how do you guys load game specific files using typescript?

E.g. i would like to load a textfile line by line and process it. Where does my file need to be located?

In a game, there might be many many custom files which need to be loaded.

Any examples are welcome :)

Link to comment
Share on other sites


Just for clarification, are the game files (text files, data, etc.) treated to be local or serverside?

Let's say i got some AI-data in a text file and want to read and process it in my game using babylon.js,

How would i do this in my game code (especially in typescript)? Most tutorials i found on web (google "parse with typescript ...") seems to require to pick the file with a selector.

The other ones deal with javascript and loading files with ajax.

Link to comment
Share on other sites

You could just use the framework.  BABYLON.Tools.LoadFile  could be used when all you have is a Url  (file:// for explicit local files, or just relative path for local or web).  I use it in the utility page to build a custom framework.  I am actually using a select in lines 34-36 to pick the url.  I am reading a javascript file, but hey thats a text file.  Use string split() to process it line in line chunks once it in memory.


Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...