Please login or register.

Login with username, password and session length
Advanced search  

News:

Latest WME version: WME 1.9.1 (January 1st, 2010) - download

Author Topic: Making a map functionality to Game  (Read 5695 times)

0 Members and 1 Guest are viewing this topic.

kypho

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 33
    • View Profile
Making a map functionality to Game
« on: December 26, 2008, 12:53:31 AM »

Hey again guys!

I made a cool map to my game (basicly just a scene) where you can go to different game locations. It's available when you find a map and it opens from "m" key...but as you might guess, I have a little problem.

Okay, here it is:

when I press "m" without moving in the same time the map opens and you can go to different locations, BUT if you move in the same time as pressing that "m" key, the map opens but the place "buttons" doesn't work, so practically you get stuck to that map forever :P...I tried to get around this bug my making interactive = false sentences all around my GoToObject functions and that sort of crap, but I feel it's quite clumsy cos even the normal movement now show the "loading" icon :P So I hope you hit your wise head together and help :D

- Kypho the beginner
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Making a map functionality to Game
« Reply #1 on: December 26, 2008, 10:09:05 AM »

Move...like when the actor is walking? I don't see how that should affect anything. You'll need to post more info, such as how is your map done and how do you call it.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

kypho

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 33
    • View Profile
Re: Making a map functionality to Game
« Reply #2 on: December 26, 2008, 07:10:17 PM »

okay, here is some info. The map is just a normal scene without actor moving on it (actor is not presented, such as in startmenu for example).
The map contains places which are also region entities which have code to change to the correct scene. Okay so that is how my map works. The map is called by the game.script by pressing M key and also following must be true (IsItemTaken(map))...so you must have a map item to be available to see the map...So when you press the M key and have the map in your inventory the game.script changes the scene to map.scene. That's basically how this thing works for now. The funny thing was that if you press that M key while moving, the region entities in the map doesn't work at all...so you can't move anywhere with that map :( ...It must be something to do with moving cos when not moving the actor, the map works...Well, I hope this helped little bit to get a clue what my map was doing...

/ Kypho the beginner ::hijack
Logged

Jyujinkai

  • Global Moderator
  • Frequent poster
  • *
  • Karma: 1
  • Offline Offline
  • Posts: 352
    • View Profile
    • Jyujinkai's WME Development Blog
Re: Making a map functionality to Game
« Reply #3 on: December 26, 2008, 07:28:42 PM »

The map is just a normal scene without actor moving on it (actor is not presented, such as in startmenu for example).

I am  using a map function for telporting around the game world in my game as well and I am doing this though a window system, rather than a "scene". You can use the ESC menu that comes in the demos as a base to build this, but binding it to a new button. This way when the window is open, just like the esc window, all actor and point click function of the game scene is suspended. As it is only a window the map itself can load ontop of your existing scene and float ontop of any scene you are currently using.

You can use simple global variables to display or hide buttons inside the window. Allowing you to have part of the map reveal as you play, or locations of interest to appear or hide or whatever. These buttons can then do all your teleport function by loading scenes at will. Also the variable cou;d be set to enable or disable the map itself (as in you do not have it in your inventory)

Anyway, that is how i am doing my map system.
Logged
<Antoine de Saint-Exupéry> In any thing at all, perfection is finally attained not when there is no longer anything to add, but when there is no longer anything to take away...
<Carl Sagan> If you want to make a apple pie from scratch. You must first... invent the universe

kypho

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 33
    • View Profile
Re: Making a map functionality to Game
« Reply #4 on: December 26, 2008, 09:03:16 PM »

Okay, thanks :) I keep that in mind.

/Kypho
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Making a map functionality to Game
« Reply #5 on: December 27, 2008, 10:07:35 AM »

kypho, I really don't see why entities in a new scene shouldn't work when the actor was moving in the old scene. You must be doing something... different :)
However, you can try stopping the actor before loading the scene using actor.Reset(). See if it makes any difference.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

kypho

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 33
    • View Profile
Re: Making a map functionality to Game
« Reply #6 on: December 28, 2008, 04:21:24 PM »

Yeah, that's what I am wondering too, cos can't understand why it doesn't work. But I will try to use that reset thing then...the problem might be something related to the fact that my map doesn't have actor at all, cos I put it non active...but naah, I don't know  0:) 

Thanks

/Kypho the beginner
Logged

kypho

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 33
    • View Profile
Re: Making a map functionality to Game
« Reply #7 on: December 28, 2008, 06:00:36 PM »

Thanks Mnemonic, it works perfectly now :)
Logged
 

Page created in 0.037 seconds with 19 queries.