I’m new to Unity and I wanted to know if it is possible for a web game to reference external text files. Specifically to run scripts.
I want to practice scripting while on computers that don’t have access to the Unity program. I was thinking of setting up a basic game area with a floor and some objects, then you could read a text file and write to a script in game or maybe have a window in the game where you can put the code in and have it run to make the objects do something, or instantiate new objects from prefabs already in the game.
Basically, any way I can set this up to where it runs in browser from and HTML file with some way of updating and creating scripts is what I want.
As long as you set up server, file permissions, crossdomain.xml, etc. correctly, the webplayer will be able to open files at whatever URL they are located, and you can do with that data what you will
That said, I’m not sure not having primary access to a comp with unity is a reason to go this route. You can write unity scripts in a Notepad or whatever else and then import them into your project when you get the chance.
The way to do this is to create a game that accepts and parses code from an outside source, and has that affect the game world.
If you want to do that with C#, UnityScript or Boo, that’s going to be really hard. All of those are compiled languages, so if you want to do this all in the browser, you’ll either have to find an interpreter that reads those languages as scripting languages, or you’re going to have to package a compiler with your game. If you’re doing this for basic scripting practice, those solutions are probably beyond your reach.
If you more want to get your hand on scripting in general, and don’t really care about what language you want to use, check of this page on the forums. The poster has basically done what you’re asking - made a way for Unity programs on the web to interpret scripts. The scripts are written in the popular game scripting language Lua, though, so whatever you learn will only be indirectly transferable to programming for Unity.