The Daily Click ::. Forums ::. Klik Coding Help ::. Global events + Sub-apps
 

Post Reply  Post Oekaki 
 

Posted By Message

bigredron



Registered
  07/04/2007
Points
  299
7th April, 2007 at 05:40:59 -

hey guys.

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)

Image Edited by the Author.

 
n/a

~Matt Esch~

Stone Goose

Registered
  30/12/2006
Points
  870

VIP Member
7th April, 2007 at 06:59:41 -

Perhaps you can export the level code to a temporary ini file and get your minimap to refresh at runtime from the ini? Just a thought.

 
http://create-games.com/project.asp?id=1875 Image


bigredron



Registered
  07/04/2007
Points
  299
7th April, 2007 at 07:34:18 -

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

Game of the Week WinnerVIP MemberI'm on a Boat360 OwnerAttention GetterThe Cake is a LieCardboard BoxHero of TimePS3 OwnerIt's-a me, Mario!
I'm a Storm TrooperSonic SpeedStrawberryI like Aliens!Wii OwnerMushroomGhostbuster!
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

~Matt Esch~

Stone Goose

Registered
  30/12/2006
Points
  870

VIP Member
7th April, 2007 at 08:48:36 -

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.

 
http://create-games.com/project.asp?id=1875 Image


~Matt Esch~

Stone Goose

Registered
  30/12/2006
Points
  870

VIP Member
7th April, 2007 at 08:51:03 -

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...

 
http://create-games.com/project.asp?id=1875 Image


bigredron



Registered
  07/04/2007
Points
  299
7th April, 2007 at 09:25:40 -

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

Game of the Week WinnerClickzine StaffHas Donated, Thank You!Cardboard BoxDos Rules!
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.

 
Old member (~2004-2007).
   

Post Reply



 



Advertisement

Worth A Click