- Joined
- Feb 12, 2010
- Messages
- 7
Well, as the title suggests, i have a very complex script, for a very simple idea. Ill post parts of it in pics with this message:
Picture 1:
These are my 6 regions, each of which represent a room of a certain player, 1-6. The concept behind this is when a character from one room enters someone elses room he is able to build towers that are combination of the two. Like, player ones character enters player 2s room. Now player one and two can build towers of both elements. This is simular to element TD where if you have water and fire, you can build water/fire towers.
Picture 2:
This is what i want to happen when the rooms are entered. in this case the bird has entered the red colourd room. Since the player is the bird, the bird is displayed in the box beside the room marker, then the room marker of that colour is displayed, and then if other characters are in that room/enter the room they are spawned in their spots as well. And when they leave for them to be removed also.
So my solution was to assign a multiple of 10 to each character, 1, 10, 100, 1000 etc. So that when i add them together i get a unique number for each combination of characters possible in a room at one time. When the bird is in the room its value is 1, when the bird and the vengence guy are in it its 101, when the bird dragon and vengence guy are in a room its 10101... etc.
Well, with 6 characters each character has 32 possible combinations that it can be involved in. So thats 32 combinations per room, per character. But i continued, and i set up a trigger so that when a certain guy enters a room, it increases or decreases the rooms value based on his number. And then based on the value of the room it spawns the only possible combination of characters that can be in that room for the players.
Then of course, depending on what characters you have control of it gives you the ability to build certain towers. And when they leave the room, or you leave the room, you lose that ability
Picture 3:
But it is a VERY long script... (notice the multiple scripts on the side, and how long this particular script is)
This script DOES work the way i want it, but im sure 1000+ lines of code for a simple action can be simplified?
any ideas?
Picture 1:
These are my 6 regions, each of which represent a room of a certain player, 1-6. The concept behind this is when a character from one room enters someone elses room he is able to build towers that are combination of the two. Like, player ones character enters player 2s room. Now player one and two can build towers of both elements. This is simular to element TD where if you have water and fire, you can build water/fire towers.
Picture 2:
This is what i want to happen when the rooms are entered. in this case the bird has entered the red colourd room. Since the player is the bird, the bird is displayed in the box beside the room marker, then the room marker of that colour is displayed, and then if other characters are in that room/enter the room they are spawned in their spots as well. And when they leave for them to be removed also.
So my solution was to assign a multiple of 10 to each character, 1, 10, 100, 1000 etc. So that when i add them together i get a unique number for each combination of characters possible in a room at one time. When the bird is in the room its value is 1, when the bird and the vengence guy are in it its 101, when the bird dragon and vengence guy are in a room its 10101... etc.
Well, with 6 characters each character has 32 possible combinations that it can be involved in. So thats 32 combinations per room, per character. But i continued, and i set up a trigger so that when a certain guy enters a room, it increases or decreases the rooms value based on his number. And then based on the value of the room it spawns the only possible combination of characters that can be in that room for the players.
Then of course, depending on what characters you have control of it gives you the ability to build certain towers. And when they leave the room, or you leave the room, you lose that ability
Picture 3:
But it is a VERY long script... (notice the multiple scripts on the side, and how long this particular script is)
This script DOES work the way i want it, but im sure 1000+ lines of code for a simple action can be simplified?
any ideas?