Health indicator (characters)

Started by tanito0, Tue 31/03/2009 18:29:14

Previous topic - Next topic

tanito0

Hi, I'd like to know how to make a dynamic health indicator which would be changed every time a global variable does.
Pixelado

RickJ

use a GUI slider.  Update it with the value of the global variable in repeatedly_execute().

Dualnames

A label would do as well..
unless you want something really coolish done, then I'd guess a slider is just right.
Worked on Strangeland, Primordia, Hob's Barrow, The Cat Lady, Mage's Initiation, Until I Have You, Downfall, Hunie Pop, and every game in the Wadjet Eye Games catalogue (porting)

Khris

I'd use a button with a DynamicSprite as its .Graphic (which is drawn manually each time the health has changed).
Another way is to set the button's .ClipImage property to true, then resize the button. That way, only the left button.Width pixels of the button's image are displayed.

(Btw, this question has come up several times before, so a forum search might come in handy.)

Shockbolt

A sticky thread reserved for "complete codes" that are relevant for a rpg-like adventure game might be something.

Where each code is presented with a title/subject, what happens/what it affects/etc, then the code itself below.

This way it might help reduce the forum search time for all of the people looking for that excat code.

Ghost

#5
No, I really don't think so. Just check how many people ask how to make an inventory interaction, or claim to have found a bug because their characters don't move (because there are no walkable areas), or how often the old "how to make key unlock teh doorz" problem crops up.
There are so many repeated questions that have been answered dozens of times, there is the wiki, there's DualNames' site with code snippets. I don't think a snippet thread would change anything. Apart from that, there's always more than one way to skin a cat or script a script, and what seems perfectly plausible for one might be overly complicated for someone else.

The forum search, as Khris mentions, is totally underused and underrated.

RickJ

Quote
A sticky thread reserved for "complete codes" that are relevant for a rpg-like adventure game might be something.
I think a more appropriate vehicle would be a module that supports RPG type operations.   Especially now that extender functions are supported.

The real problem with what you suggest is that nobody would read it any more than they read the BFAQ, manual, or  forum search.

Shockbolt

If so, then You (all of us) can't complain about the people asking for the same stuff over and over again, as this will always happen,
if what You're saying is true. I mean, reading the manual is one thing, but for a fresh starter it simply looks greek. The tutorial helps, but leaves us hanging
when it comes to the stuff that "really matters" such as using object on npcs, hotspots,objects etc. This was just one example over many.

My opinion still is to have a thread with codes only as I think it'd easy everyones search for the proper approach to what they're
trying to achieve with their own scripting.

Then again, I won't debate more over this as it's not an issue for me. I do my searches, read the manual up and down, and then I ask when
I simply don't understand how it works.

Khris

There is a 13-page-RPG-stickie containing plenty of info and code.

To add my two cents:
If you decided to start painting and someone gave you brushes and a canvas for free, you certainly wouldn't demand free art lessons from them, would you?
RPGs are inherently more complex than adventure games, they usually feature at least shops, a battle system and character stats.
While all this can be done using AGS just fine, there are other game creation systems aimed at the RPG crowd that allow you to focus on design.
If you decide to use AGS, you'll have to bite the bullet and learn scripting/programming.

Like Ghost said, providing ready-made code is not as beneficial as you seem to perceive it to be.
a) Every semi-complex coding problem usually can be solved in at least two different ways.
b) If you don't understand the code you use, you can't adjust it to fit your specific needs. Thus the coder is stuck with explaining or changing it.
If you do understand the code, you probably don't need to use someone else's any longer.
c) Learning how to program isn't about memorizing commands or learning syntax; it's about learning how to approach a coding problem.
Ready-made code that's directly usable prevents the user from learning that.
Ready-made code that's not directly usable is useless to people who can't be bothered to learn that.

In short: either someone's willing to spend a few weeks/months at getting a grasp of scripting (you seem to be), or they simply have to find a scripter.

A module taking care of all RPG-related mechanics will inevitably lead to a lot of half-assed games that more or less look and work the same (much like there are many games using the standard icon bar/cursors and paintovers of Roger).
Helping people with specific questions while they're developing their own RPG is much more fruitful and doesn't prevent the developers from having those great moments of accomplishment when they finally got something to work.

SMF spam blocked by CleanTalk