map cure spell cost not applied?

Ask and answer questions about making games and related topics. Unrelated topics go in that other forum.

Moderators: marionline, SDHawk

Post Reply
LieMurderProfit
Slime
Posts: 20
Joined: Mon Feb 13, 2017 10:28 am
Location: Moscow

map cure spell cost not applied?

Post by LieMurderProfit »

The spell I'm using outside of battle (map cure) has a spell cost, the damage is applied to the target but the cost is not applied to the attacker.
Is this intentional?
User avatar
Bob the Hamster
Lord of the Slimes
Posts: 7658
Joined: Tue Oct 16, 2007 2:34 pm
Location: Hamster Republic (Ontario Enclave)
Contact:

Post by Bob the Hamster »

Which cost are you using? I know not all of them are implemented.

It should be considered a bug, I think.
LieMurderProfit
Slime
Posts: 20
Joined: Mon Feb 13, 2017 10:28 am
Location: Moscow

Post by LieMurderProfit »

I was using an SP & HP cost.
It would be really nice if the cost was applied to SP, if not I'll have to build a Spell Points db for all attacks and apply the cost to the attacker.
(My game is turn based, using Action Points)
Last edited by LieMurderProfit on Sun Sep 16, 2018 11:25 am, edited 2 times in total.
TMC
Metal King Slime
Posts: 4308
Joined: Sun Apr 10, 2011 9:19 am

Post by TMC »

I checked the code and found that only MP and (FF1-style) level MP costs are implemented, while HP, item and gold costs are unimplemented for out-of-battle attacks from spell lists. (And if the attack is triggered by using an item, then there are no costs aside from the item being used up).

What do you mean by SP? I assumed that SP is the MP stat in your game (ie the second stat), so that should be properly deducted while HP isn't.
User avatar
Nathan Karr
Liquid Metal Slime
Posts: 1215
Joined: Fri Jan 25, 2008 3:51 am
Contact:

Post by Nathan Karr »

Can we get a per-attack bitset to enable HP, MP, and item costs on items used out of battle at some point? It's the easiest workaround I can think of for making an item that heals both HP and MP at the same time
Remeber: God made you special and he loves you very much. Bye!
LieMurderProfit
Slime
Posts: 20
Joined: Mon Feb 13, 2017 10:28 am
Location: Moscow

Post by LieMurderProfit »

The cost is in MP, I referred to it as Spell Points because that's what it's called in the Global Text Strings.

The attack is called by using an NPC that calls a script that applies map cure.
ie. map cure (atk:Testy 1, h1, h2)

The damage is applied to hero (h1), but the MP cost is not applied to the attacking hero.

I have not added spell lists to the heros because I'm scripting all of my attacks.
TMC
Metal King Slime
Posts: 4308
Joined: Sun Apr 10, 2011 9:19 am

Post by TMC »

Oh, if you're using the "map cure" command, then no costs are applied, not even MP. That attack doesn't have an HP cost from the attacker, it modifies the HP of the target.
Nathan Karr wrote:Can we get a per-attack bitset to enable HP, MP, and item costs on items used out of battle at some point? It's the easiest workaround I can think of for making an item that heals both HP and MP at the same time
I think we should have a global backcompat bit to enable spell costs for spells used from spell lists out of battle and the "map cure" command. Then "map cure" can gain an argument to optionally disable the cost.
On the other hand I guess items shouldn't apply costs by default, so we would want a per-item bit (not per-attack) to opt in to costs.

Implementing all of this should actually be pretty straightforward.
LieMurderProfit
Slime
Posts: 20
Joined: Mon Feb 13, 2017 10:28 am
Location: Moscow

Post by LieMurderProfit »

Thanks for the clarification. I'll have to implement a work-around.
TMC
Metal King Slime
Posts: 4308
Joined: Sun Apr 10, 2011 9:19 am

Post by TMC »

I'd like to do something about this. We've been ignoring the problem for so many years.

There are many, many bugs related to attack costs. Plus we already have several attack bits that are basically there to enable fixes for previous bugs!
Rather than fix everything, right now I'd just fix part of the problem, including "map cure" ignoring costs.

I just started on it, by cleaning up the in-battle and out-of-battle cost checking and cost substracting code into the same form and next to each other, so now it's obvious what's missing and how to fix everything simultaneously.
Last edited by TMC on Tue Sep 18, 2018 2:10 pm, edited 3 times in total.
LieMurderProfit
Slime
Posts: 20
Joined: Mon Feb 13, 2017 10:28 am
Location: Moscow

Post by LieMurderProfit »

Thank you
TMC
Metal King Slime
Posts: 4308
Joined: Sun Apr 10, 2011 9:19 am

Post by TMC »

Progress: I've conducted an extensive survey of all attack cost bugs and spent hours just planning how to go about fixing them. (Not necessarily final, but I'm fairly happy with it)

Attack costs megabug

I think I will fix everything afterall. But adding an argument to "map cure" is actually a pretty tiny change, so I'll do that first.
Last edited by TMC on Thu Sep 20, 2018 11:15 am, edited 2 times in total.
User avatar
Bob the Hamster
Lord of the Slimes
Posts: 7658
Joined: Tue Oct 16, 2007 2:34 pm
Location: Hamster Republic (Ontario Enclave)
Contact:

Post by Bob the Hamster »

I just wanted to say that I read the megabug, and I like your plan TMC
Post Reply