dcsimg
A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Custom avatar and NPC generating?

  1. #1
    Junior Member
    Join Date
    Apr 2010
    Posts
    2

    Custom avatar and NPC generating?

    I was wondering if anyone could help me figure out how custom avatars work (in terms of art assets).

    Let's say you want a game where you can get new items and it will appear on your character. Now, you can't create a new animation for every combination of items.... so how does it work?

    Do you just create one base animation of a naked base character? and then just create the various items on their own to be layered on top?

    The same for random NPC generators that takes from various items and combinations to create unique NPC's in the game. What exactly is needed in terms of art? How do you approach this?

    Thanks a bunch

  2. #2
    Depends how you're approaching it. What I've done is put every single item inside the character's movieclip, then turned the the items visible or invisible based on variables and for a particularly complex program as back up I use if/case statements (so if the sucker is wearing a given hat, all other head gear is invisible, even if I forgot to remove the previous head item in my script.) I don't tend to work dynamically from an .as file, I like to be able to draw and place things in the program, but having a huge pile of items on the sprite during editing can look confusing. Because all the junk is invisible, it doesn't slow down the animation, just makes authoring a little cluttered looking.

    I'll put, say, an arm band on the character-->body-->arm-->upperarm movieclip, so it always moves with the arm. I'll put a cyborg eye on the body-->head-->eye.

    That way, a filter applied to the character, like a glow, will affect everything at once, as will transformations to the character.

    To randomly decorate an NPC, when it loads you could use the random math function to choose what movieclips will be visible in each area (arm/head/body/leg/foot etc.) You could also have it generate stats based on what it's wearing (if npc's superHelmet is visible then hitPoints variable plus 3.)

    (If you're working on a web forum, like Gaia, they combine layers of images on the server side then spit out a combined png graphic.)
    Last edited by Gazaah; 07-27-2010 at 10:56 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center