View previous topic :: View next topic |
Author |
Message |
Nepenthe

Joined: 27 Sep 2004 Posts: 132
|
Posted: Sun Mar 01, 2009 6:25 pm Post subject: Attacks with item costs |
|
|
I want to make a recovery spell with and item cost that adjusts with the amount of damage recovered.
Let's say it will use 30 of an item to heal 30 points.
If you have less than 30 of the item it will take however many you have and heal 1 point for each.
If you're damaged by less than 30 points it'll will use enough to max the stat but no more.
Is there a way to do this in battle with the current attacks, or do I need to wait for battle scripting? _________________ My art (and random photos)! |
|
Back to top |
|
 |
TwinHamster ♫ Furious souls, burn eternally! ♫

Joined: 07 Mar 2004 Posts: 1352
|
Posted: Sun Mar 01, 2009 6:41 pm Post subject: |
|
|
If you were willing to tack the Potion onto your character's stats, you could probably get that to work out.
Maybe a future implementation of conditional attack chaining could also get what you're after.
However, to my knowledge, there's no way to variably edit item costs in battle.
But out of curiosity, what would be the merits of having a spell operate this way, as opposed to simply draining a proportionate amount of Mp or something? |
|
Back to top |
|
 |
Nepenthe

Joined: 27 Sep 2004 Posts: 132
|
Posted: Sun Mar 01, 2009 9:13 pm Post subject: |
|
|
Guns that need to be reloaded.
I have a work-a-round in mind, but it's less than ideal. Search the inventory; replace however many bullets with 1 clip; use the clip item to reload.
Downsides: anything less than a full clip is useless; you'd lose anything still in the gun when you reload. It's a survival horror game and I want every bullet to count.
EDIT: While writing that I thought of two other work-arounds that I think would be better. I'll have to do some tests. _________________ My art (and random photos)! |
|
Back to top |
|
 |
Nepenthe

Joined: 27 Sep 2004 Posts: 132
|
Posted: Wed Nov 04, 2009 11:16 pm Post subject: |
|
|
So this project has been on hiatus pretty much since March because I could never get the battles to work to my satisfaction, but now I'm willing to take another stab at it. The problem is, I'm still at a loss as to how to handle ammunition.
I've got a system (mostly) in place to handle partial magazines (basically, a separate item and corresponding attack for every possible amount of ammo in a magazine), but this still doesn't solve the problem of losing any bullets left in the gun when you reload. Bullets are precious.
I had thought of making an attack that damages the CTR stat by the amount of remaining MP (MP is ammo) and then chaining the reload attack to that, but that would require a separate recording attack for every chain, and CTR is reset at the end of battles anyway, isn't it? Is there a way to dump that value to a variable before it's reset? Or maybe I'm going about this all wrong; I'm open to all suggestions. _________________ My art (and random photos)! |
|
Back to top |
|
 |
msw188
Joined: 02 Jul 2003 Posts: 1041
|
Posted: Sat Nov 07, 2009 11:04 am Post subject: |
|
|
I don't think I understand. Why would the player ever want to reload in battle if he still has some bullets in his gun?
To decide how to do this, I think we need s straightforward discussion of what exactly is being used for what. You say that MP is ammunition. I guess that unloaded bullets are items? What are 'clips' then? Separate items?
It sounds to me like you ought to get rid of the concept of clips as items, and have an attack chain in the nightly that works like this:
Selecting "Reload" starts the chain.
The "Reload" attack is an attack that heals MP by one and costs 1 bullet-item.
The "Reload" attack chains to itself if attacker MP < 100%.
Then getting a larger magazine will just mean increasing the hero's max MP. If I'm missing something let me know. _________________ My first completed OHR game, Tales of the New World:
http://castleparadox.com/gamelist-display.php?game=161
This website link is for my funk/rock band, Euphonic Brew:
www.euphonicbrew.com |
|
Back to top |
|
 |
Moogle1 Scourge of the Seas Halloween 2006 Creativity Winner


Joined: 15 Jul 2004 Posts: 3377 Location: Seattle, WA
|
Posted: Sat Nov 07, 2009 11:10 am Post subject: |
|
|
msw188 wrote: | The "Reload" attack chains to itself if attacker MP < 100%. |
I don't think you can do this. _________________
|
|
Back to top |
|
 |
msw188
Joined: 02 Jul 2003 Posts: 1041
|
Posted: Sat Nov 07, 2009 11:34 am Post subject: |
|
|
Check out the nightly, I'm looking at it as I type. In the chaining menu under attacks there is an option for "condition" on when to proceed with the chain. You can chain based on tags, or you can chain based on whether the attacker's stat is above or below a threshold that you can choose.
I'm guessing your wheels are already turning, haha. An awesome addition to battles without a doubt. _________________ My first completed OHR game, Tales of the New World:
http://castleparadox.com/gamelist-display.php?game=161
This website link is for my funk/rock band, Euphonic Brew:
www.euphonicbrew.com |
|
Back to top |
|
 |
Nepenthe

Joined: 27 Sep 2004 Posts: 132
|
Posted: Sat Nov 07, 2009 5:40 pm Post subject: |
|
|
Wow, that is exactly what I was looking for back when I first started! The clip system was just an extremely inelegant work-around. Thanks!
EDIT: I should probably explain what I was going to do before for the sake of transparency. This is the old method; I'm not doing this anymore! (Also, I was just sitting down to write up these scripts when I remembered why I didn't do it this way before. I haven't tried it yet. At this point, this method is purely theoretical.)
The idea was to wrap the Equip Menu to check when the player equips/unequips a gun. For this example, we'll say the player equips the M1911. The script would then set the Max MP to 7, set globals so the following scripts know to use .45 rounds as ammo, and change the spell list to use the M1911's set of attacks.
Reloading outside of battle (through a custom menu) would call a script that finds the number of .45 rounds in inventory (loose bullets are items). Then it would remove a number of the bullet items to fill MP (which represents the magazine in the gun). Next it would check for any partial or empty magazine items and fill those until there were no bullets left. Or, if all those were filled, any remaining ammo would be kept as loose bullets. As I stated before, there needs to be a separate item for every possible state of a magazine.
My item list looked something like:
x7 .45
x6 .45
...
x1 .45
x0 .45
I was going to rename all of these to ".45 Mag" after I got things nailed down (the item description showed the amount of bullets in each). It was just easier to look at the editor like this.
Lets say you had 12 .45 rounds in inventory. You also had one clip with one bullet in it. The script would set MP to 7 and remove 7 .45 rounds (leaving 5). It would then remove the x1 .45 item and add a x6 .45 item (leaving 0 .45 rounds).
In battle, each gunshot would cost one MP (I had semi-automatic and double-tap spells for the M1911). Reloading during battle would be accomplished by using the magazine items. Each magazine item used an attack that would set MP to the corresponding amount (x6 .45 = 6MP), and would be consumed by use. That also means unique attacks for each magazine item. A battle wrapper would record the number of total magazines before the fight and give back an empty magazine (representing the one removed from the weapon) for each used one afterward. The main problem here is that there's no way to give back the proper number of bullets along with the old magazine.
As to why you'd reload if you still had bullets: Reloading would temporarily lower defense, so you'd want to do it when you're not likely to be hit.
Aaaand that's about it. Way too much work for a really hacky circumvention. Too bad I already made items and attacks for every weapon in the game (including the 30 round M1A1 Carbine!). _________________ My art (and random photos)! |
|
Back to top |
|
 |
|