Jump to content

Recommended Posts

Greetings community.  I do not post much, but I read a lot.  Whenever I am stuck, this is my go to place.  I hope I have posted in the right place.

 

Truth be told, I am not 100% in which category this topic should fall.

 

On to the post.

 

I am currently working on a "ghost hunting" game, and my core mechanic for the game is as such.

 

When the player enters the "haunted" area, they use a Flashlight, which, would have a passive state (From Yanfly's Passive States) that drains

mana every few steps.  That is the easy part.  Unfortunately, I can read most coding languages but I can only write basically.  What I don't know, is how to have the Passive mana drain, only work when in the haunted area, however, the BIGGEST issue I am facing, is this:  When the player runs out of Battery life, they start to take "Fear damage" and their health slowly drains in place of mana. 

 

Question, is how can I have the Health drain active, ONLY if the player has 0 Mana.  I'd like it to turn on at 0 Mana and should the player pick up and use a Battery, the health drain will turn off.

 

Also, how can I have these passives active, only on selected maps?

 

Any feedback would be great, thanks.

Share this post


Link to post
Share on other sites

I know how to do it through events in a common event. Let's get it set up.

  1. Make a common event
  2. Name it
  3. Make it parallel process(NOT autorun)

Once that is done, you need 2 variables.

Var1 = Actor's MAP ID

Var2 = Actor's MP

 

Before I continue, let me tell you how to set a Var to a actor's MAP ID and MP(skip if you already know)

  1. Go to Control Variable
  2. Go to the operand section
  3. Go to game data
  4. Go to the right and click on the 3 dots
  5. Go to Other and the bottom and MAP ID should be the 1st choice.

If you're looking for a persons MP

  1. Go to Control Variable
  2. Go to the operand section
  3. Go to game data
  4. Go to the right and click on the 3 dots
  5. Go to Actor
  6. MP Should be the 4th choice

Let's say you want this active on MAP 1

This is how the common event will look

 

@>Conditional Branch: Variable [0001: Map ID] == 1

     @>Conditional Branch: Variable [0002: # of MP] == 0

          @>Change State: Entire Party, - [MP drain]

          @>Change State: Entire Party, + [HP drain

          @>

     :     Else

          @>Change State: Entire Party, + [MP Drain]

          @>Change State: Entire Party, - [HP Drain]

          @>

     :     Branch End

     @>

:     Branch End

@> 

 

If you want more Map ID's just copy and paste that on the same common event.

 

Any Questions? B)

Share this post


Link to post
Share on other sites

Thank you for such a quick reply! I was playing around with it last night, into the wee hours, I was up till 8th trying to figure things out. I didn't put the Mana Drain on a comment event, I put it as a Passive State using Yanfly's Passives. Your comment event looks like it'll do the trick.

 

I have an issue though. I was using a comment event to switch from MP drain to HP drain. (I am on my tablet, so I don't have pictures to show, so I hope I can explain.

 

 

I set up a common event, set it to parallel

defined a variable (playerHealth) to be equal to actor1's MP

ran a condictional branch that checks if playerHealth is equal to 0.

If it is, apply state HP drain.

 

 

This never works. It will not apply the state when MP gets to 0.

Share this post


Link to post
Share on other sites

Does your actor have MP regeneration? If not, I have no idea because it works for me. Are you sure it looks like this...

 

@>Control Variables: [0001: Map ID] = Map ID

@>Control Variables: [0002: # of MP] = [Actor 1]'s MP

@>Conditional Branch: Variable [0001: Map ID] == 1

     @>Conditional Branch: Variable [0002: # of MP] == 0

          @>Change State: Entire Party, - [MP drain]

          @>Change State: Entire Party, + [HP drain

          @>

     :     Else

          @>Change State: Entire Party, + [MP Drain]

          @>Change State: Entire Party, - [HP Drain]

          @>

     :     Branch End

     @>

:     Branch End

@> 

Share this post


Link to post
Share on other sites

So, I just tried exacall what you had in your last post, nothing. I don't even get the mana drain

I should clarify, the only difference I have is the map ID is set to 5, when I got to map 5, nothing happens. No mana drain, no health drain.

Share this post


Link to post
Share on other sites

Dumb me. I was just leaving it as a common event. I created an invisible event that runs as a parallel and calls the common event. It works now. Exactly the way I wanted to. I was headed the right direction, but I don't think I would have figured it out without your help. Thank you, very much. I really appreciate it. I'm making this game for my girlfriend and she is going to love this mech :)

They states weren't even appearing, but once I created a parallel event that calls the common event you made, on the map I wanted it on, it worked just fine :)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×
Top ArrowTop Arrow Highlighted