Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Weapon: DC Questions
#1
Hi! I'm trying to make another Henry's super arrow. It flies diagonally down.
So what I have done for this are:
  1. Creating a new sprite for this, from the original super arrow sprite, and rotate it diagonally 30 degrees.
  2. Adding a new move to Henry's dat file. On the jump, if the player hits D > J then he will shoot a super arrow. The new move is copied and modified from the air arrow move (shooting arrows when jumping).
  3. Creating a new dat file for the diagonal super arrow. The arrow flies with speed from dvx and dvz.

Now the problem I'm facing is..
I don't know how to make it explode once it hits the ground. When it hits the ground, it seems like it is going under the ground and there is a shadow moving seen.
And the arrow spawned seems like effected by the gravity, while it must not be effected.

How to spawn the explosion similar to Julian's giant ball explosion when it hits the ground, and how to make it unaffected by the gravity?

Thanks in advance!
Reply
Thanks given by:
#2
Hey, welcome to LFE!

As in pretty much any other case, there are different ways to achieve what you wish to go for. Let's start by analyzing the problem first: as you can see in data.txt, there are different types of objects that are numbered from 1 to 6. Giving your object a type will set basic properties as explain in this page. Long story short, Henry's super arrow runs with type 3. A specialty of that is that ground-collision-detection is disabled unless you use hit_Fa: 7. There is a state: 100 which supposedly makes objects go to frame 94 upon hitting the ground but this doesn't work in combination with type 3 (thanks to @STM1993 for confirming that!).

When you look at Henry's normal arrows, you'll see that they exclusively run on type 1. Attached are certain properties, i.e. the on_ground-frames are called when the object hits the floor. Please note that types 0, 1, 2, 4, 6 are affected by gravity. If you really really want to have an object that is not affected by gravity, you'll have to go type 3 and either use some timing-trickery to tell when the object should in theory hit the ground and go from there (super-buggy) or spawn another object that'll interact with the arrow once it hits the ground (bit more advanced, potentially less buggy).

It's up to you whether you can live with a small curve in the arrow trajectory or whether you prefer a straight path with quite a bit more work involved.
Silverthorn / Blue Phoenix
~ Breaking LFE since 2008 ~

"Freeze, you're under vrest!" - Mark, probably.

» Gallery | » Sprites | » DeviantArt
Reply
Thanks given by:
#3
Diagonal Henry D>J eh. There are multiple methods as Silverthorn says, but I'll mention the method I personally used for my repchar.

First of all for this method, you need to make sure in the data.txt, your arrow is a type: 3.
The 1st diagonal frame you'll be making should be something like this:
    DC-Code:
<frame> 50  diagonal_start
   pic: 0  state: 3006  wait: 1  next: 51  dvx: 16  dvy: 566  centerx: 19  centery: 24  hit_a: 500  hit_d: 50  hit_Fa: 3
<frame_end>

The important things are:
  1. dvy: 566
    actually makes the arrow fall a constant speed of 16 downward. So no need to deal with gravity or the problem of accelerating speed if you had used dvy: 16.
  2. hit_Fa: 3
    is important, because it is required before you can use
    hit_Fa: 7
    , which is what allows the ball to hit the ground in the first place.
  3. wait: 1 next: 51 hit_a: 500 hit_d: 50
    all combine to make sure that the diagonal arrow will immediately lose all its hitpoints, so that the arrow will not gain any homing properties, and next into frame 51 properly. If you want the arrow to be slightly homing(or have a tiny bit of auto-aim) you can tweak the hit_a values a bit or ignore this piece of advice.
  4. If you don't want Henry to be able to aim on z-axis on his own, you can use any other state other than 3000 or 3006 on the 1st frame.
  5. When Henry opoints this arrow, make sure to put a positive dvx: in the opoint tag itself, otherwise there's a chance the arrow will shoot backwards if it decides to chase an enemy behind you.
After that you just need to make sure that you have frame 60 used for the hitting_ground frame. You can either make the frame 60 itself become the explosion or opoint an explosion itself, depending on whether you want the arrow to only hit once or do double damage.

The biggest challenge to making this system is really the frame 60, because the exact position of the explosion can be very unfavourable depending on exactly how fast the arrow is moving and from what height Henry shoots the arrow, so you might have to play around with that.
Reply
Thanks given by:
#4
(12-10-2017, 11:39 AM)STM1993 Wrote:  Diagonal Henry D>J eh. There are multiple methods as Silverthorn says, but I'll mention the method I personally used for my repchar.

First of all for this method, you need to make sure in the data.txt, your arrow is a type: 3.
The 1st diagonal frame you'll be making should be something like this:
    DC-Code:
<frame> 50  diagonal_start
   pic: 0  state: 3006  wait: 1  next: 51  dvx: 16  dvy: 566  centerx: 19  centery: 24  hit_a: 500  hit_d: 50  hit_Fa: 3
<frame_end>

The important things are:
  1. dvy: 566
    actually makes the arrow fall a constant speed of 16 downward. So no need to deal with gravity or the problem of accelerating speed if you had used dvy: 16.
  2. hit_Fa: 3
    is important, because it is required before you can use
    hit_Fa: 7
    , which is what allows the ball to hit the ground in the first place.
  3. wait: 1 next: 51 hit_a: 500 hit_d: 50
    all combine to make sure that the diagonal arrow will immediately lose all its hitpoints, so that the arrow will not gain any homing properties, and next into frame 51 properly. If you want the arrow to be slightly homing(or have a tiny bit of auto-aim) you can tweak the hit_a values a bit or ignore this piece of advice.
  4. If you don't want Henry to be able to aim on z-axis on his own, you can use any other state other than 3000 or 3006 on the 1st frame.
  5. When Henry opoints this arrow, make sure to put a positive dvx: in the opoint tag itself, otherwise there's a chance the arrow will shoot backwards if it decides to chase an enemy behind you.
After that you just need to make sure that you have frame 60 used for the hitting_ground frame. You can either make the frame 60 itself become the explosion or opoint an explosion itself, depending on whether you want the arrow to only hit once or do double damage.

The biggest challenge to making this system is really the frame 60, because the exact position of the explosion can be very unfavourable depending on exactly how fast the arrow is moving and from what height Henry shoots the arrow, so you might have to play around with that.

I see.. It is much more complicated than I thought. I'll try that. Do the frame numbers determine what happens? I mean, they are not just numbers?
Reply
Thanks given by:
#5
(12-12-2017, 05:10 PM)seikosantana Wrote:  Do the frame numbers determine what happens? I mean, they are not just numbers?
Some of the frame numbers are hardcoded to do certain things.

For example, punching without a weapon always randomly picks frame 60 or 65 unless the character is been touched by an itr kind 6, where he'll go to frame 70 superpunch instead. With a light weapon it always randomly picks 20 or 25 regardless. Frame 200 always create ice regardless of type for some reason.

For your hit_Fa 7 state 3006 super arrow, you'll need to take special note of frames 20, 30 & 60. Also noteworthy are 10 & 40 to ensure there are no bugs.

You can see the hardcoded frame numbers for type 3 here.
Reply
Thanks given by:
#6
Is it possible to add a few BGMs into the game? I've been reading some threads but I don't see any solutions..

Thanks in advance!
But why is the frame 50 used for that? In the link, it is written that it is used as flying frame in curves..
Hi! I am trying to add a character from another game. I have the sprite sheet but the sheet dimensions and rows and columns are different compared to LF2 sprites. What I am doing is migrating, by copying the images one by one from the sprite sheet into Davis sprite sheet. I use Photoshop CS3. I found that it is difficult to move it into the correct positions. I have seen that there are mods which sprites are from another games too, and it is done nicely.

Is there an easy way to migrate a sheet into LF2 sheet?

Thanks in advance!
Hi, I'm trying to make a character. I see that Davis has three running frames. Can I have four frames for running state for my character? Thanks!
Reply
Thanks given by:
#7
Please try to keep your questions in one thread.
seikosantana Wrote:Is it possible to add a few BGMs into the game? I've been reading some threads but I don't see any solutions..
If you're using LF2 2.0 or 2.0a exe, the game has its own bgm.
Just put your music in the bgm folder, and put "music: bgm\nameofmusic.wma" in your stage.dat
If you're trying to add new music that you can select in menu outside of stage mode, then there's no way to do it without some very difficult exe HEX editting or downloading some custom exes/dlls people have already made.

seikosantana Wrote:But why is the frame 50 used for that? In the link, it is written that it is used as flying frame in curves..
50 in my example is just a frame I used out of convenience.
The page says 50 is special yes, but only if you use hit_Fa: 14 to give it Julian skull homing property. If you're not using the special property you don't have to worry about using special frames.

seikosantana Wrote:Hi! I am trying to add a character from another game. I have the sprite sheet but the sheet dimensions and rows and columns are different compared to LF2 sprites. What I am doing is migrating, by copying the images one by one from the sprite sheet into Davis sprite sheet. I use Photoshop CS3. I found that it is difficult to move it into the correct positions. I have seen that there are mods which sprites are from another games too, and it is done nicely.

Is there an easy way to migrate a sheet into LF2 sheet?
Someone made a program for it recently. Try/figure it out and see it the program is suitable for you.

As for the DC side of making sprites, what you need to know to make the correct grid dimensions, as an example from Julian's data:
file(50-63): sprite\sys\julian_1.bmp  w: 109  h: 99

[Image: unknown.png]

seikosantana Wrote:Can I have four frames for running state for my character?
Nope, LF2 running is hardcoded.
Unless you're willing to make a completely custom running system which will never be anywhere as nice as the original 3-frame running.
Reply
Thanks given by:
#8
Oops! I'm sure that I was starting new threads, but why every questions came here? Did I make mistakes?

STM1993 edited this post 12-14-2017 05:50 AM because:
Largely because you have many general DC questions in a short period of time. Its much easier to reply if all the questions are in the same thread at once, and it won't flood the "new messages" notices at the top of the forum.
Reply
Thanks given by:
#9
I see..
Another question.
I made another ball for my new character, and I encounter a problem. The ball is type 3, state with state 3006, similar to Henry's arrow. So when it collides with Julian's bomb or Henry's arrow or John's biscuit, it disappeared without going to rebound frames which looks like dissolves and gone. And it leaves a shadow on the ground even the ball was destroyed. And when the ball collides with John's shield, it passes the shield and plays the rebound animations. But it hits teammates.

Here's the piece of code in dat file.
Code:
<bmp_begin>
   file(0-7): sprite\sys\kunio_ball.bmp w: 81 h: 46 row: 4 col: 2  
weapon_hit_sound: data\020.wav
weapon_drop_sound: data\020.wav
weapon_broken_sound: data\020.wav
<bmp_end>

<frame> 0 flying
   pic: 0  state: 3006  wait: 1  next: 1  dvx: 16  dvy: 0  centerx: 45  centery: 26  hit_a: 0  hit_d: 0  hit_j: 0
   itr:
      kind: 0 x: 23 y: 12 w: 49 h: 24  dvx: 23 fall: 70  vrest: 15  bdefend: 60  injury: 50  effect: 0
   itr_end:
   bdy:
      kind: 0  x: 23  y: 12  w: 48  h: 24
   bdy_end:
<frame_end>

<frame> 1 flying
   pic: 1  state: 3006  wait: 1  next: 2  dvx: 16  dvy: 0  centerx: 46  centery: 27  hit_a: 0  hit_d: 0  hit_j: 0
   itr:
      kind: 0 x: 34 y: 12 w: 38 h: 24  dvx: 23 fall: 70  vrest: 15  bdefend: 60  injury: 50  effect: 0
   itr_end:
   bdy:
      kind: 0  x: 34  y: 12  w: 38  h: 24
   bdy_end:
   <frame_end>

<frame> 2 flying
   pic: 2  state: 3006  wait: 1  next: 3  dvx: 16  dvy: 0  centerx: 49  centery: 27  hit_a: 0  hit_d: 0  hit_j: 0
   itr:
      kind: 0 x: 36 y: 12 w: 39 h: 24  dvx: 23 fall: 70  vrest: 15  bdefend: 60  injury: 50  effect: 0
   itr_end:
   bdy:
      kind: 0  x: 36  y: 12  w: 39  h: 24
   bdy_end:
   <frame_end>

<frame> 3 flying
   pic: 3  state: 3006  wait: 1  next: 4  dvx: 16  dvy: 0  centerx: 49  centery: 27  hit_a: 0  hit_d: 0  hit_j: 0
   itr:
      kind: 0 x: 38 y: 12 w: 37 h: 24  dvx: 23 fall: 70  vrest: 15  bdefend: 60  injury: 50  effect: 0
   itr_end:
   bdy:
      kind: 0  x: 39  y: 12  w: 36  h: 24
   bdy_end:
   <frame_end>

<frame> 4 flying
   pic: 1  state: 3006  wait: 1  next: 5  dvx: 16  dvy: 0  centerx: 49  centery: 27  hit_a: 0  hit_d: 0  hit_j: 0
   itr:
      kind: 0 x: 29 y: 12 w: 49 h: 24  dvx: 23 fall: 70  vrest: 15  bdefend: 60  injury: 50  effect: 0
   itr_end:
   bdy:
      kind: 0  x: 39  y: 12  w: 36  h: 24
   bdy_end:
   <frame_end>

<frame> 5 flying
   pic: 2  state: 3006  wait: 1  next: 999  dvx: 16  dvy: 0  centerx: 49  centery: 27  hit_a: 0  hit_d: 0  hit_j: 0
   itr:
      kind: 0 x: 25 y: 12 w: 25 h: 24  dvx: 23 fall: 70  vrest: 15  bdefend: 60  injury: 50  effect: 0
   itr_end:
   bdy:
      kind: 0  x: 39  y: 12  w: 36  h: 24
   bdy_end:
<frame_end>

<frame> 10 hiting
   pic: 2  state: 3001  wait: 1  next: 11  dvx: 0  dvy: 0  centerx: 49  centery: 27  hit_a: 0  hit_d: 0  hit_j: 0
<frame_end>

<frame> 11 hiting
   pic: 1  state: 3001  wait: 1  next: 12  dvx: 0  dvy: 0  centerx: 49  centery: 27  hit_a: 0  hit_d: 0  hit_j: 0
<frame_end>

<frame> 12 hiting
   pic: 2  state: 3001  wait: 1  next: 13  dvx: 0  dvy: 0  centerx: 49  centery: 27  hit_a: 0  hit_d: 0  hit_j: 0
<frame_end>

<frame> 13 hiting
   pic: 1  state: 3001  wait: 1  next: 1000  dvx: 0  dvy: 0  centerx: 49  centery: 27  hit_a: 0  hit_d: 0  hit_j: 0
<frame_end>

<frame> 20 hit
   pic: 2  state: 3002  wait: 1  next: 110  dvx: 0  dvy: 0  centerx: 49  centery: 27  hit_a: 0  hit_d: 0  hit_j: 0
<frame_end>

<frame> 21 hit
   pic: 1  state: 3002  wait: 1  next: 22  dvx: 0  dvy: 0  centerx: 49  centery: 27  hit_a: 0  hit_d: 0  hit_j: 0
<frame_end>

<frame> 22 hit
   pic: 2  state: 3002  wait: 1  next: 23  dvx: 0  dvy: 0  centerx: 49  centery: 27  hit_a: 0  hit_d: 0  hit_j: 0
<frame_end>

<frame> 23 hit
   pic: 1  state: 3002  wait: 1  next: 1000  dvx: 0  dvy: 0  centerx: 49  centery: 27  hit_a: 0  hit_d: 0  hit_j: 0
<frame_end>

<frame> 30 rebounding
   pic: 4  state: 3003  wait: 1  next: 31  dvx: 0  dvy: 0  centerx: 42  centery: 27  hit_a: 0  hit_d: 0  hit_j: 0
<frame_end>

<frame> 31 rebounding
   pic: 5  state: 3003  wait: 1  next: 32  dvx: 0  dvy: 0  centerx: 38  centery: 27  hit_a: 0  hit_d: 0  hit_j: 0
<frame_end>

<frame> 32 rebounding
   pic: 6  state: 3003  wait: 1  next: 999  dvx: 0  dvy: 0  centerx: 21  centery: 29  hit_a: 0  hit_d: 0  hit_j: 0
<frame_end>

????›

How do I fix it? Thanks in advance!
Reply
Thanks given by:
#10
Of course it "passes through" john's shield, but it properly goes to f30 when it hits the shield. When object goes to f30, you can see in f32 it has next: 999, which means it returns to f0 soon after.

It momentarily halts x-axis movement in f30-32 but resumes moving forward when it goes back to f0, but it changes sides when it hits john's shield.

Also your f20 has an invalid next value. It should go to f21 and proceed to play dispersing animation.
Reply
Thanks given by: seikosantana




Users browsing this thread: 1 Guest(s)