Page 1 of 2 12 LastLast
Results 1 to 15 of 29

Thread: Runescape/WoW-Ish RPG AS Help/Debugging

  1. #1
    Jephz's Avatar
    106
    posts
    The Penguin n00b

    Afrostyle Runescape/WoW-Ish RPG AS Help/Debugging

    ,Hey guys, this is my first post ^^. First time using KirupaForums too so lemme introduce myself. I'm 13years old, my home is America but currently living in China. I have been playing around with ActionScript for, lets say about a year. I guess I'm wavering between Beginner Level - Intermediate Level. All the AS is self-taught with a little help from my big bro. I usually go on Newgrounds Forum for help but they block Newgrounds in China so I have no where else to turn to other then here. So now that we have that down, lets get to the main problem. I always wanted to make Runescape/WoW type RPG (i know its pretty advanced). I tried many times, but failed. So this time, I really want to complete one. It doesn't have to be extremely good, just want a basic layout down. I have a small demo linked but its really buggy and its not even close to completion. Its called KINK. I have alot of problems with this one and I can't do it all alone. So i need all the help I can get. I'll posts updates of the game and problems too as they come. This post isn't too long for a first one is it?

    PS: I'm not like those guys who have very basic AS skills but want to make some hot-shot and want everyone to just give them the script for it. I really want to learn and understand the concept of AS. I already bought the FLash 8 AS Bible and currently reading it.

    ----------------------------------------------------------------------------------------------

    UPDATE!!!


    Tuesday March 13, 2008 - New Photoshopped Graphics and sliding inventory interface.

    All artwork and AS programming are done by me.
    http://spamtheweb.com/ul/upload/130508/30833_Kink.php

    PROBLEM 1: Creating a Runescape-Like Inventory (UNRESOLVED)


    Like the title says, I would like to create a Runescape-Type Inventory. My current one is too simple and it only involves hitTests with the item place holders on the main timeline. If you played Runescape, you'll see what I mean. If you haven't, it goes like this.

    Basically, its tile based. You can drag-n-drop items to reorganize. But the place-holders are nested inside another symbol because its for sliding (tell me if i'm using the word "nesting" right). I also need help with duplicating items from a database. The database will store all the possible items available in the game, and then whenever the player acquires a item, Flash will just duplicate a copy from the database and place it onscreen for the player to pick up. Ya maybe its pretty complicated but I'm willing to learn. Heres a small example:



    So far, theres no items to drag n drop and I'm using tweens for the slidings. Is there a way to dynamically do eased movements for MCs? Also, I nee to learn how to lock items so when the user drags and drops a item, it will be positioned correctly and not all over the place. Any help would be appreciated.

    Something like this:

    http://spamtheweb.com/ul/upload/1305..._inventory.php

    Basically, I want my inventory to look like that except you can only drap the items into boxes and not just anywhere. Note that i didn't make that, just found it somewhere on KirupaForums.

    PROBLEM 2: SCROLLING THE TERRAIN W/ ITEMS/OBJECTS
    (RESOLVED)

    Yup, I never really done scrolling terrain before, not alone with objects/items. So basically I changed my stage width and length to 1024x800. My background terrain is 1900x1200 i think. I know I have to write a code something like when key.left is down, terrain_mc goes _x += speed or something, but I never done it with objects. Any tips/tutorials?
    Last edited by Jephz; June 11th, 2008 at 02:54 AM. Reason: Updated Game!

  2. #2
    Ok, from the looks of it, you do have a good ground in AS to build upon. And i am really glad, you want to learn!! I am a bit busy these days with some client projects, but i will try to help you as much as i can. Just remember, post your problems precisely, and try to show us what you have tried to solve it...

    Now, both Wow and Runescape are MMORPG, are you trying to make a MMORPG or just a RPG? In any case, complete all the tutorials on tonypa's site about tile based games. You will find it real handy for games like this, and it covers lots of nice functions that you will need to make this more professional. If you need to know anything in particular just ask here. And when you do ask something new, always update the first post with your question, so that everybody can find it easily and help you more... Good Luck!!!
    MY BLOG

    I need a SPRITER who can do pixel arts for an arcade fighter project. If you can help out, please pm me.
    I also need someone who can write simple xml files.


  3. #3
    I recommend switching to AS3. Search on these forums for concepts like bitmap rendering and others. It will probably seem really odd to start out with because you'll stop using movie clips, but the speed is worth it especially if you choose to do larger games.

    http://www.kirupa.com/forum/showpost...91&postcount=9
    Also if you choose to use Flex. The Flex 3 SDK came out so download that when setting up the IDE.

    since your 13 I'm not sure if your math is high enough for any complex hit detection. If your older brother knows vector math and wants to help you then you can learn to use the Separating Axis Theorem from this tutorial:
    http://gpwiki.org/index.php/VB:Tutor...tion_Detection
    Then look into collision response to find the minimum translation vector to push two object away from one another. Right now you are getting the spazzy collision response because you aren't moving the object to a place where it won't collide. So when you move the player right after that find the minimum translation that would move the object out of the other object and move it. To figure this out on paper draw two rectangles. Make one of them your character and the other a wall and find the distance and what direction it would need to not collide anymore. It's a fun logic puzzle for people normally.

  4. #4
    Jephz's Avatar
    106
    posts
    The Penguin n00b
    For bluemagica:

    I'm not ready for a online multiplayer yet, just think of this game as the simple non multi version of Runescape/Wow. Also, can you give me a link to tonyapa's site? Thanks alot.

    PS: I'm just doing Flash for fun, don't really have the time to make it very pro-ish. I just want to improve my AS skills with this game.

    For Sirisian:

    Is As3 very complicated? And is there really a very big difference between As2 and As3? I only have Flash 8 Professional so I can't do AS3 projects. But if its really great, I could get FlashCS3. And about the collision detections, I know its really crappy since I just put a invisible bar for hitTests and the code is just to pusht the Player away. I'm not great in Physics or Trig. Maybe I should first get a basic game layout done before moving to the details?

    Thanks for all your help guys. I'll keep this topic updated as much as possible.

    -Jephz

  5. #5
    You don't have to use Flash CS3 to use AS3. You can just download an IDE like FlashDevelop and use it. If you click the link you'll understand. AS3 is different than AS2 since it's completely object oriented. I was using C++ when I was 13, so it's probably a good idea you start to learn some of these ideas especially if you start using other languages like C# or Java.

  6. #6
    Jephz's Avatar
    106
    posts
    The Penguin n00b
    Quote Originally Posted by Sirisian View Post
    You don't have to use Flash CS3 to use AS3. You can just download an IDE like FlashDevelop and use it. If you click the link you'll understand. AS3 is different than AS2 since it's completely object oriented. I was using C++ when I was 13, so it's probably a good idea you start to learn some of these ideas especially if you start using other languages like C# or Java.
    Ah ok then. But I'm using a Macinstosh G5 with Tiger. Can FlashDevelop work on Mac? And can you explain to me what is a IDE? Thanks.
    Don't you ever, ever, EVER call me a Noob. I mean it!

  7. #7
    Nope. FlashDevelop as far as I've ever known only works on windows.

    IDE
    http://en.wikipedia.org/wiki/Integra...nt_environment

    I guess that a problem. I'd say boot into windows if you have it and try it out as it might be easier to develop using FlashDevelop.I definitely recommend it.

  8. #8
    AS3 is really nice. The structure of your code will be more logical and easier to work with compared to AS2. Perhaps more importantly, your flash movies coded in AS3 will run faster than an AS2 equivalent, which can be crucial for certain games. Still, I'd say there's no harm in working with AS2 until you can get your hands on CS3 - AS3 and AS2 are quite similar. Just keep in mind you'll want to make the transition to AS3 eventually, and the sooner, the better off you will probably be.
    you = function(){
    setEnabled( true );
    live();
    setEnabled( false );
    }

  9. #9
    Jephz's Avatar
    106
    posts
    The Penguin n00b
    Quote Originally Posted by therobot View Post
    AS3 is really nice. The structure of your code will be more logical and easier to work with compared to AS2. Perhaps more importantly, your flash movies coded in AS3 will run faster than an AS2 equivalent, which can be crucial for certain games. Still, I'd say there's no harm in working with AS2 until you can get your hands on CS3 - AS3 and AS2 are quite similar. Just keep in mind you'll want to make the transition to AS3 eventually, and the sooner, the better off you will probably be.
    Ok, so lets say I get CS3. I know absolutely ZERO knowledge about AS3. And how will I change my current .fla file to a AS3 Document? Do I have to start over on a new AS3 Document or can I just change the file type from AS2 to AS3? Also, can you give me some good links for basic AS3 tutorials? Thanks.
    Don't you ever, ever, EVER call me a Noob. I mean it!

  10. #10
    You will find this exceptionally helpful for moving onto AS3...

    http://www.kirupa.com/forum/showthread.php?t=223798
    MY BLOG

    I need a SPRITER who can do pixel arts for an arcade fighter project. If you can help out, please pm me.
    I also need someone who can write simple xml files.


  11. #11
    Jephz's Avatar
    106
    posts
    The Penguin n00b
    Quote Originally Posted by bluemagica View Post
    You will find this exceptionally helpful for moving onto AS3...

    http://www.kirupa.com/forum/showthread.php?t=223798
    Thanks, I'll be sure to check it out. Now, does anyway have a answer/tips to my current inventory problem?
    Don't you ever, ever, EVER call me a Noob. I mean it!

  12. #12
    You started alright with your inventory, but then you are going a bit off-track with the duplicating bit. There are many ways of doing an inventory, but i will tell you a simple way. First Make a tweened background for your inventory, like you have done....Now, go inside this , say invBack_mc. And move it in such a way that the origin point of the invBack_mc lies exactly on the top left corner position, from where you want to start placing the slots. Now comes the fun/trick portion. Make a new mc say 32x32 or so, and call it invSlot_mc , and on the first frame draw a empty square to act as the slot on where to place the items.And then on each successive frame put the pictures of your inventory items, sword, potion, whatever. i hope you have got the idea by now, anyway...

    Next just think up how many slots you want in your inventory, 3 columns and 4 rows...
    Code:
    var slot=new Array();
    var pos_x=this._x;
    var pos_y=this._y;
    var gap=5;
    for(var i=0;i<4;i++)
    {
       for(var j=0;j<4;j++)
       {
          slot[i+j]=this.attachMovie("invSlot_mc","slot_"+(i+j),this.getNextHighestDepth());
          slot[i+j]._x=pos_x
          slot[i+j]._y=pos_y
          slot[i+j].gotoAndStop(1);
          slot[i+j].state="free";
          pos_x+=pos_x+gap;
       }
     pos_y+=pos_y+gap;
    }
    Now when you make the item mc's, give them a "item_id" equal to the slot frame number. so on collision
    Code:
    for(var i=0;i<slot.length;i++)
    {
     if(_root.invBack_mc.slot[i].state=="free")
     {
      _root.invBack_mc.slot[i].gotoAndStop(item_id);
      _root.invBack_mc.slot[i].state=="item_id";
     } //remember to remove the mc though;
    }
    This is a very simple way of doing it, if you want to attach actual mc, then just use attachMovie() instead of simple frames.

    There are loads of other ways, and most times each coder has his own ways...try to find a way for yourself too
    MY BLOG

    I need a SPRITER who can do pixel arts for an arcade fighter project. If you can help out, please pm me.
    I also need someone who can write simple xml files.


  13. #13
    Jephz's Avatar
    106
    posts
    The Penguin n00b
    Quote Originally Posted by bluemagica View Post
    You started alright with your inventory, but then you are going a bit off-track with the duplicating bit. There are many ways of doing an inventory, but i will tell you a simple way. First Make a tweened background for your inventory, like you have done....Now, go inside this , say invBack_mc. And move it in such a way that the origin point of the invBack_mc lies exactly on the top left corner position, from where you want to start placing the slots. Now comes the fun/trick portion. Make a new mc say 32x32 or so, and call it invSlot_mc , and on the first frame draw a empty square to act as the slot on where to place the items.And then on each successive frame put the pictures of your inventory items, sword, potion, whatever. i hope you have got the idea by now, anyway...

    Next just think up how many slots you want in your inventory, 3 columns and 4 rows...
    Code:
    var slot=new Array();
    var pos_x=this._x;
    var pos_y=this._y;
    var gap=5;
    for(var i=0;i<4;i++)
    {
       for(var j=0;j<4;j++)
       {
          slot[i+j]=this.attachMovie("invSlot_mc","slot_"+(i+j),this.getNextHighestDepth());
          slot[i+j]._x=pos_x
          slot[i+j]._y=pos_y
          slot[i+j].gotoAndStop(1);
          slot[i+j].state="free";
          pos_x+=pos_x+gap;
       }
     pos_y+=pos_y+gap;
    }
    Now when you make the item mc's, give them a "item_id" equal to the slot frame number. so on collision
    Code:
    for(var i=0;i<slot.length;i++)
    {
     if(_root.invBack_mc.slot[i].state=="free")
     {
      _root.invBack_mc.slot[i].gotoAndStop(item_id);
      _root.invBack_mc.slot[i].state=="item_id";
     } //remember to remove the mc though;
    }
    This is a very simple way of doing it, if you want to attach actual mc, then just use attachMovie() instead of simple frames.

    There are loads of other ways, and most times each coder has his own ways...try to find a way for yourself too
    Thanks a whole bunch ^^ I figured out a way to dynamically do the sliding animation so thats one thing I don't have to worry about. Now, for the inventory. I dont really want to make a empty frame for each item, since theres going to be a hell lot of items in this game. I just want to create a database with all the items/item id in it(something like a array), then just duplicate a copy from that database whenever a player needs a item. Or I could just assign each item with a id, and create a database full with items idea, then attach a item from the library according to the ID. Is there anyway to do that?

    PS: This is my current code for my inventory, although I have no idea how it works and for some reason, it only works if the slots are not in another symbol.

    On The Frame:

    function addToslot (item) {
    if (!item.found) {
    item._x = eval ("itemSlot" + currentslotnum)._x;
    item._y = eval ("itemSlot" + currentslotnum)._y;
    item.found = true;
    currentslotnum++;
    }
    }


    On The Items:


    onClipEvent (enterFrame) {
    if (_root.player.hitTest (this)) {
    _root.addToslot (this);

    }
    }
    Last edited by Jephz; May 13th, 2008 at 02:12 AM.
    Don't you ever, ever, EVER call me a Noob. I mean it!

  14. #14
    -_- you didnt understand what i said, did you? I am not telling to make a empty frame for each item, rather i am telling you to put the images of all items under one mc.
    MY BLOG

    I need a SPRITER who can do pixel arts for an arcade fighter project. If you can help out, please pm me.
    I also need someone who can write simple xml files.


  15. #15
    Jephz's Avatar
    106
    posts
    The Penguin n00b
    Quote Originally Posted by bluemagica View Post
    -_- you didnt understand what i said, did you? I am not telling to make a empty frame for each item, rather i am telling you to put the images of all items under one mc.
    Still don't get what you mean -_- I know I really suck at ActionScript but I just don't get your code and what you're trying to explain.
    Don't you ever, ever, EVER call me a Noob. I mean it!

Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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

Home About kirupa.com Meet the Moderators Advertise

 Link to Us

 Credits

Copyright 1999 - 2012