Showing Book and flipping pages

Status
Not open for further replies.

Korten12

Working on, The Border. :)
Veteran
Joined
Apr 25, 2012
Messages
175
Reaction score
22
First Language
English
Primarily Uses
So I've been trying to get it so in my game, you can open up a book in the menu and it shows a picture of a book. Then you can switch between the pages by pressing left and right on the 

arrow key pad. However while I noticed this was possible in a regular event (even though pressing left and right on the arrow pad moved the character in the background.) I have found

this impossible to obtain using a common event. Which is required because the common event is run when the book is used in the menu.

This is what I have thus far:



I tried to do a loop, however that causes the game to freeze and crash. 

Anyone got a solution for my problem?
 
Last edited by a moderator:

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,365
Reaction score
7,674
First Language
German
Primarily Uses
RMMV
There are several issues with the way you made that event.


First, the conditional branch "button pressed" checks only if the button is pressed in the millisecond when that command is executed - to wait for a button press, you need to put it in a loop.


Second, you have conditionals that are simply not able to work in your way, beginning with the third and fourth line. Because the third line turns on the switch #24, the next conditional branch checking on switch #24 becomes obsolete - it will always be true.


Third, to help you we will have to see the complete event - not only the missing bottom part but also the cut away setting that are outside the content window.
 

Korten12

Working on, The Border. :)
Veteran
Joined
Apr 25, 2012
Messages
175
Reaction score
22
First Language
English
Primarily Uses
There are several issues with the way you made that event.

First, the conditional branch "button pressed" checks only if the button is pressed in the millisecond when that command is executed - to wait for a button press, you need to put it in a loop.

Second, you have conditionals that are simply not able to work in your way, beginning with the third and fourth line. Because the third line turns on the switch #24, the next conditional branch checking on switch #24 becomes obsolete - it will always be true.

Third, to help you we will have to see the complete event - not only the missing bottom part but also the cut away setting that are outside the content window.
1. Here's the full event, I removed switch #24. Also I have tried to put this event in a loop, however as stated in my post, that causes it to freeze. 



3. Also I am confused, what cut away settings outside the content window?
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,365
Reaction score
7,674
First Language
German
Primarily Uses
RMMV
3. Also I am confused, what cut away settings outside the content window?
I mean everything that is on the event window, but outside the content area - for example what is the trigger setting of the event?
How it is called? is that a map event or a common event?


An Event is much more than just the content area - if it were only consisting of the content area, there would not be as much other settings above and/or to the left of the content area.


Please give us a screenshot of the entire event and do NOT cut it down to content area only.


For example, some triggers are autolooping - adding another loop inside that autoloop will only cause problems - but the trigger setting is one of those things you cut away from the event window.
 

Korten12

Working on, The Border. :)
Veteran
Joined
Apr 25, 2012
Messages
175
Reaction score
22
First Language
English
Primarily Uses
I mean everything that is on the event window, but outside the content area - for example what is the trigger setting of the event?

How it is called? is that a map event or a common event?

An Event is much more than just the content area - if it were only consisting of the content area, there would not be as much other settings above and/or to the left of the content area.

Please give us a screenshot of the entire event and do NOT cut it down to content area only.

For example, some triggers are autolooping - adding another loop inside that autoloop will only cause problems - but the trigger setting is one of those things you cut away from the event window.
Oh, I see the problem. My apologizes. See, this event I'm showing is everything, it's the common event that is sprung when the book is used in the inventory menu. There is no more to the event then what I have shown you. I'm trying to get it so when you open the book from the inventory, your character get's locked in place and you can read the book.
 
Last edited by a moderator:

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,365
Reaction score
7,674
First Language
German
Primarily Uses
RMMV
See, this event I'm showing is everything,
That is simply wrong and a lie.
I've attached an example for the full event window that we need to see in order to help you solve your problem:


commonevent.png


Please provide a screenshot that includes all these parts, include the very important "General settings" that you've always cut away from your screenshots.


Also, please tell us where you put the loop, because the button presses require a loop - just not a loop of the entire event.
 
Last edited by a moderator:

Korten12

Working on, The Border. :)
Veteran
Joined
Apr 25, 2012
Messages
175
Reaction score
22
First Language
English
Primarily Uses
That is simply wrong and a lie.

I've attached an example for the full event window that we need to see in order to help you solve your problem:

commonevent.png

Please provide a screenshot that includes all these parts, include the very important "General settings" that you've always cut away from your screenshots.

Also, please tell us where you put the loop, because the button presses require a loop - just not a loop of the entire event.
I'm sorry if I offended you? I wasn't trying to lie, I didn't think the General Settings were important because the trigger was empty as shown below:



Also when I put the event in a loop, I only looped the conditional statement portion.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,365
Reaction score
7,674
First Language
German
Primarily Uses
RMMV
You haven't offended me - but neither have you an empty trigger. It is impossible to have an "empty" trigger - you have the trigger set to "None", but that is NOT the same as being empty, and that is the info we needed.


Your event doesn't work because it only checks for the buttons in the first frame it's called by using the item. And no one can react in that 1/60 of a second.


The most likely problem with your loop was that you got the different parts of the command in the wrong conditional levels - it's a bad choice to have else-branches with button conditions, because that will restrict your logic.


I suggest moving all conditions with button pressed to the main area, removing the "set handling when condition is false"-checkbox in those branches (only keep it where you're checking for the page)


Then make a loop that starts before the first conditional branch and ends after the last "branch end". That should allow you to exit by pressing B without being trapped in a lower conditional branch.
 

Korten12

Working on, The Border. :)
Veteran
Joined
Apr 25, 2012
Messages
175
Reaction score
22
First Language
English
Primarily Uses
Alright, I tried this, hopefully it's what you meant:



This however, still causes the freeze.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,365
Reaction score
7,674
First Language
German
Primarily Uses
RMMV
What exactly do you define as "freeze"?


If you don't have any scripts altering the event commands (and don't have scripts that are triggered by the same switches and variables), that event should change the displayed picture from IEC1 to IEC1-2 when you press either the left or right button the first time, then change it to IEC1-2 again any time you further press right or left (you might want to change the new picture in one of the commands to see that it's working as there won't be any change back to IEC1 as long as both branches change to IEC1-2).


And then it waits for the :B button (which is NOT the key B, check in your game configuration which key is mapped to the button :B ) and disables the event when you press that button.


(By default, ESC, Num-0 and X are mapped to the button :B, the B-Key has no function mapped to it)
 
Last edited by a moderator:

Korten12

Working on, The Border. :)
Veteran
Joined
Apr 25, 2012
Messages
175
Reaction score
22
First Language
English
Primarily Uses
What exactly do you define as "freeze"?

If you don't have any scripts altering the event commands (and don't have scripts that are triggered by the same switches and variables), that event should change the displayed picture from IEC1 to IEC1-2 when you press either the left or right button the first time, then change it to IEC1-2 again any time you further press right or left (you might want to change the new picture in one of the commands to see that it's working as there won't be any change back to IEC1 as long as both branches change to IEC1-2).

And then it waits for the :B button (which is NOT the key B, check in your game configuration which key is mapped to the button :B ) and disables the event when you press that button.

(By default, ESC, Num-0 and X are mapped to the button :B, the B-Key has no function mapped to it)
By freeze I mean the game locks up. You can no longer move the character, open the menu, or do anything. It just sits there. No picture ever displays.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,365
Reaction score
7,674
First Language
German
Primarily Uses
RMMV
Then there is something wrong with your show picture data. What is the exact name of the picture, where and how did you import it and so on?
 

Korten12

Working on, The Border. :)
Veteran
Joined
Apr 25, 2012
Messages
175
Reaction score
22
First Language
English
Primarily Uses
Then there is something wrong with your show picture data. What is the exact name of the picture, where and how did you import it and so on?
The pictures as seen in the image, are called: IEC1 and ICE1-2, with IEC1 being shown first. They're both png, and placed within the pictures folder. I did not import them, I created 

them in Paint.net and simply put them in the Pictures folder. 
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,365
Reaction score
7,674
First Language
German
Primarily Uses
RMMV
Which format do they have? Best option would be PNG.


Can they be displayed in a simple event that only shows one picture without any complex functionality?


Which scripts do you have added to the game?
 

Korten12

Working on, The Border. :)
Veteran
Joined
Apr 25, 2012
Messages
175
Reaction score
22
First Language
English
Primarily Uses
Which format do they have? Best option would be PNG.

Can they be displayed in a simple event that only shows one picture without any complex functionality?

Which scripts do you have added to the game?
As I said, both are PNG.

In a regular event, the pictures can be displayed just fine. In fact before i tried to do this, I actually had an event where the player goes up to a bookshelf and selected the book.

In this case, it actually sort of worked. I got it to be able to use left and right arrow keys to switch pages and down to escape (changed it to B in the common event version) 

however in this case, the player still actually moved left and right during the event. (Though this could be elevated by just changing what keys need to be pressed.) Now in that case,

the event was auto run once it switched pages. 

 


This does in fact work as I said above. However I'm trying to get what works here, to instead of working through a map event but to simply happen when the player

uses the book item in their inventory. The only picture related scripts I have are:

- Fixed Pictures by Seer UK

- Picture Z-axis.
 
Last edited by a moderator:

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,365
Reaction score
7,674
First Language
German
Primarily Uses
RMMV
I wished you had shown that event and told us about it before....


First, that event worked because autoruns automatically loop


Second, autoruns are supposed to stop all player movement when active - that is the very base of the autorun definition.


If your player could move during that event, then that is proof that your game's event engine has been changed and broken in your project - no wonder that the common event no longer works correctly.


Now you have to find out which script has created those problems, and no that is most probably NOT a picture related script, it has to be an event related script.


My first guess would be to check the mouse script that you're using according to the comment...
 

Korten12

Working on, The Border. :)
Veteran
Joined
Apr 25, 2012
Messages
175
Reaction score
22
First Language
English
Primarily Uses
I wished you had shown that event and told us about it before....

First, that event worked because autoruns automatically loop

Second, autoruns are supposed to stop all player movement when active - that is the very base of the autorun definition.

If your player could move during that event, then that is proof that your game's event engine has been changed and broken in your project - no wonder that the common event no longer works correctly.

Now you have to find out which script has created those problems, and no that is most probably NOT a picture related script, it has to be an event related script.

My first guess would be to check the mouse script that you're using according to the comment...
I actually had told you about it before in the 2nd sentence of my opening post. 

Also I attempted the common event in another project, and the loop still caused that project to freeze without any scripts.

Also I need to apologize again. See, I said you moved when moving through the pictures. That was my mistake, see, since I had an event (parallel process) that when an arrow key is moved, it will make a sound based on

what ground you're stepping on. It made it sound like the character was moving when in reality they were not because the button was being pressed. 
 
Last edited by a moderator:

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,365
Reaction score
7,674
First Language
German
Primarily Uses
RMMV
OK, but it still looks like something broke your engine, and we need to go back to the basics to find out where the problem comes from.


Please make a new project without any additional script and use that project to check your book display event.


Does it work there or not?


If it doesn't work, we'll need to make it working in that new project.


If it works there but not in your game project, you need to disable your added scripts one after another until it works, and then check why the last disabled script causes the problems.
 

Korten12

Working on, The Border. :)
Veteran
Joined
Apr 25, 2012
Messages
175
Reaction score
22
First Language
English
Primarily Uses
OK, but it still looks like something broke your engine, and we need to go back to the basics to find out where the problem comes from.

Please make a new project without any additional script and use that project to check your book display event.

Does it work there or not?

If it doesn't work, we'll need to make it working in that new project.

If it works there but not in your game project, you need to disable your added scripts one after another until it works, and then check why the last disabled script causes the problems.
I already attempted it in another project with no scripts, as I said in my last post.

It froze  there as well.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,365
Reaction score
7,674
First Language
German
Primarily Uses
RMMV
Then reinstall the RM, it can also be that your engine has been damaged and you need to replace the files by reinstalling.
 
Status
Not open for further replies.

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,860
Messages
1,017,040
Members
137,569
Latest member
Shtelsky
Top