A Flash Developer Resource Site

Results 1 to 10 of 10

Thread: Final Fantasy

  1. #1
    x2i GingaNinja's Avatar
    Join Date
    Feb 2004
    Location
    England
    Posts
    217

    Final Fantasy

    I'm looking for someone to help me as I am trying to create a Final Fantasy style battle game using the Active Time Battle method.

    I would like to know the following:

    1. When walking around a map, i want to know if it is possible to make a random battle occur when a step is taken. Or perhaps jump to a battle screen like in the FF games.

    2.Is it possible to make a Final Fantasy Style Inventory where you have slots for each item and you only have a limited amount of each.

    3. Is there a way I can save and load information like:
    -- Which frame(section of the map) the game was saved at.
    -- Details such as Health Points(HP), Magic Points(MP), Items etc.
    So that the user can save and load games whenever they like.

    If anyone can help me in any of these topics or can give me some information that i might find useful, i would appreciate it a hell of a lot.


    Thanx

    Dan

  2. #2
    ....he's amazing!!! lesli_felix's Avatar
    Join Date
    Nov 2000
    Location
    London UK
    Posts
    1,506
    All of those things are possible.

    There's a thread at the top of this forum called "Read me first"

    You should read it before posting...

  3. #3
    x2i GingaNinja's Avatar
    Join Date
    Feb 2004
    Location
    England
    Posts
    217
    Lesli, I'm sorry I didn't notice the READ ME FIRST bit, it wasn't noticable instantly due to the amount of threads.

    If you or anyone else can help me then please let me know.

    PS: I did read the READ ME FIRST and

    A) I don't know which bit you were specifying.
    B) If it is the "Don't Ask for Loads Of Coding To Be Done For You" bit, I was asking if anyone knew how to do any of the three not all.

  4. #4
    Innovation = Cool Tyg's Avatar
    Join Date
    Feb 2003
    Posts
    339
    lots of arrays
    use a shared object for saving inventory status

    i would start with a monster array
    monster = ["m1","m2","m3","m4","m5","m6","m7,"m8"];

    then your area (determined by the position on your map) 0..?
    say you wanted to select from 4 monsters but 1 would be in both areas
    monsters to select from would be slice(area*3,area*3+4)
    so if area was 1 your array would be ["m4","m5","m6","m7"]
    a random(3) would pick one of theese
    HDengine
    SwirlJong

  5. #5
    Senior Member
    Join Date
    Aug 2002
    Posts
    349
    1)
    when a step is taken, you can have a function that is ran each time that will check if a monster appears. example, chanceappear =Math.random() or whatever the proper code is, and if chanceappear >.75 (so 25% chance) a monster appears and then goto and stop the movie to your battle movie.

    2)yes, possibilities, are to have and array for your inventory, if the size of items at or greater than a certain number of items, then they cannot pick something up. You can later check item size and such to see how much room is left, but just make it simple to start if you do not know what to do

    3)You can do it as a cookie to the browser, or in your database on a website.

    AS for people saying check the readme post, I have never looked at it, and dont intend to =p
    Free Flash Multiplayer Gaming
    http://www.gecko-games.com

  6. #6
    x2i GingaNinja's Avatar
    Join Date
    Feb 2004
    Location
    England
    Posts
    217
    Thanx for your reply however the math.random() function generates a huge number with loads of decimal places, i have tried applying the math.abs like this:

    chanceBattle = Math.abs(Math.random());
    trace(chanceBattle);

    I want it to generate a whole number so i used this instead:

    chanceBattle = random(100)

    This generated a random number between 0 and 100.
    I then checked to see if the number 50 was drawn, if so, go to the battle screen.

    Is thier a way of making youre method generate a whole number, if so, i would like to use it. Thanx

  7. #7
    Member
    Join Date
    Jan 2003
    Location
    Hawthorne
    Posts
    40
    As far as I know random(100) effectively asks Flash to do this: Math.floor(Math.random() * 100) + 1. So by using random(100) you're computing more than Math.random().

    If you want a battle to occur only when a "50" is produced from random(100), it's 1 chance in 100, so it's the same as saying if (Math.random() > 0.99), which is faster although a little more less intuitive.

    I hope this makes sense, and I hope I'm correct in my assumptions.

  8. #8
    Senior Member
    Join Date
    Aug 2002
    Posts
    349
    skellum is correct

    random(##) generates a number from either 0 or 1, to the number entered.

    Math.random generate a number between, 0 and 1, hence the long decimal place.

    so basically as he said

    random(100)=Math.floor(Math.random() * 100) + 1.
    Free Flash Multiplayer Gaming
    http://www.gecko-games.com

  9. #9
    x2i GingaNinja's Avatar
    Join Date
    Feb 2004
    Location
    England
    Posts
    217
    Yes, however although random(##) is deprecated it is a lot quicker to write and it does the same job doesn't it?

  10. #10
    ·»¤«· >flashl!ght<'s Avatar
    Join Date
    Jun 2003
    Posts
    746
    they do the same thing, but no, they are not the same. try this:
    code:
    tests=100;
    iterations=1000;//per test, defines accuracy
    for(t=1 ; t<=tests ; t++){
    t1=getTimer();
    for(i=1 ; i<=iterations ; i++){
    random(n);
    }
    trace((getTimer()-t1)/iterations);

    t2=getTimer();
    for(i=1 ; i<=iterations ; i++){
    Math.random()*n;
    }
    trace((getTimer()-t2)/iterations);
    trace("");
    }



    doing it by Math.random is consistently slower(tho they are both cons. less than .05 millisecond on my PC), as to be expected. anything hard coded in Flash *should* be faster.

    [EDIT] if you take out the *n for the Math.random() you find that Math.random() is *still* about .01 - .05 of a millisecond slower... so i guess always use random()? of course, we are talking about debatably completely inconsequential difference in speed here... .01 of a millisecond????
    Last edited by >flashl!ght<; 09-24-2004 at 06:46 PM.
    >flashl!ght<
    All the normal names were taken.
    Ron Paul was right.

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