- Home /
How do I switch variables without touching the codes
Our professor wants us to learn how to create an app for small business, companies or anyone so they require us to create a program and treat the admins of that business as computer illiterates and it's up to us to find out a way so the admins can still update our software after we give them the product
I'm sorry if my question confuses you guys, I don't know how to rephrase my question correctly but here's what I plan to achieve:
I'm creating a simple house with 5 rooms, let's call them 1,2,3,4,5. Now sometimes this room switches from:
to
What my plan is: Create a script generator, i'll create the diagram above and let the admin access it and place where he wants the rooms and press the generate button, a script is then printed that changes the variables from the previous one to the new one, here's the process:
Admin uses script generator
Places rooms where he seems fit
Press generate
Copies generated code to the blank script named "update" located in the project
Build and Runs the Program
Pros: Lets them edit the rooms
Cons: If they want to edit the places again, the script generator they will use will still show them the default places (and this can be tiresome if ever there are 50 rooms and at the first change they changed 30 rooms and the next change they need to edit only 2 rooms but they will also need to edit back those 30 rooms again)
Another possibility is the utilization of databases (or so I think), however I have no experience in this and I would like to know if this is even possible.
(Important)
What I posted above is just the concept of the problem, but if you wanna know what program I will be doing, here it is:
I'll be creating a building with 10 rooms, while in-game you can access the map and mini map (small map in the upper right kinda like the ones in flyff). You can see the room's names there and by clicking the doors of the rooms, a popup box appears with the information of the room, now what I plan to achieve is to change the names of the rooms in the map and the popup box information with what the admin generates within the script generator.
I'm really sorry if my choice of words are confusing you guys I don't know how to explain them properly
Do you want to save the variable data into another variable?
Do you need to generate the code just for that? You can just make that feature as an in game options, with some enums in GUI, or generate array of rooms on the fly.
@SnotE101 For example the room 1 has a door, and let's say there is a variable named "room1", room1 will contain the info that will popout when you choose to click room 1's door while you're in the game. To make shifting rooms easier, I'll also let room1 handle the map's visual display, I'm really sorry but i'll create a diagram to explain it further but i'm at school at the moment.
@Sedesikus Yeah I need to exchange variables without touching the codes since the ad$$anonymous$$s who'll use it will be treated as computer illiterates, so the solution I thought of was to create a code generator, and the generated codes will switch the variables and the ad$$anonymous$$'s job then is only to copy that code and paste it in the project's blank script named "updates" and build/run the project.
In your case, you seem to need an entire parser for your program, since Unity doesn't support scripting (that's your code) on top of scripting (generated code) by it self.
Your answer

Follow this Question
Related Questions
Updating variables from dictionary database in edit mode C# 0 Answers
How to pass SQL vars? 1 Answer
Database and transferring variables 1 Answer
Update mySQL at game runtime ??? 2 Answers