World map on input trigger?

Dark_Metamorphosis

What a horrible night to have a curse.
Veteran
Joined
Nov 23, 2012
Messages
2,192
Reaction score
382
First Language
Swedish
Primarily Uses
So I have tried and make this work for a while now, and I'm not really sure why I can't get it to run.

So I have made a world map a long with a world map cursor that the player is supposed to be able to open and close by a key input when they are on the world map.

The image displayed will show them the world map in transperency and the location on the map. Everything works well here, but the problem is when I'm trying to event the key input to open and close the world map. 

The problem is that I can't get the key input to be consistant, if I press the key the map will show, if I press it again the map will be removed. However sometimes the map won't open/close when I press the key and I'm not sure how I could event this to always work when I press the hotkey in question. I need this for other occasions in my game so if I could work this out another stone would be lifted from my shoulders.

I'll share some screenshots of what I have in mind:

The Common event for the map cursor:

Skärmklipp 2015-01-31 02.42.46.png

Parallel process to turn ON and OFF the map:

Skärmklipp 2015-01-31 02.42.59.png

Skärmklipp 2015-01-31 02.43.54.png

Map in-game:

Skärmklipp 2015-01-31 02.44.18.png

Anyone that might have a soloution for this?

Thanks!
 
Last edited by a moderator:

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,846
First Language
English
I tried creating a world map. I used a single common event. You can see the event here: https://twitter.com/HimeWorks/status/561373899674234880



The trick is to put your logic inside a loop. Try changing your parallel process events by adding a loop and a wait.

Code:
loop  if Input.trigger?(:Y)     # do stuff  end  wait 1 frameend
I suspect this is related to the way events are processed, but I don't know why using the loop trick works.
 
Last edited by a moderator:

Dark_Metamorphosis

What a horrible night to have a curse.
Veteran
Joined
Nov 23, 2012
Messages
2,192
Reaction score
382
First Language
Swedish
Primarily Uses
Thanks Tsuki~ I will see if I can work that out. As for your world map common event, are there any specific sizes needed for the maps/cursor image? I actually thought about using your common event instead, if that's ok with you of course.

Edit: If I put the loop the game will instantly freeze, is it because I put it into a conditional branch?
 
Last edited by a moderator:

Ralpf

Veteran
Veteran
Joined
Jun 5, 2014
Messages
590
Reaction score
152
First Language
English
I can't find any reason that doesn't work. That being said you don't need multiple pages, so maybe just to change it up so everything is on the same page. It would go:

Conditional - Y pressed

     Conditional - Switch off

          show picture

          turn switch on

          else

                erase picture

                turn switch off

Also just wanted to say I like the way you approached that, hopefully you can get it to work. I've ran into issue where you do something in a way that should work and it doesn't, so I try something similar but slightly different and it's cool.
 
Last edited by a moderator:

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,846
First Language
English
Thanks Tsuki~ I will see if I can work that out. As for your world map common event, are there any specific sizes needed for the maps/cursor image? I actually thought about using your common event instead, if that's ok with you of course.
It's just a demonstration of the logic so there is no issue with copying it. You will likely find that it may be unsuitable (since it assumes the map ID and other things).

The maps I used are 416/416 since that map just happen to be a square and my window height is 416. The cursor calculations performed are all based on these dimensions. You can choose whatever size you want but you need to update the math to use your dimensions.

Edit: If I put the loop the game will instantly freeze, is it because I put it into a conditional branch?
The trick is the wait command inside the loop.

The conditional branch is not part of the pattern.

Code:
Loop  # Other stuff    Wait 1 FrameEnd
 
Last edited by a moderator:

Dark_Metamorphosis

What a horrible night to have a curse.
Veteran
Joined
Nov 23, 2012
Messages
2,192
Reaction score
382
First Language
Swedish
Primarily Uses
Tried to rework the event again, and It's not freezing now but I still can't get it to work.

Will share some screens again:

Common event:

Skärmklipp 2015-02-01 14.03.54.png

Event:

Skärmklipp 2015-02-01 14.04.09.png

The switch: map trigger is set to be on as soon as you enter the map.

Anything that I have done wrong?

Edit: Nevermind I'm an idiot. I just realized that I used the same number for both pictures xD Everything works great now, thank you both so much :)

Nice to know about the loop trick, now I can finally implement this on my other stuff :)
 
Last edited by a moderator:

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,862
Messages
1,017,049
Members
137,569
Latest member
Shtelsky
Top