Please login or register.

Login with username, password and session length
Advanced search  

News:

Forum rules - please read before posting, it can save you a lot of time.

Author Topic: map function  (Read 7061 times)

0 Members and 1 Guest are viewing this topic.

SBOVIS

  • Frequent poster
  • ****
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 404
  • FORGET REALITY SURRENDER TO YOUR DARKEST DREAMS
    • View Profile
    • LIMBO of the LOST
map function
« on: August 23, 2004, 10:18:23 AM »

Hi all,
       On my player menu i have a button that I want to show a map.
This map screen will be 800 x 600 and show where the player has explored (basically lots of map.BMP`s all showing differnt versions of the full map for the level)

I need a way for the game to know if the player has visited a room and if so display the corresponding map graphic.

Eg. Player walks from room1 to room 3 but not in room 2, selects map option  - map should show only 2 rooms,  1and2.bmp (2 rooms)
 
player then moves into room 1 and then into room 3, selects map function - map should show 1and2and3.bmp (3 rooms)

I also want a button assigned to the map screen to allow the player to click back to the game.


Also is it possible for the graphic to be set at 1024 x 768 and screen set at 800 x 600 and the player can then move the mouse to the sides of the screen and it will auto scroll.



Any help with this option would be gratefully appreciated.

I think this would be a good option for other adventure creators too.



Best regards



Steve
Logged
kind Regards
Steve Bovis
MAJESTIC STUDIOS

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5679
    • View Profile
    • Dead:Code Site
Re: map function
« Reply #1 on: August 23, 2004, 10:36:10 AM »

Quote
I need a way for the game to know if the player has visited a room and if so display the corresponding map graphic.
By default if you create a new scene in ProjectMan, it adds a piece of code to the scene initialization script, which keeps track of which scene has been visited and which has not.

Every scene owns a corresponding global variable named State<scene name>, for example for a scene called "Room" there is a global variable called StateRoom. Those state variables have a .Visited attribute.

I would suggest having the map screen as a separate scene. This scene will contain lots of entities (i.e. the map pieces). Give those entites the same names as your scenes. Then create a new script and attach it to all of those entities. The script would look like (again, untested, sorry):

Code: [Select]
on "LeftClick"
{
  // since the name of the entity corresponds to the name of the scene,
  // this line will change to the right scene
  Game.ChangeScene("scenes\" + this.Name + "\" + this.Name + ".scene");
}

Then you need to modify the scene_init.script of your map scene to contain something like this:

Code: [Select]
...

// add this code block for each scene
global StateRoom;
if(StateRoom.Visited==true)
{
  // what to do if player visited the "Room" scene
  // like showing / hiding the corresponding map piece etc.
}
else
{
  // what if they didn't visit the scene
}


...


Quote
Also is it possible for the graphic to be set at 1024 x 768 and screen set at 800 x 600 and the player can then move the mouse to the sides of the screen and it will auto scroll.
Yes, it should be possible. I'll try to script it when I get home.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

SBOVIS

  • Frequent poster
  • ****
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 404
  • FORGET REALITY SURRENDER TO YOUR DARKEST DREAMS
    • View Profile
    • LIMBO of the LOST
Re: map function
« Reply #2 on: August 23, 2004, 12:02:24 PM »

ok Mnemonic, I get the idea, will wait for your script.


many thanks.



Steve
Logged
kind Regards
Steve Bovis
MAJESTIC STUDIOS

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5679
    • View Profile
    • Dead:Code Site
Re: map function
« Reply #3 on: August 23, 2004, 05:39:55 PM »

Ok, here's the project that demonstrates scrolling the scene by moving the mouse pointer to the edge of the screen:

http://dead-code.org/download/demos/wme_mousescroll_demo.rar

All the work is done by the "scenes\Room\scr\mouse_scroll.script" file. If you copy the script to your project and attach it to the map scene, the mouse scrolling should work.
You can modify the scrolling speed by setting the variables at the beginning of the script.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

SBOVIS

  • Frequent poster
  • ****
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 404
  • FORGET REALITY SURRENDER TO YOUR DARKEST DREAMS
    • View Profile
    • LIMBO of the LOST
Re: map function
« Reply #4 on: August 24, 2004, 10:06:00 AM »

Thanks Mnemonic,
                          Will try out the mouse scroll code, could you be more specific about the code for the map scene?

You see I am a game designer, modeller, artist, sound technician, level designer, character designer, writer but not very good at the coding thang.


Just an example of say 5 rooms will be fine using bogus Bmps etc.


Just to get me going, as I have levels of 60 rooms + to sort out.



Many thanks.



Steve


Logged
kind Regards
Steve Bovis
MAJESTIC STUDIOS

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5679
    • View Profile
    • Dead:Code Site
Re: map function
« Reply #5 on: August 24, 2004, 07:17:35 PM »

Ok, I tried something, but the temporary graphics makes it kind of...non-transparent. Well, take a look.

http://dead-code.org/misc/map.rar
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

SBOVIS

  • Frequent poster
  • ****
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 404
  • FORGET REALITY SURRENDER TO YOUR DARKEST DREAMS
    • View Profile
    • LIMBO of the LOST
Re: map function
« Reply #6 on: August 25, 2004, 01:35:40 PM »

Thanks Mnemonic,
                          Have checked out the demo you created, in the map room the scene does not scroll when the mouse moves to the edge of the screen, i have changed the size of the test bg graphic to 1074 x 768 and in project manager the resolution is set to 800 x 600.

Also can the Inventory and player menu be deactivated in the map scene.

And a button to click on to go back to the scene they invoked the map from not click on map graphics and transport there.


Is this possible??


I await your next code and test with baited breath.



Many thanks.



Steve
Logged
kind Regards
Steve Bovis
MAJESTIC STUDIOS

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5679
    • View Profile
    • Dead:Code Site
Re: map function
« Reply #7 on: August 25, 2004, 02:33:22 PM »

Quote
Have checked out the demo you created, in the map room the scene does not scroll when the mouse moves to the edge of the screen, i have changed the size of the test bg graphic to 1074 x 768 and in project manager the resolution is set to 800 x 600.
Yes, I didn't include the mouse scrolling, but all you need to do is to attach the mouse_scroll.script to the map scene in SceneEdit.
       
Quote
Also can the Inventory and player menu be deactivated in the map scene.
It can be done by a slight modification to the game_daemon.script as described in this thread: http://forum.dead-code.org/index.php?topic=595.0

Quote
And a button to click on to go back to the scene they invoked the map from not click on map graphics and transport there.
You can either create an entity which will represent the "go back" button (which is the easier way), or you can create a .window file overlay.


In any case, the entity or button will eventually call this to go to the previous scene:

Code: [Select]
Game.ChangeScene(Game.PrevSceneFilename);
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

SBOVIS

  • Frequent poster
  • ****
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 404
  • FORGET REALITY SURRENDER TO YOUR DARKEST DREAMS
    • View Profile
    • LIMBO of the LOST
Re: map function
« Reply #8 on: August 25, 2004, 04:13:28 PM »

"Yes, I didn't include the mouse scrolling, but all you need to do is to attach the mouse_scroll.script to the map scene in SceneEdit"

I take it you mean attach it to the scripts in properties in scene edit for MAP object. If so have sone this and it still does not scroll.
It is after scene_init.script and scene.script.


is this correct??

Logged
kind Regards
Steve Bovis
MAJESTIC STUDIOS

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5679
    • View Profile
    • Dead:Code Site
Re: map function
« Reply #9 on: August 25, 2004, 04:50:23 PM »

Please make sure the dimensions of the main layer of the map scene are set to 1074 x 768.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

SBOVIS

  • Frequent poster
  • ****
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 404
  • FORGET REALITY SURRENDER TO YOUR DARKEST DREAMS
    • View Profile
    • LIMBO of the LOST
Re: map function
« Reply #10 on: August 25, 2004, 04:57:11 PM »

got ya!!! ok now thanks mnemonic


Steve. 
Logged
kind Regards
Steve Bovis
MAJESTIC STUDIOS

Chris

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 31
    • View Profile
Re: map function
« Reply #11 on: March 22, 2010, 01:01:13 PM »

Ok, I tried something, but the temporary graphics makes it kind of...non-transparent. Well, take a look.

http://dead-code.org/misc/map.rar

file is not download . please reupload .
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5679
    • View Profile
    • Dead:Code Site
Re: map function
« Reply #12 on: March 22, 2010, 01:09:31 PM »

This thread is nearly 6 YEARS OLD. I really don't have the file.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave
 

Page created in 0.152 seconds with 24 queries.