Eclipse - Free 2D Mmorpg Maker
September 02, 2010, 10:32:39 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
 
   Home   Shop Arcade chat Login Register  
 
 
   
 
collapse

* No Spam Or Websites

Refresh History
  • Ertzel: So... Anyone with basic/none/limited photoshop or even paint skills want to make some money converting sprites for me?
    Today at 10:07:35 PM
  • Gamma™: weaver why are you oflfine on H&H? :S
    Today at 10:04:26 PM
  • Ertzel: Ya, only one try per knife, my one try failed :(
    Today at 10:00:17 PM
  • LegendWeaver: is it one use?
    Today at 09:43:15 PM
  • Ertzel: Wish I didnt spend my 1k+ credits to buy the stupid knife that failed at stealing Robins credits >.<
    Today at 09:42:42 PM
  • Wraith: ) Kreator!
    Today at 09:06:52 PM
  • Wraith: yes! you were! (in red text
    Today at 09:06:46 PM
  • ToshiroHayate: Kreator!
    Today at 08:25:02 PM
  • Kreator: o_0 Was I supposed to Wraith?
    Today at 08:16:02 PM
  • [Pie] ICT: Don't worry.. I commented.
    Today at 07:55:08 PM
  • Wraith: Ay, kreator, wtf is up with you not posting anything about my new cliffs??
    Today at 07:50:36 PM

* Recent Topics

[EO] Attaching Problem. by 314piwm
[Today at 10:21:04 PM]


Project Vertigo [2d Tile-based Side-Scrolling Engine] by Miguu
[Today at 10:03:22 PM]


Zacaras Empire (Hiring) by Ertzel
[Today at 08:43:54 PM]


custom cliff tiles by ToshiroHayate
[Today at 08:29:15 PM]


.: RPG Kingdom :. by LegendWeaver
[Today at 08:25:20 PM]


What do you think? by [Pie] ICT
[Today at 07:54:54 PM]


[Show Off] Aztec Stuff by [Pie] ICT
[Today at 07:50:07 PM]


So I herd you liek mudkipz by Kreator
[Today at 07:36:52 PM]


Haven and Hearth: Epic Screenshot Thread by Tompwnage™
[Today at 07:14:21 PM]


The Lonliest Star [RP] by DDunit
[Today at 07:09:46 PM]


* Who's Online


Pages: [1] 2 3 ... 5
Site Author : Topic: True 3-Frame Movement  (Read 4267 times)
0 Members and 1 Guest are viewing this topic.
August 21, 2008, 04:58:06 PM
Member
**
User No : 8049
Posts: 37
  • 0 credits
  • View Inventory
  • Send Money To Electrokinesis
    • View Profile
    I saw MrMiguu's and found it kinda choppy looking. (maybe I'm just REALLY picky)
    Anyway, after talking to Robin about his code for his engine, he willingly gave it to me.
    Soon finding that it was horrible in Eclipse but looked nice on his game, I proceeded to edit his code for about 10-20 minutes until I came out with this tutorial.
    (Also, on the off chance that anyone is using ED3... I have [after about an hour] edited it to work for that engine as well.)
    _______________________________________ _________

    Credit:
    Robin (original code)
    Electrokinesis (Eclipse 2.7[MIGHT work on others... untested] and ED3 edit)
    _______________________________________ _________

    Alright. It's quite a few areas to update.
    Source required, of course.
    (NOTE: If you find any problems or my instructions not clear enough then tell me and I'll try to get pictures to this process. Or better examples...)

    First, under 'BltPlayer' in modGameLogic find where it says 'check for animation and change everything between that and the next set of green text to this:

    Code: [Select]
    ' Check for animation
        Anim = 1
      If Player(Index).Attacking = 0 Then
        Select Case GetPlayerDir(Index)
          Case DIR_UP
            If (Player(Index).yOffset > 8) Then Anim = Player(Index).Step
          Case DIR_DOWN
            If (Player(Index).yOffset < -8) Then Anim = Player(Index).Step
          Case DIR_LEFT
            If (Player(Index).xOffset > 8) Then Anim = Player(Index).Step
          Case DIR_RIGHT
            If (Player(Index).xOffset < -8) Then Anim = Player(Index).Step
        End Select
      Else
        If Player(Index).AttackTimer + 1000 > GetTickCount Then
          Anim = 2
        End If
      End If

    Use the same code and same process under 'BltPlayerTop'.
    ______________________
    Next find 'Sub processmovement' and replace the entire code (in between the lines) with this:
    Code: [Select]
    Sub ProcessMovement(ByVal Index As Long)

      ' Check if player is walking, and if so process moving them over
      If Player(Index).Moving = MOVING_WALKING Then
        Select Case GetPlayerDir(Index)
          Case DIR_UP
            Player(Index).YOffset = Player(Index).YOffset - WALK_SPEED
          Case DIR_DOWN
            Player(Index).YOffset = Player(Index).YOffset + WALK_SPEED
          Case DIR_LEFT
            Player(Index).XOffset = Player(Index).XOffset - WALK_SPEED
          Case DIR_RIGHT
            Player(Index).XOffset = Player(Index).XOffset + WALK_SPEED
        End Select
     
        ' Check if completed walking over to the next tile
        If Player(Index).Dir = DIR_RIGHT Or Player(Index).Dir = DIR_DOWN Then
          If (Player(Index).XOffset >= 0) And (Player(Index).YOffset >= 0) Then
            Player(Index).Moving = 0
            If Player(Index).Step = 0 Then
              Player(Index).Step = 2
            Else
              Player(Index).Step = 0
            End If
          End If
        Else
          If (Player(Index).XOffset <= 0) And (Player(Index).YOffset <= 0) Then
            Player(Index).Moving = 0
            If Player(Index).Step = 0 Then
              Player(Index).Step = 2
            Else
              Player(Index).Step = 0
            End If
          End If
        End If
      End If

      ' Check if player is running, and if so process moving them over
      If Player(Index).Moving = MOVING_RUNNING Then
        Select Case GetPlayerDir(Index)
          Case DIR_UP
            Player(Index).YOffset = Player(Index).YOffset - RUN_SPEED
          Case DIR_DOWN
            Player(Index).YOffset = Player(Index).YOffset + RUN_SPEED
          Case DIR_LEFT
            Player(Index).XOffset = Player(Index).XOffset - RUN_SPEED
          Case DIR_RIGHT
            Player(Index).XOffset = Player(Index).XOffset + RUN_SPEED
        End Select
     
        ' Check if completed walking over to the next tile
        If Player(Index).Dir = DIR_RIGHT Or Player(Index).Dir = DIR_DOWN Then
          If (Player(Index).XOffset >= 0) And (Player(Index).YOffset >= 0) Then
            Player(Index).Moving = 0
            If Player(Index).Step = 0 Then
              Player(Index).Step = 2
            Else
              Player(Index).Step = 0
            End If
          End If
        Else
          If (Player(Index).XOffset <= 0) And (Player(Index).YOffset <= 0) Then
            Player(Index).Moving = 0
            If Player(Index).Step = 0 Then
              Player(Index).Step = 2
            Else
              Player(Index).Step = 0
            End If
          End If
        End If
      End If
     
      Select Case GetPlayerDir(Index)
        Case DIR_UP
          If Player(Index).YOffset <= 0 Then
            Player(Index).YOffset = 0
          End If
        Case DIR_DOWN
          If Player(Index).YOffset >= 0 Then
            Player(Index).YOffset = 0
          End If
        Case DIR_LEFT
          If Player(Index).XOffset <= 0 Then
            Player(Index).XOffset = 0
          End If
        Case DIR_RIGHT
          If Player(Index).XOffset >= 0 Then
            Player(Index).XOffset = 0
          End If
      End Select
    End Sub
    _________________
    Finally, in modType find 'PlayerRec' and add this after "Party As PartyRec":
    Code: [Select]
    Step As Byte
    Logged

    Skills:
    Techno artist - Website, Myspace
    Programming (html, js, css, vb6, tibasic, sadscript, others I don't remember right now...)
    August 23, 2008, 12:00:45 AM
    Contest Winner
    Advanced Eclipser
    *
    User No : 1532
    Posts: 1483
  • 272 credits
  • View Inventory
  • Send Money To l0lz!
    • View Profile
    Does this just add a fourth frame? Or does it replace the attack animation?
    Logged

    August 23, 2008, 12:11:53 AM
    Member
    **
    User No : 8049
    Posts: 37
  • 0 credits
  • View Inventory
  • Send Money To Electrokinesis
    • View Profile
    Current frame movement is: 1,2,...
    After code it's: 1,2,3,2,...

    Basically, they move as intended.
    I'll have a movie example sometime later today. (24th)
    Logged

    Skills:
    Techno artist - Website, Myspace
    Programming (html, js, css, vb6, tibasic, sadscript, others I don't remember right now...)
    August 23, 2008, 10:37:20 AM
    Veteran
    Teh Uberleet
    *
    User No : 259
    Posts: 2208
  • 50 credits
  • View Inventory
  • Send Money To Xeross
  • Location : Oosterhout, Noord-brabant, The Netherlands
    • View Profile
    • WWW
    Current frame movement is: 1,2,...
    After code it's: 1,2,3,2,...

    Basically, they move as intended.
    I'll have a movie example sometime later today. (24th)

    So that means that we don't have a seperate attack frame, hmm well didn't use it anyways.
    And does this work with paperdoll ?
    Logged

    August 23, 2008, 10:47:04 AM
    Contest Winner
    Advanced Eclipser
    *
    User No : 1532
    Posts: 1483
  • 272 credits
  • View Inventory
  • Send Money To l0lz!
    • View Profile
    Yeah I was wondering that too lol.
    Logged

    August 23, 2008, 10:49:36 AM
    Member
    **
    User No : 8049
    Posts: 37
  • 0 credits
  • View Inventory
  • Send Money To Electrokinesis
    • View Profile
    The attack frame is the same as before and yes, it works with paperdoll.
    Just keep the sprites in the same order as usual.

    I've tested it normal, paperdoll, and custom.
    It's flawless.

    EDIT: preview (recorder lagged a tiny bit)
    Just sprite #2 from the original.
    « Last Edit: August 23, 2008, 10:59:38 AM by Electrokinesis » Logged

    Skills:
    Techno artist - Website, Myspace
    Programming (html, js, css, vb6, tibasic, sadscript, others I don't remember right now...)
    August 23, 2008, 11:01:44 AM
    Zombologist
    Demi God
    User No : 6258
    Posts: 4609
  • 408 credits
  • View Inventory
  • Send Money To Zоmbie
    • View Profile
    • WWW
    That looks really cool.
    Logged

    August 23, 2008, 11:06:55 AM
    Advanced Eclipser
    *****
    User No : 4099
    Posts: 1474
  • 0 credits
  • View Inventory
  • Send Money To Bobbus
    • View Profile
    Cool stuff, dude. :)
    Logged

    August 23, 2008, 11:09:55 AM
    Member
    **
    User No : 8049
    Posts: 37
  • 0 credits
  • View Inventory
  • Send Money To Electrokinesis
    • View Profile
    Funny.
    I don't get many replies in a row until I post a gif. =P
    Thanks guys. :)
    Logged

    Skills:
    Techno artist - Website, Myspace
    Programming (html, js, css, vb6, tibasic, sadscript, others I don't remember right now...)
    August 23, 2008, 12:02:23 PM
    Veteran
    Teh Uberleet
    *
    User No : 259
    Posts: 2208
  • 50 credits
  • View Inventory
  • Send Money To Xeross
  • Location : Oosterhout, Noord-brabant, The Netherlands
    • View Profile
    • WWW
    Wow ima use it, would it be possible to add another frame for the attack
    Logged

    August 23, 2008, 12:08:11 PM
    Member
    **
    User No : 8049
    Posts: 37
  • 0 credits
  • View Inventory
  • Send Money To Electrokinesis
    • View Profile
    I suppose.
    I'll look into it.
    I'm dead tired right now, but I'll see what I can do.
    (don't expect it soon, but I've surprised myself before)

    EDIT: Wait...
    What EXACTLY do you mean by adding another frame for the attack?
    « Last Edit: August 23, 2008, 12:10:54 PM by Electrokinesis » Logged

    Skills:
    Techno artist - Website, Myspace
    Programming (html, js, css, vb6, tibasic, sadscript, others I don't remember right now...)
    August 23, 2008, 12:15:36 PM
    Veteran
    Teh Uberleet
    *
    User No : 259
    Posts: 2208
  • 50 credits
  • View Inventory
  • Send Money To Xeross
  • Location : Oosterhout, Noord-brabant, The Netherlands
    • View Profile
    • WWW
    Left Leg | Stand | Right Leg | Attack
    Logged

    August 23, 2008, 12:17:10 PM
    Member
    **
    User No : 8049
    Posts: 37
  • 0 credits
  • View Inventory
  • Send Money To Electrokinesis
    • View Profile
    Ah.
    Gotcha.
    If you'd want to remake all your spritesheets like that, then sure, I'll work on it.
    If you already have one... I'd like you to PM it to me so I can properly test it as I work.
    Logged

    Skills:
    Techno artist - Website, Myspace
    Programming (html, js, css, vb6, tibasic, sadscript, others I don't remember right now...)
    August 23, 2008, 12:19:53 PM
    Veteran
    Teh Uberleet
    *
    User No : 259
    Posts: 2208
  • 50 credits
  • View Inventory
  • Send Money To Xeross
  • Location : Oosterhout, Noord-brabant, The Netherlands
    • View Profile
    • WWW
    I can easily change the eclipse sprite sheet in like 5 minutes for that
    Logged

    August 23, 2008, 07:57:25 PM
    Contest Winner
    Advanced Eclipser
    *
    User No : 1532
    Posts: 1483
  • 272 credits
  • View Inventory
  • Send Money To l0lz!
    • View Profile
    This is really awesome, I tried it out, and it's flawless like you said. Thanks to Robin and You, my people don't have to look crippled, yay!
    Logged

    August 23, 2008, 11:04:37 PM
    Member
    **
    User No : 8049
    Posts: 37
  • 0 credits
  • View Inventory
  • Send Money To Electrokinesis
    • View Profile
    No problem. =D
    Glad you like it.
    I'm sure Robin'll be glad too.
    Or... just throw in a sarcastic and/or witty comment.
    ...
    Whichever.
    Logged

    Skills:
    Techno artist - Website, Myspace
    Programming (html, js, css, vb6, tibasic, sadscript, others I don't remember right now...)
    August 24, 2008, 11:06:34 AM
    Veteran
    Teh Uberleet
    *
    User No : 259
    Posts: 2208
  • 50 credits
  • View Inventory
  • Send Money To Xeross
  • Location : Oosterhout, Noord-brabant, The Netherlands
    • View Profile
    • WWW
    How can I edit it so that it has a seperate attack frame ?
    my sprites.bmp is now
    RIGHT | STAND | LEFT | ATTACK
    « Last Edit: August 24, 2008, 11:10:08 AM by Xeross » Logged

    August 24, 2008, 11:41:17 AM
    Member
    **
    User No : 8049
    Posts: 37
  • 0 credits
  • View Inventory
  • Send Money To Electrokinesis
    • View Profile
    Can you PM me one of the sprites (in all positions) so I can work on this?
    I never got around to coding that version because I wouldn't have been able to test it.
    Logged

    Skills:
    Techno artist - Website, Myspace
    Programming (html, js, css, vb6, tibasic, sadscript, others I don't remember right now...)
    September 02, 2008, 02:09:35 PM
    Newb
    *
    User No : 7963
    Posts: 14
  • 0 credits
  • View Inventory
  • Send Money To PlatefieldLord
    • View Profile
    This is awesome, and it works all the way back to TE.
    Logged
    September 03, 2008, 12:27:54 PM
    PDO Creator
    Developer
    Advanced Eclipser
    *
    User No : 7858
    Posts: 1612
  • 208 credits
  • View Inventory
  • Send Money To [SB]Damian666
  • Location : Holland
    [SB] Corporal
    • View Profile
    • WWW
    very nice piece of code man, it works like a charm, and is easy to do :d

    thanx alot.

    damian666
    Logged


    Pages: [1] 2 3 ... 5
     


    Powered by MySQL Powered by PHP Powered by SMF 2.0 RC3 | SMF © 2006–2010, Simple Machines LLC
    SimplePortal 2.3.1 © 2008-2009, SimplePortal
    Valid XHTML 1.0! Valid CSS!
    Page created in 0.229 seconds with 29 queries.