I know it hasn't been that long since I last requested a script, but I really need this one too. I'm planning on employing a Amnesia-esque sanity system for my RPGXP horror game which would function as a Sanity Meter that would decrease whenever something I specify happens. If possible, I would like the sanity meter to decrease if a certain script within an event triggers it so including how much of it would be taken away and to increase by using a certain item. If the Sanity Meter would happen to be low (under a specified limit) I would like to be able to trigger some events as well, and said events would stop functioning if the sanity meter happens to be raised again.
If my specifications didn't make sense at all let me know and I'll try to detail them better.
Sounds like something you could create without scripts.
I could suggest for you to use the HP or MP bar as the sanity meter, then reduce their value through events.
You can use a parallel process with condition branches that states when the HP/MP (whichever you are using for the sanity bar), reaches a certain value(s), something will happen.
Hope that helps. ^^
NOOOO! 😛
You lost the whole point. 😀
Click the database button.
a window opens, ok?
Full of tabs.
Go to TERMS tab.
You there?
Change MP into "Sanity"
and MP short into "SP"
Now you can use mana for Sanity purpose. It won't show as mana but as Sanity and the short term will show as SP.
But using events, changing mana now change... what looks like sanity. 😉
You get advantage of terminology changes to make your life easier.
Use mana addition subtraction (that manipulation capabilities are built in into event commands) and do your magic.
That is what Susan tried to propose. 😉
Now I leave you check it out.
Cthululululululu! 😛
I know and plan on using that method, but I want to display the amount of sanity the player has with an image, and I have the basic functionality of the system in my mind. I want it to work with Common Events, but for some reason they don't trigger.
Fair enough.
Are you fluent on eventing?
I mean have you checked ALL event commands VX Ace can do?
I am asking cause I am about to tell you how to make it happen, but this will need from you to understand some terms and be able to find some commands.
Okay, let's handle this one by one.
I've reread your original post several times, but there's no indication there that you wanted an image to appear on the map, only about a Sanity Meter and how it can be decreased, and how to make certain things happen whenever it reaches a certain level. Can we consider that part of the question solved?
I know that you mentioned Amnesia, but please bear in mind that not everyone has played every single game ever created.
In regards to showing an image that represents a Sanity Meter, you can set the 'Show Picture' command after an event happens that reduces or increases, followed by a 'Wait' command, and then an 'Erase Picture' command. You would not really need switches since the images are supposed to be removed after a set amount of time.
Using images you will have to create a few depending on what you liked shown. Eg. 10 images at varying lengths depicting 10%, 20%, 30%.... 100%.
Create conditional branches for those images to display the correct image for a range of values. Eg. Assuming your maximum sanity 100, if the sanity value is 50-59, show the image that depicts 50% sanity.
You can create the whole batch of conditional branches, and copy-paste the entire batch into every event applicable.
If you require a script to simplify this process, I'm sorry, but I won't be able to help you here since I don't have a working RMXP at the moment. You will have to wait for someone else to help you there.
Anyway, hope this helps. ^^
@Dreadshadow: Sorry, but he's using RMXP, not RMVX Ace.
Using only two images at a time instead of creating 10-100 different images?
It's an excellent idea. ^^
It will require manipulation of the image position and zooming option, but creative and definitely doable.
@Dreadshadow: Definitely a good way to make it, but I'd rather stick with the tons-of-images way, I like it the most.
@Susan: I apologize for not explaining what I actually wanted from the start.
The idea you proposing wouldn't work that well because I'm using an item that would raise the Sanity Meter to a certain amount depending on how low it was to begin with. Say my sanity meter is at 30%, and the item I made restore 25%, if I were to use it at 30% the sanity meter would increase to 55%. Also, those common events were just to test how they worked, but if the image I specifically set to show doesn't appear it means that I'm doing something wrong, hence no matter how much I advance it won't work. The reason why I posted those images was to ask you guys if you knew where I got it wrong.
Also, is there a command for the Script option from RMXP's event to check on the player's specific stat? Like health for example, so when the player's stat is at a certain level I could trigger something. Maybe something like @player.health = X?
Let's take a break.
@PlexaryDamato, you got a sanity system in your mind and I am sure you have planned every detail on how it will work.
The bad news is that you got a system in YOUR mind only. 😛
Not our mind.
So, I would appreciate to share such details in order to give you a solution on your question that will fit your needs.
We got not much info on how this system works. Can you describe it as detailed as you can please? 🙂
"Also, is there a command for the Script option from RMXP's event to check on the player's specific stat? Like health for example, so when the player's stat is at a certain level I could trigger something. Maybe something like @player.health = X?"
Hey... I am not sure since it is XP, but I guess you can put such a value in a variable using a simple event command right?
Well basically the main character has a certain amount of sanity that would decrease if he were to witness a monster or unsettling events, that's something I'm sure all of you understood. I'm planning on using the character's mana for Sanity, that's something you also might have guessed for now, but I want to show a certain image of how much sanity the player has, more specifically a bar (or meter) depending on how much sanity the character actually has. For example, let's say the character witnessed an unsettling event and lost 20% of sanity leaving him 80%, then the meter would show how much sanity the character has left.
So, this is how the player would see it, but for it's functionality, I was thinking of using the Conditional Branch/Script condition by adding a code to check on the player's mana (or sanity) and display an image showing exactly how much sanity he has left. For that I would be using Common Events, whenever the player would happen to enter a new room, the meter would be shown for a few seconds and go away until he were to witness unsettling events, encounter a monster, heal up with an item of my choice or enter another room. So instead of only showing it whenever it decreases or increases I want it to be a general thing that could be shown in every room without the need of actually making an event showing the image and duplicating said event on every single room of the entire game. I mean, I'm probably going to use events for it to be shown, but I don't want the event to have that many event commands, I want it to just call for a common event and let it be. That's why I need to know if the common events I have already posted were supposed to work or not, and if they wouldn't work I would like to know how to make it work.
Of course, I'm still curious as to how would I be able to check for the player's mana so that I could show a certain image based on how much sanity the player has left.
No worries, PlexaryDamato. ^^
The example I gave above will allow the images to change according to the current sanity value, regardless of whether it increases or decreases.
You simply need to add the batch of conditional branches to a common event, and have that restorative item or even restorative event to call up that particular common event.
I can't really comment on your eventing right now since I can't test it out, but my guess is it's because either:
- You did not switch on that particular switch via the relevant events, or
- Your parallel processes are activating/deactivating the switches too fast, therefore showing only the second image. By the way, it might be better for you to use 'Erase
Picture' instead of setting opacity to zero.
Is there a specific reason why you must use switches? Can you not simply show the image, wait 100 frames, then erase the image? It seems more effective than using switches.
I would recommend using switches if you need the meter to appear on the map at specific times, and disappear at others. That being the case, you should activate or deactivate the switches at specific events or intervals, not in the parallel process itself.
The script call you would require to call up the actor's SP value (if you are using that value) is:
$game_actors[n].sp
If you want to call a specific value (eg. 87), use:
$game_actors[n].sp == 87
If you want to call a value within a certain range (eg. 30-39), use:
$game_actors[n].sp >= 30 && $game_actors[n].sp < 39
where 'n' is the location of your actor in your database, depicted by number.
Event command
Control Variables> Actor > Sp
Control Variables> (select your acror) > (select SP)
RULE: If it is possble using Eventing, it is 100% possible with scripting.
@Susan is a :ninja: 😉
Oh my god, I can't believe how stupid I am, I just found out why it wasn't working for me. I set the 'Move Picture' event command to fade in the screen so it would show up but I never set to show the image in the first place, there was no image to fade in.
Also, I can see what you mean Susan. Thanks for those commands, they work perfectly fine and they'll be of great help. As for erasing the pictures, will do, thanks for your advise.
@Dreadshadow: I don't seem to understand what you're trying to say there, are you trying to mention a way of checking or altering the sanity levels of the main character? If that's the case that won't work because I'm aiming for a command to check on the character's sanity in-game and depending of the levels show a certain image. Regardless, thanks for trying, your help is appreciated.