Jump to content
Aveyond Studios Community
rujash

Setting up a hero - Some questions of approach

Recommended Posts

This thread is partly to request help and partly to get my bearings on how to go about organizing actions in a hero object as a newb.

In the game Super Metroid (or one of its offshoots), the character can have multiple types of attacks and in Zelda: OOT Link can have multiple kinds of armor.

Setting this up using states, how is it that these can be setup? How I imagine it happening: you have multiple states and state types for a hero object, for example, setting up the names like this: [State type](State subtype). For Link in Zelda OOT  and Samus in Super Metroid it would be like this:

[Armor](Normal)
[Armor](Water)
[Armor](Fire)
[Weapon](Normal)
[Weapon](Chargeable)
[Weapon](Freezing)

For the armor, it would change appearance and give a certain effect (like "can breathe underwater").
For the weapon it wouldn't change appearance but would change the attack type, like switching guns.

Next Question: Attributes (intelligence, agility ,etc.) from games like Diablo 2. A hero object would have a certain amount of these attributes.  These can be done with states, right?

[Attribute](Vitality)
[Attribute](Strength)
[Attribute](Agility) 

And then the hero object would have other states, which take into account the attributes:

[Stats](Base Attack) = 10 + (STR*1.25)
[Stats](Base Atk. Spd.) = 1/s - (AGI*.008)
[Stats](Base Health) = 100 + (VIT*2.5)

This would be how to set it up, right? What would be the best way to store attributes of a Hero Object, the enabling of its abilities? Can a hero object have multiple states running/enabled at once? Can, for the example of the armors, there be a variable stored somewhere to check if the hero should be even able to change states (like, 'if Link has water armor, enable changing to state of having water armor'). 

When I think of Link from Zelda:OOT, I think of the many multiple conditions limiting the character changing. For example, young link not being able to use certain items or wear certain things which older Link can. Maybe even younger link would have a totally separate inventory menu to older link.

I'm going to study up the tutorials a bit more, but I noticed one of the tutorial links weren't working (the most basic one on what a hero object is) so, in case my understanding fails I wanted to make a post asking for some input. Like how to handle multiple armors and multiple weapons; if there needs to be separate states for every single item in the game that's not one-time consumable/runnable. Potions would also be a question on how to set up.

Share this post


Link to post
Share on other sites

Another question about attacks: is it possible to set up combos using hero object states? For example, there could be:

[System](Attack Manager) = Turn state 'Attacking' to ON & wait 500 milliseconds, then turn state 'Attacking' to OFF & turn state  'Attack Cooldown' to ON & turn OFF
[System](Attacking) = default OFF/FALSE
[System](Attack Cooldown) = wait 100 milliseconds, then turn OFF
[System](Combo Manager) = wait 300 milliseconds, then turn state 'Combo Enabled' to ON & turn OFF
[System](Combo Enabled) = wait 200 milliseconds, then set Combo State = 0 & turn OFF
[System](Combo State) = 0
[Attack](Normal) = If 'A' is pressed & state 'Attacking' is OFF & 'Combo State' = 0 & state 'Attack Cooldown' is OFF, then attack:normal & turn state 'Attack Manager' to ON & turn state 'Combo Manager' to ON & add 1 to Combo State
[Attack](Combo 1) = If 'A' is pressed & state 'Attacking' is ON & state 'Combo Enabled' is ON & Combo State = 1, then attack:combo1 & turn state 'Combo Manager' to OFF & turn state 'Attack Manager'  to OFF & turn state 'Combo Manager' to ON & turn state 'Attack Manager'  to ON & add 1 to Combo State
[Attack](Combo 2) = If 'A' is pressed & state 'Attacking' is ON & state 'Combo Enabled' is ON & Combo State = 2, then attack:combo2 & turn state 'Combo Manager' to OFF & turn state 'Attack Manager' to OFF & turn state 'Combo Manager' to ON & turn state 'Attack Manager' to ON & add 1 to Combo State

Share this post


Link to post
Share on other sites

I think you're on target here, but you'll need to play around with the system to see what it can do for you.

You can't have multiple states on one hero object running at the same time, but you can have multiple events inside a state active at the same time (you can turn them on and off with bools and integers).

You should also be able to set up combos as you've suggested. Let me know how things go.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×