Inn System Help

xmattwhitex

Warper
Member
Joined
Sep 20, 2016
Messages
2
Reaction score
0
First Language
English
Primarily Uses
Hi everyone!


I'm trying to get working an inn system which has two specific characteristics:


- Cost of the inn is determined by lost HP (ie 1 gold per 1HP to recover)


- Inn restores all HP/MP and states except for KO


Does anyone have any workarounds or suggestions on how to do this?
 

YoraeRasante

Veteran
Veteran
Joined
Jun 6, 2014
Messages
1,643
Reaction score
420
First Language
Portuguese
Primarily Uses
RMMV
Well, there is the hard way...


I'd suggest a common event, since you can just call it anytime instead of copying every time you need it

  • Set a variable to 0,
  • through forks to check if they are in the party, add the maxhp of every actor to the variable, then subtract the current hp, giving you a sum of their lost hp
  • Give the message with the value of the variable as the cost
  • put a choice, and if the player agrees put a second to check if they have enough gold. If so, subtract the value from the variable from the player's gold
  • use the Add HP and Add MP commands to recover them, and Change States to remove states one by one.

As you can see, plenty of work... would be much easier if done by plugin, true. But then you'd need to have it written first. No idea if one already exists.
 

Hitzuki Key

Dark Knight
Veteran
Joined
Aug 6, 2016
Messages
49
Reaction score
106
First Language
None really xD
Primarily Uses
Would it be possible to share what you've made so far? 


Waterguy pretty much said what had to be done, you would have to work with variables.


But I would add 2 more things to it. x:

  • I would say that it would be best to make this into a Common Event, since you might have more than only 1 INN.
  • When checking for actors in the party, ignore these that have the KO state.





Let the common event run like this (not sure if you want to know it like this, just in case i put it in spoilers.)

conditional branch: If Actor 1 is in party then (This will check if Actor 1 is in the party!)


- conditional branch: Does Actor 1 have State KO? (This will check if Actor 1 is KO)


- - Yes?: (leave empty)  (If Actor 1 is KO, it will do nothing and cancel this conditional branch)


- - No?: (continue with bellow)  (If Actor 1 is not KO, it will continue with the things bellow)


- - control variables: "Variable 1: Actor's Current HP" set Game Data > Actor 1 > HP  (This will set variable 1 to the Actor's current HP)


- - control variables: "Variable 2: Actor's MAX HP" set Game Data > Actor 1 > MAX HP  (This will set variable 2 to the Actor's MAX HP)


- - conditional branch: "Variable 1: Actor's Current HP" == "Variable 2: Actor's MAX HP"  (This will check if both values are the same)


- - - Yes?: (leave empty)  (If they are, then nothing further will happen and the conditional branch will cancel)


- - - No?: control variables: "Variable 2: Actor's MAX HP" sub "Variable 1: Actor's Current HP" (This will calculate the difference from MAX HP to the current HP of the actor, by calculating Max HP - Current HP)


- - - control variables: "Variable 3: Total HP cost" add "Variable 2: Actor's MAX HP"  (This will add the difference from Current HP to Max HP to variable 3)


Do this again with every possible Actor that could be in your party, copy paste the entire thing and switch from Actor 1 to Actor 2, and then to Actor 3. :3 You can always use the same 2 beginning Variables (1 and 2) in this way.


After you're done with every actor, you will have the missing total HP value for every party member in the Variable 3: Total HP cost.


At least that's how I would do it by using only 3 variables in total. o:


The question after this is how you plan on continuing after choosing knowing the total HP missing from each character.


You could have the pay up to the Variable 3 in gold, healing every character that isn't knocked out...~
 
Last edited by a moderator:

xmattwhitex

Warper
Member
Joined
Sep 20, 2016
Messages
2
Reaction score
0
First Language
English
Primarily Uses
Thank you very much guys it works perfectly. I was confusing myself with how to get the cost of the whole party's HP when I initially tried to do it with common events and variables, but this works!
 

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

Latest Threads

Latest Posts

Latest Profile Posts

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'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c

Forum statistics

Threads
105,857
Messages
1,017,018
Members
137,563
Latest member
MinyakaAeon
Top