Saturday, July 31, 2010

Some Little AGS Tricks

In the couple of years I've been fiddling with AGS scripting, I've picked up a couple of tricks that I've learned from others and from fiddling, and also shared with a few others. There's nothing mindblowing in here, but perhaps some of them can be useful to those of you interested in using AGS.

- The Game.DoOnceOnly(); function can save you a fair bit of time and save you messing around with various variables and the like. Good for whenever you just want to do something a single time - which in adventure games are a fairly regular occurrence.
- If you try to use a sprite with an alpha channel on a gui without a background image that also has an alpha channel, it won't show properly. If you don't want a background image, import a blank png with an alpha channel for the background. If you have trouble with this, try drawing a pixel at 1% opacity on the image then importing it.
- When using a limited palette or avoiding black in general, the font outline can stand out and be a bit ugly. Use game.text_shadow_color to change it to whatever you want.
-If you keep all of a character's animations in a single view aside from speech animations, after calling an animation the game stores that loop as the character's talking loop. Therefore if you try to get the character to talk after running animation stored on loop 7, the game will try to play the speech loop at 7 - which probably doesn't exist, or is some special speech loop. After running an animation, try resetting the character's loop to match what direction they are facing to avoid characters suddenly changing direction when they start talking.
- If you have a special talking loop, simply use character.LockViewFrame() to lock it to that when you want them to talk in that direction, and place it after the other 4/8 in your talking view, then unlock them after the dialogue has ended.
- Use custom icons! They make your game look a ton more professional!
- When using custom text window guis with custom border images, make sure your border images aren't too wide. I generally stick to 1 pixel wide - otherwise you may find that the border sprite can jut out from the corner. This is particularly hard to spot if you're using alpha channel based border images, but still looks odd.
- Importing sprites is a darn lot easier with the quick import sprites and assign to view functions of the AGS editor.
- Inventory items are a lot easier to use if you make a small pointer graphic for them as well - which is easy enough to do.

Hope these prove useful - if I think of more I will most definitely share them.

7 comments:

Rambo said...

Nice! It's still too early in my AGS studies for me to really appreciate how useful some of these tricks are, but thanks anyway for sharing, i'll be keeping this list handy=)

Ben304 said...

Hopefully they'll prove useful to you at some point!

Some of these had me stumped for a fair while, so I thought they might be nice to share with anyone who has pondered over the same issues.

Isxek said...

I guess these tips are for AGS 3.1, right? (Sorry, I was playing some old AGS games yesterday - I'm probably still in 2.72 mode :D )

Ben304 said...

Yep - 3.12 is what I use to work on games mostly, as well as the 3.2 beta sometimes.

The 3.xx editor is so much nicer to use than the 2.72 one that I really can't think of a single reason to keep using 2.72 ;D

Francois said...

Thanks, this experience feedback is really useful!

Ben304 said...

Glad to hear it :)

Runescape Gold said...

Currently, there's a chance you're capable of check out Melzar's Network, but seize a number of food initial RS Gold. You may find out the Maze through going southern using the Designing Guild. Use the labyrinth vital on the entrance; eliminate people unappealing giant subjects and soon you have a reddish key. Utilize crimson key to available the doorway around the Northwest facet and also rise the particular step ladder.Discuss for that Guild grasp. Throughout your current discussion, talk about concerning rune denture armour Runescape Gold. He can give you specifics of Oziach. Now, you will need to to the North west through the Edgeville Bank to discover Oziach's property.