Sanity Meter

Discussion in 'RGSS Script Requests' started by PlexaryDamato, Mar 1, 2015.

  1. PlexaryDamato

    PlexaryDamato Veteran Veteran

    Messages:
    40
    Likes Received:
    10
    First Language:
    Spanish
    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.
     
    #1
  2. Susan

    Susan Veteran Veteran

    Messages:
    2,766
    Likes Received:
    8,389
    Location:
    somewhere on this planet~
    First Language:
    No idea...
    Primarily Uses:
    RMMV
    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. ^^
     
    #2
  3. Dreadshadow

    Dreadshadow Lv 38 Tech Magician Moderator

    Messages:
    3,840
    Likes Received:
    2,488
    First Language:
    Greek
    Primarily Uses:
    RMMV
    My goodness, my thoughts exactly.

    Nothing to do here.

    :p
     
    #3
    Gothic Lolita likes this.
  4. PlexaryDamato

    PlexaryDamato Veteran Veteran

    Messages:
    40
    Likes Received:
    10
    First Language:
    Spanish
    I tried to assemble a Sanity Meter system via common events, but for some reason they don't seem to work. This is what I have:

    First Common Event

    [​IMG][SIZE=13.63636302948px][/SIZE]
    [SIZE=13.63636302948px]Second Common Event[/SIZE]

    [SIZE=13.63636302948px][/SIZE]

    [​IMG]
    [SIZE=13.63636302948px]​[/SIZE][SIZE=13.63636302948px][/SIZE]
    [SIZE=13.63636302948px]What I'm trying to do is trigger the first common event which later on triggers the second one by turning on the ShowSanityMeter switch, but for some reason it doesn't activate. I need help please.[/SIZE]
     
    #4
  5. Dreadshadow

    Dreadshadow Lv 38 Tech Magician Moderator

    Messages:
    3,840
    Likes Received:
    2,488
    First Language:
    Greek
    Primarily Uses:
    RMMV
    NOOOO! :p

    You lost the whole point. :D

    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! :p
     
    Last edited by a moderator: Mar 2, 2015
    #5
    Susan likes this.
  6. PlexaryDamato

    PlexaryDamato Veteran Veteran

    Messages:
    40
    Likes Received:
    10
    First Language:
    Spanish
    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.
     
    #6
    Dreadshadow likes this.
  7. Dreadshadow

    Dreadshadow Lv 38 Tech Magician Moderator

    Messages:
    3,840
    Likes Received:
    2,488
    First Language:
    Greek
    Primarily Uses:
    RMMV
    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.
     
    #7
  8. Susan

    Susan Veteran Veteran

    Messages:
    2,766
    Likes Received:
    8,389
    Location:
    somewhere on this planet~
    First Language:
    No idea...
    Primarily Uses:
    RMMV
    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.
     
    #8
    Marsigne, Dalph and Dreadshadow like this.
  9. Dreadshadow

    Dreadshadow Lv 38 Tech Magician Moderator

    Messages:
    3,840
    Likes Received:
    2,488
    First Language:
    Greek
    Primarily Uses:
    RMMV
    Oh boy! Didn't realized that. :p

    Show Picture can do the trick I guess.

    May I propose one thing to enhance your idea Susan? :D

    Imagine a meter like that:

    10%           90%

      |        ....    |

    ---------------||--

    like a volume control moving and numbers above it showing where the sanity score is.

    ---||--------------

    Now what if you make a picture of that axis as a background picture including the numbers

    and then only one picture as a moving indicator ( || ) showing up somewhere?

    That way you use less pictures and make it somewhat potentially more elegant. ;)

    Not to mention that you can make increase or decrease of sanity by 1%  without using 100 pictures. ;)

    I mean you can have the back "meter axis with numbers" picture and also the "indicator" thus 2 pictures for infinite scale of accuracy. :p

    Just a thought. :p
     
    Last edited by a moderator: Mar 2, 2015
    #9
    Susan likes this.
  10. Susan

    Susan Veteran Veteran

    Messages:
    2,766
    Likes Received:
    8,389
    Location:
    somewhere on this planet~
    First Language:
    No idea...
    Primarily Uses:
    RMMV
    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.
     
    #10
    Marsigne, Dalph and Dreadshadow like this.
  11. PlexaryDamato

    PlexaryDamato Veteran Veteran

    Messages:
    40
    Likes Received:
    10
    First Language:
    Spanish
    @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?
     
    Last edited by a moderator: Mar 2, 2015
    #11
  12. Dreadshadow

    Dreadshadow Lv 38 Tech Magician Moderator

    Messages:
    3,840
    Likes Received:
    2,488
    First Language:
    Greek
    Primarily Uses:
    RMMV
    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. :p

    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?
     
    #12
    Susan likes this.
  13. PlexaryDamato

    PlexaryDamato Veteran Veteran

    Messages:
    40
    Likes Received:
    10
    First Language:
    Spanish
    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.
     
    #13
    Dreadshadow likes this.
  14. Susan

    Susan Veteran Veteran

    Messages:
    2,766
    Likes Received:
    8,389
    Location:
    somewhere on this planet~
    First Language:
    No idea...
    Primarily Uses:
    RMMV
    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.
     
    Last edited by a moderator: Mar 2, 2015
    #14
  15. Dreadshadow

    Dreadshadow Lv 38 Tech Magician Moderator

    Messages:
    3,840
    Likes Received:
    2,488
    First Language:
    Greek
    Primarily Uses:
    RMMV
    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:   ;)   
     
    Last edited by a moderator: Mar 2, 2015
    #15
    Susan and PlexaryDamato like this.
  16. PlexaryDamato

    PlexaryDamato Veteran Veteran

    Messages:
    40
    Likes Received:
    10
    First Language:
    Spanish
    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.
     
    #16
    Dreadshadow and Susan like this.
  17. Dreadshadow

    Dreadshadow Lv 38 Tech Magician Moderator

    Messages:
    3,840
    Likes Received:
    2,488
    First Language:
    Greek
    Primarily Uses:
    RMMV
    This is an event command that puts into a variable the value of the current mana (SP).

    On common event, you can find the command Control Variables.

    By selecting the radio button Actor and choosing your hero, then choosing SP, you assign such a value to the selected variable. ;)

    glad your case is solved.
     
    Last edited by a moderator: Mar 2, 2015
    #17

Share This Page