Hello I am new to this, but I have been trying to create a system where the players HP percentage is used to determine if the shop owner will raise his prices trying to play off the players status. The lower the player's HP the higher the chances he will raise his prices. So lets say 25% of the players HP will increase the chances by lets say 75%. I need help or any suggestions in trying to figure out this process.
Thanks
I've moved this thread to RGSS3 Script Requests. Please be sure to post your threads in the correct forum next time. Thank you.
Lots of questions ...
- changes in the player's HP % will affect the CHANCE the prices will increase, or will affect the AMOUNT of increase?
- if it affects the CHANCE of increase, by how much will prices increase?
- when you say 'player', do you mean 'leader', 'actor 1', 'average of party'? How many characters are in the party, and which one(s) are to be taken into account for this calculation?
- does it also affect the prices at which the player can SELL items?
- does the chance/amount get recalculated every time you enter the shop window? If so, the player could just quit the shop window each time the prices are higher, and talk to the shopkeeper again, repeating the process until the prices are NOT higher.
- if you need a script written, you have to be VERY CLEAR in the amounts. "Let's say ..." isn't good enough, because a scripter can't code that. You have to be exact.
And yes, it will require script mods, and since you say you're new to this, I'm going to assume that you wouldn't be comfortable scripting it yourself, which is why I've moved it to the current location 🙂
yeah the request is not clear enough.
if it's just change that the shop is more expensive when actor hp reach certain percentage it might only need eventing with conditional branch.
just make two shops with different price and add the conditional check combined with random value (although since i'm not clear your concept. i cannot make example).
Most tedious part is calculating the active party's HP.
That is done by checking first if a certain actor is inside the party, and if true you sum its HP to a first variable, and its MHP to a second variable. Then after checking for the same on each actor, you multiply the summation of HP by 100 (so we get a percentage), and divide it by the summation of MHP.
Here an example:
<>Conditional branch: Actor [Eric] is in the party <>Variable operation: [summHP] add Actor[Eric] HP <>Variable operation: [summMHP] add Actor[Eric] MHP:End of branch<>Conditional branch: Actor [Natalie] is in the party <>Variable operation: [summHP] add Actor[Natalie] HP <>Variable operation: [summMHP] add Actor[Natalie] MHP:End of branch(etc)<>Variable operation: [summHP] * 100<>Variable operation: [summHP] / var[summMHP]This of course is something you can throw in a common event, because could be useful on another time. And to retrieve its result, you just make the reference to the summHP variable.
There is also a way to do it just with a script call, but I preferred to do this instead because of personal preoccupations for the youth (?) xD,
Orochii Zouveleki
EDIT: Ah, and after doing the HP% calculation, all you need is a conditional branch, and there you can either throw the random chance or the shops, depending on if you want the altered chance or not (I actually am on Shaz side, I think it's more an annoyance than anything else). Anyway, GL.
Tsukihime just added the capability to use formulas to change prices, you can see it on the scripts section... you would need her Shop manager too though I think
@adik: i think it's a bit different with what the op requested. since the op want a chance to raise price (which can be done already by creating two different shop command. and called the expensive one if the chance occur. no need for formula for this case) based on the party hp (this need more info but i think if the actor is not many. muramasa way already fulfill this part).
Tsukihime's new script would exactly meet the needs of the OP (so much, that I thought this script might have been created based on this request). They would just have to calculate the new price and use the script to set the shop price, before calling the shop processing (so it's not as automated as "make the script do all the calcuations" but infinitely more flexible).
@shaz: for setting price we can already specify price in call shop processing. just set the higher price for second shop processing... (although formula would definitely more helpful if OP want situation like if 75% hp price is different with 50% hp price. but OP hasn't mentioned anything about it) 😀 .
my point is for setting price it might not need additional script at all depending on the situation the OP in 😀 . just left with the chances which i think can be done with eventing too.
i guess i'll let the OP clarify first what he want then.
I simply said that Tsukihime created a script for that... I never said he should use it... I was simply implying the possibility of using it if ever he wanted to do so...
If it is, as said, the CHANCE of a higher price, then yes, it's just a conditional branch, with each one having a shop processing call, and one of them having higher prices input manually. But if the price itself is to be based on the hp rate, it would require a way to set the price to a variable or to a formula, and in that case, the script would be required.
I wish the OP would come back and clarify some of those questions. Maybe they don't need the script anymore and just haven't bothered to say so.