Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by TimBur · Jan 18, 2013 at 12:29 AM · javascripttextureskinmoddingmod

Simple modding via importation of text files and jpgs

I'm looking to write a moddable puzzle game. Each piece in the game has a set of simple properties (easily described with numeric codes), plus a jpg texture that gets wrapped around the piece. The game will have 2-5 built-in puzzles, but I'd like to give users the ability to design new puzzle pieces, and new puzzles.

For example, you could describe a new puzzle with a text file of the form:

 PieceName = "NewPiece#1"
 NumPiecesInGame = 4
 Property_1 = 6
 Property_2 = 3
 ... {more piece-wise properties}
 TexFilename = "Texture_NewPiece01.jpg"

 PieceName = "NewPiece#2"
 ... {info for NewPiece#2}
 ... {info for any other pieces in this user-defined puzzle}

So I'd like to be able to have the user select an arbitrary folder, and then a text file within the folder. The compiled game would then read the given text file, import the jpg textures, and setup the puzzle, creating the set of polyhedral-pieces as described within the text file, and skinning them using the specified jpgs.

It seems that one can read text files, and update numeric values (e.g. here). Then this talks about modding via DLL, and this links to a page on Resource Folders and Asset Bundles. But all three of those things (DLL, Resource Folders, Asset Bundles) require some programming expertise. I'd like to have a simpler system, one that requires only text files and paint programs.

Is the sort of modding I've described doable in Unity? Is it doable with javascript? Other options/issues I may be overlooking?

P.S. I'm a pretty good programmer (C++, R), but this will be my first foray into gaming. I've never before worked with either Unity or javascript. Hence, my questions about what is possible in Unity.

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

2 Replies

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by Loius · Jan 18, 2013 at 12:47 AM

Using System.IO (Google for ".Net System IO file", probably no quotes, for good reference material) lets you read and write arbitrary files. I've used text files in the editor with no problems, and as far as I can tell, you can read files on a machine from the standalone player as well.

The Web player is forbidden from accessing any files on the user's machine (outside of PlayerPrefs, I think?). If you're going for web moddability you'd need a server, otherwise .txt files should work just fine.

Reading image files is a little more complex, but there are likely code snippets for any format you might want.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by TimBur · Jan 18, 2013 at 02:20 AM

Thanks Loiuzein.

It's a standalone game. So the Web player issue won't matter for me.

I'm glad to know that the text part will work. I'm still a little concerned about the jpgs. Even if I can load them, is it possible to dynamically change textures? Once I've loaded the jpg, are there methods to specify textures for game objects at runtime?

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Loius · Jan 18, 2013 at 07:39 AM 0
Share

There certainly are - check out Texture2D in the Scripting Reference

Also use the comment button for comments :)

avatar image TimBur · Jan 18, 2013 at 02:12 PM 0
Share

Cool. Thanks. Will do.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

10 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Setting Scroll View Width GUILayout 1 Answer

Strange smearing on texture with unity 4.3.4 1 Answer

Perlin Noise and Terrain Generation 1 Answer

Apply uv coordinates to unity cube by script 1 Answer

GUI Info button not displaying 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges