change global varibale if the hero is hit

Make games! Discuss those games here.

Moderators: Bob the Hamster, marionline, SDHawk

Post Reply
User avatar
marionline
Metal Slime
Posts: 673
Joined: Sat Feb 26, 2011 9:23 pm

change global varibale if the hero is hit

Post by marionline »

For a game I was planing to change a global varibale if the hero is hit by a certain attack.
Then reading the thread about „Changing Music during a battle“ made me wonder if this is possible at all. :o
So I looked throug the OHRs Attackbitsets and Enemystats and I think there was no option to run a script. Hopefully I just did not find it. :(

I also looked up battlescripting in the wiki, I didn't even know that it existed until that moment... :D

The Questions are:

1) Can I change a global varibale if the hero is hit by a certain attack in the OHR?
Or it this just possible without battlescripting or making a unique battle system?


2) And ( if 1) if not possible) do you have an other ideas how to handle this?
Like a work-around?

I thought about calling the formations throug a script and change the variable if you fight against that enemy that could use the attack, so it's depending on the enemy not on the attack itself. But that would not be exactly what I wanted. :-/

Maybe you have better ideas?
User avatar
BMR
Metal King Slime
Posts: 3310
Joined: Mon Feb 27, 2012 2:46 pm
Location: The Philippines
Contact:

Post by BMR »

I'm fairly certain that it can't be done without scripting your own battle system. Then again, I've been wrong before, so don't take my word for it.
Being from the third world, I reserve the right to speak in the third person.

Using Editor version wip 20170527 gfx_sdl+fb music_sdl
User avatar
RMSephy
Metal Slime
Posts: 356
Joined: Mon Dec 21, 2009 5:56 pm

Post by RMSephy »

What exactly do you want to do with the global variable? One possible workaround for this is to have an attack that turns on a tag if it hits a hero. You can have an after battle script that checks the tag and adjusts the global variable accordingly.
User avatar
marionline
Metal Slime
Posts: 673
Joined: Sat Feb 26, 2011 9:23 pm

Post by marionline »

I wanted to check if one of the heros gets his by a certain attack and lower the variable by 1 each time he gets hit.
(I intend to use the variable for other things ingame as well, for example changing story elements depending on it or setting it +1 depending on answers give etc.)
I'm not sure, but the "set-tag-and-check-tag"-thing works for any hero not one specific hero, right?
User avatar
Bob the Hamster
Liquid Metal King Slime
Posts: 7460
Joined: Tue Oct 16, 2007 2:34 pm
Location: Hamster Republic (Ontario Enclave)
Contact:

Post by Bob the Hamster »

Yes, support for battlescripting will happen someday, but i can't promise any timescale. There is still a lot of battle system cleanup that has to happen first.

Do you just want to detect if a particular hero has been hit by a particular attack? If so, you should be able to do it by setting a tag in the attack. Then you can check that tag i a script after the battle ends.
User avatar
RMSephy
Metal Slime
Posts: 356
Joined: Mon Dec 21, 2009 5:56 pm

Post by RMSephy »

Ah, yeah. The tag thing would also only work once per battle, so probably not a good idea in this case...

If the hero's not using MP, maaaybe you can also use that as a counter for how many time that hero's gotten hit by the attack? Like, start him off with 100 MP, and have the attack lower it by 1 every time he gets hit. And then at the end of the battle calculate how much MP he's lost and subtract that from the global variable?
User avatar
marionline
Metal Slime
Posts: 673
Joined: Sat Feb 26, 2011 9:23 pm

Post by marionline »

That's a good idea! :D

But can I use this for diffent heros aswell?
I want to have each Hero's Global-Variable to sink then beeing hit by attaks but there attaks are diffrent from one hero to another. Maybe that's to complicated.
Maybe I can give each Hero a special typ and make them imune to attacks that should not affect their Mp... :???:
I'll play around with the attack bitsets to see how far I get. :)
User avatar
Pepsi Ranger
Liquid Metal Slime
Posts: 1419
Joined: Thu Nov 22, 2007 6:25 am
Location: South Florida

Post by Pepsi Ranger »

This post is a good time to remind the developers about Bug 600 and how it would help your game (and mine) out a little more.

*I've been needing this for several years in order to complete my "Field Stats" feature in Powerstick Man XE.
Place Obligatory Signature Here
User avatar
Meowskivich
Blubber Bloat
Posts: 2199
Joined: Tue Mar 06, 2012 12:38 am
Location: Earth
Contact:

Post by Meowskivich »

marionline wrote:Maybe I can give each Hero a special typ and make them immune to attacks that should not affect their Mp... :???:
Go into Edit General Game Data, go into battle system options, add more elements, then rename them to whatever you desire in the global text strings section. Make all heroes you don't want effected by the type of attack immune to it. Mission accomplished :kamina:
dOn'T MiNd mE! i'M jUsT CoNtAgIoUs!!!
Play Orbs CCG: http://orbsccg.com/r/4r6x :V
User avatar
BMR
Metal King Slime
Posts: 3310
Joined: Mon Feb 27, 2012 2:46 pm
Location: The Philippines
Contact:

Post by BMR »

RMSephy wrote:Ah, yeah. The tag thing would also only work once per battle, so probably not a good idea in this case...

If the hero's not using MP, maaaybe you can also use that as a counter for how many time that hero's gotten hit by the attack? Like, start him off with 100 MP, and have the attack lower it by 1 every time he gets hit. And then at the end of the battle calculate how much MP he's lost and subtract that from the global variable?

That is a good idea, and I'm guessing that it's a good workaround for what you're trying to do.


Meowskivich wrote:
marionline wrote:Maybe I can give each Hero a special typ and make them immune to attacks that should not affect their Mp... :???:
Go into Edit General Game Data, go into battle system options, add more elements, then rename them to whatever you desire in the global text strings section. Make all heroes you don't want effected by the type of attack immune to it. Mission accomplished :kamina:

Aye, that seems to be the way to do it. If you wind up having a lot of different types though, it can be a bit much to keep track of. On the other hand, I suppose not everyone is as disorganized as I am, hehe.
Being from the third world, I reserve the right to speak in the third person.

Using Editor version wip 20170527 gfx_sdl+fb music_sdl
User avatar
Meowskivich
Blubber Bloat
Posts: 2199
Joined: Tue Mar 06, 2012 12:38 am
Location: Earth
Contact:

Post by Meowskivich »

AR-PUH-GUH! had 44 elements, if I remember right. however, they were used for various things, from basic elements (fire, water, wind, communicating with bats, etc) to summoning foes.
dOn'T MiNd mE! i'M jUsT CoNtAgIoUs!!!
Play Orbs CCG: http://orbsccg.com/r/4r6x :V
User avatar
BMR
Metal King Slime
Posts: 3310
Joined: Mon Feb 27, 2012 2:46 pm
Location: The Philippines
Contact:

Post by BMR »

Meowskivich wrote:AR-PUH-GUH! had 44 elements, if I remember right. however, they were used for various things, from basic elements (fire, water, wind, communicating with bats, etc) to summoning foes.

44?? Crikey, and I'm having trouble juggling things around with just 16 :v:
Being from the third world, I reserve the right to speak in the third person.

Using Editor version wip 20170527 gfx_sdl+fb music_sdl
User avatar
Meowskivich
Blubber Bloat
Posts: 2199
Joined: Tue Mar 06, 2012 12:38 am
Location: Earth
Contact:

Post by Meowskivich »

Just checked. It was 45. I was so close on either end, my other guess was 46.
dOn'T MiNd mE! i'M jUsT CoNtAgIoUs!!!
Play Orbs CCG: http://orbsccg.com/r/4r6x :V
User avatar
marionline
Metal Slime
Posts: 673
Joined: Sat Feb 26, 2011 9:23 pm

Post by marionline »

Thanks a lot to Meowskivich for telling me how to do the elemental settings! :D
That was very helpfull! You must know the engine well.

Talking about Elements I should thing of how many elements I want to use in game.
16 sounds like a lot to me and maybe a bit complicated to balance in the end, thoug I've never tried balancing before.
User avatar
Meowskivich
Blubber Bloat
Posts: 2199
Joined: Tue Mar 06, 2012 12:38 am
Location: Earth
Contact:

Post by Meowskivich »

You're welcome. :D
I know how to use the basic engine well enough, it's the plotscripting that really gets me.
dOn'T MiNd mE! i'M jUsT CoNtAgIoUs!!!
Play Orbs CCG: http://orbsccg.com/r/4r6x :V
Post Reply