Jump to content

Photo

Checking lweapon hitbox with flip variables?


  • Please log in to reply
9 replies to this topic

#1 Shadowblitz16

Shadowblitz16

    Illustrious

  • Members

Posted 12 January 2017 - 11:20 PM

does anybody know how to rotate and flip a lweapon's hitbox?

 

something like "sword_hitbox(int x, int y, int hit_x, int hit_y, int hit_w, int hit_h, int flip)"?


Edited by Shadowblitz16, 12 January 2017 - 11:21 PM.


#2 ywkls

ywkls

    Master

  • Members

Posted 12 January 2017 - 11:52 PM

does anybody know how to rotate and flip a lweapon's hitbox?

 

something like "sword_hitbox(int x, int y, int hit_x, int hit_y, int hit_w, int hit_h, int flip)"?

It's complicated. And some things (like swords) can't be messed around with easily via script.

 

In fact, oddly shaped (i. e., not square) hitboxes are even harder to do.

 

I've written a series of functions for messing around with lweapons that do let you fiddle with these things; which should allow you a certain amount of freedom in this regard.

 

You'll find those here.

 

Another useful header that can do this is stdWeapons, which I believe you've already been trying to use. It does do rotating, oddly shaped lweapons but I'm not sure how they work.

 

The specific code I use for larger lweapons is this.

 

Large Lweapon Code

 

There's a lot more that you'll need to run this, but that should get you started in the right direction.



#3 Shadowblitz16

Shadowblitz16

    Illustrious

  • Members

Posted 13 January 2017 - 01:42 PM

thankyou

the only thing I would use stdWeapons for is the defences and hitboxes everything else would be manual

 

Edit: @ywkls is it possible to support throwable weapons that bounce when they hit the ground like GB bombs and separate sword beams from their particles?


Edited by Shadowblitz16, 13 January 2017 - 01:53 PM.


#4 ywkls

ywkls

    Master

  • Members

Posted 13 January 2017 - 02:12 PM

thankyou

the only thing I would use stdWeapons for is the defences and hitboxes everything else would be manual

 

Edit: @ywkls is it possible to support throwable weapons that bounce when they hit the ground like GB bombs and separate sword beams from their particles?

 

I haven't added bouncing yet (because I didn't have an application for it), but doing so should be easy enough.

 

I'm not sure what you mean by the second part, though. Right now, my set up for having sword beams create shards it a bit complex. But I can give an example.

 

Wave Sword Beam

 

This is one of the scripts in that package I linked you to. I should note that it doesn't currently support showing the sword's graphics while swinging it for reasons I'm not sure of, but that is something which I intend to add in the future.



#5 Shadowblitz16

Shadowblitz16

    Illustrious

  • Members

Posted 13 January 2017 - 02:36 PM

sorry I mean sword beams that doesn't spawn particles like in the gameboy games

 

also when you add the feature to draw the sword can you allow collisions for it?

in the gameboy game links sword is able to be collided with when it was charging



#6 ywkls

ywkls

    Master

  • Members

Posted 13 January 2017 - 04:37 PM

sorry I mean sword beams that doesn't spawn particles like in the gameboy games

 

also when you add the feature to draw the sword can you allow collisions for it?

in the gameboy game links sword is able to be collided with when it was charging

 

You mean a trail of sparkles that follows it? I don't remember any sword beam doing that, but I could probably figure out a way how.

 

Naturally, whenever the sword is made; it'll have collision. When that will be is anyone's guess, though; considering how hard swords are to script.



#7 Shadowblitz16

Shadowblitz16

    Illustrious

  • Members

Posted 13 January 2017 - 05:01 PM

no I mean I want to be able to create a sword beam that doesn't split into shards when it hits a enemy or the edge of the screen



#8 ywkls

ywkls

    Master

  • Members

Posted 13 January 2017 - 05:30 PM

no I mean I want to be able to create a sword beam that doesn't split into shards when it hits a enemy or the edge of the screen

 

The only thing I know that you might try is making the sprite for the beam shards invisible. (They're usually the tile after the beam sprite itself.)

 

In my script, whenever I wrote it; I had to force the creation of beam shards. However, since then; they've been cropping up whether I wanted them to or not.

 

I also added support for bouncing lweapons to my header.



#9 Shadowblitz16

Shadowblitz16

    Illustrious

  • Members

Posted 13 January 2017 - 09:52 PM

how hard would it be to rewrite the sword beam script?

also thankyou

 

also here is a cool suggestion

is it possible to allow custom explosions?

it would collide like a normal with a possibility of the obeying explosion defences explosion but it would be able to have a custom animation and hitbox

this could be a alternative to built in loz explosions

 

oh I also see that your planing on supporting pickupable weapons? aka "LMM_CARRY"

are you going to have a pickup script form this?

if so you could allow a middle frame where right before the item goes from on the ground to over links head you can position the item in the middle of the two transition for the left and right directions

this was a thing I noticed in the gameboy games 


Edited by Shadowblitz16, 14 January 2017 - 12:10 AM.


#10 ywkls

ywkls

    Master

  • Members

Posted 15 January 2017 - 08:04 PM

how hard would it be to rewrite the sword beam script?

also thankyou

 

You mean, without beam shards? Sure, but I've since learned that beam shards are actually an inherent property of the sprite and as long as the tile which normally creates them isn't blank; they'll exist. I don't know at present how to prevent that except by using another type of Lweapon.

 

The sword beam script, without beam shards.

Wave Sword Beam

 

also here is a cool suggestion

is it possible to allow custom explosions?

it would collide like a normal with a possibility of the obeying explosion defences explosion but it would be able to have a custom animation and hitbox

this could be a alternative to built in loz explosions

 

 

The LW_BOMBBLAST and LW_SBOMB_BLAST can't currently be adjusted, but  that's an issue which may be resolved in future versions of ZC.

 

To create a custom explosion sprite, I'd recommend a script-type LWeapon.

 

 

oh I also see that your planing on supporting pickupable weapons? aka "LMM_CARRY"

are you going to have a pickup script form this?

if so you could allow a middle frame where right before the item goes from on the ground to over links head you can position the item in the middle of the two transition for the left and right directions

this was a thing I noticed in the gameboy games 

 

You mean, between the ground and overhead? Possibly, but it depends on how hard it is to pull off. That particular script is a long way from being final.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users