I have a problem. Im working on a map editor for a game I am creating which is coming along nicely.
I have a frame which i am using for my editor which calls two sub-apps from another frame in the application. one is a 200 x 600 tool box including a minimap, and the other is a 600 x 600 frame which is the level being created. Now when i place a peice of terrain on the map editor, i want a 'dot' to appear on the minimap relevant to where i placed the terrain peice.
I have coded the minimap fine as I know how this works and it works great when in the same frame, but because the minimap is in another frame to the main map editor, it doesnt detect when a terrain peice has been created and won't create a 'dot' for that peice.
any one have any ideas how I can make it work? (I can't combine them into the one frame because of the way this editor works)
i thought of that, but this is an RTS game and there could be 100's or even 1000's of objects on a map at any one time, and to update that multiple times a second in real-time just doesnt seem very feasable.
I was hoping there was a way to tweak the global events to it would work properly...
n/a
Peblo Custom ratings must be 50 characters or less
Registered 05/07/2002
Points 185
7th April, 2007 at 08:10:33 -
Well if it works fine for all things besides terrain then have an array with the positions of the terrain when you create the terrain. So the only saving of data happens when you build the terrain piece.
"Isn't it always amazing how we characterize a person's intelligence by how closely their thinking matches ours?"
~Belgarath
Well you don't need to refresh everything, you could just save your actions to an ini file, get your subapp to produce a new preview based on it, and then delete that event from the temporary ini. For example, if I inserted a ground tile object, I would save the tile type, x position y position and some pointer to show I created it to an ini file. My map would then load the ini file, and then produce the preview from the new command. Better than reloading all level tiles, but I don't even see why you would need to save it to an ini actually. If your subapp can get at a global string, just put the new command in there, and get it to reproduce it from that.
Excuse me for double posting, but there is something in the back of my mind that says there is an option somewhere that lets you choose if global values are shared between subapps or not...
yes you can share global values/strings between the frames but I'm not using them for this method.
But i suppose a temporary file would be suitable, ill have a play around and see if I can get it working using that method. thanks
n/a
DaVince This fool just HAD to have a custom rating
Registered 04/09/2004
Points 7998
7th April, 2007 at 16:27:09 -
I'm not sure if it's possible, but maybe you could make an array object and make it global. If it's not possible, you could maybe save the array file every once in a while and load it up in the minimap every other once in a while.