collapse

Author Topic: Proportionate hitspark placement help  (Read 1276 times)

0 Members and 1 Guest are viewing this topic.

Offline Luigi-Master

  • Skull fetishist
  • Forum Member
  • ***
  • Posts: 404
  • Last Login:December 08, 2013, 03:47:08 AM
  • Soviet enthusiast
    • Email
Proportionate hitspark placement help
« on: May 03, 2011, 11:34:59 AM »
By the title, I mean the usage of a little code regarding the character's size and hitspark location.  From my own understanding, the code would be *const(size.xscale) for X values and *const(size.yscale) for Y values.  It works fine and all, but they all cause debug spam for whatever reason.  Is there an alternative to this, besides making the values constant irregardless of the character's size?

Speaking of which, you might be wondering why I want to use code for it instead of finding the exact location.  Well, let's just say I want it to be a feature to re-size the character to your liking, and the hitsparks and other things are of proportionate size and location.

Thanks in advance!



Offline Acey

  • Infinity Administrator
  • *
  • Posts: 9579
  • Country: United States us
  • Last Login:December 05, 2022, 10:43:15 PM
  • "Victory means nothing, the fight is everything."
    • Infinity Wiki - Acey
    • Email
Re: Proportionate hitspark placement help
« Reply #1 on: May 03, 2011, 11:46:38 AM »
By the title, I mean the usage of a little code regarding the character's size and hitspark location.  From my own understanding, the code would be *const(size.xscale) for X values and *const(size.yscale) for Y values.  It works fine and all, but they all cause debug spam for whatever reason.  Is there an alternative to this, besides making the values constant irregardless of the character's size?

Speaking of which, you might be wondering why I want to use code for it instead of finding the exact location.  Well, let's just say I want it to be a feature to re-size the character to your liking, and the hitsparks and other things are of proportionate size and location.

Thanks in advance!

I completely understand why you might want to do something like this. If you put this code into a varset then it will chop off the decimals and then you should be able to use each of the the vars for the x and y position in the hitdefs.

Now I'm pretty sure that vars can be used as the sparkxy in the hitdef but if it doesn't work for some reason then you can just make the hitspark -1 (no hitspark) then use an explode sctrl with a "trigger = movehit" for the spark instead. I know explodes can use the vars as the position, but it should probably work for the sparkxy anyways.

Offline Luigi-Master

  • Skull fetishist
  • Forum Member
  • ***
  • Posts: 404
  • Last Login:December 08, 2013, 03:47:08 AM
  • Soviet enthusiast
    • Email
Re: Proportionate hitspark placement help
« Reply #2 on: May 03, 2011, 11:56:49 AM »
Would you mind giving me an example?  Thanks!

Offline Acey

  • Infinity Administrator
  • *
  • Posts: 9579
  • Country: United States us
  • Last Login:December 05, 2022, 10:43:15 PM
  • "Victory means nothing, the fight is everything."
    • Infinity Wiki - Acey
    • Email
Re: Proportionate hitspark placement help
« Reply #3 on: May 03, 2011, 12:02:59 PM »
in the hitdef it might look like this:
spritexy = var(1),var(2)

with an explod it might look something like this:
pos= var(1),var(2)

also make the varsets (in statedef -2 probably)
var(1) = (enemynear,const(size.ground.front)) * (enemynear,facing) * (-facing);x distance
var(2) = floor(pos y-enemynear,pos y);top of head

You could also add values to the vars is you need adjustments (e.g. -60 to var(2)), either in the varset or in the pos.

I havn't tested this particularly but this should give you a starting place.

« Last Edit: May 03, 2011, 12:08:01 PM by Acey »

Offline ClubSyN-X-TReME

  • Character and Interactive Stage Specialist
  • Club Syndicate Admin
  • *
  • Posts: 1641
  • Last Login:July 28, 2014, 06:54:54 AM
    • Club SyN -X-treme

Offline Alexziq

  • Infinite Loyalist
  • *****
  • Posts: 2624
  • Last Login:November 10, 2017, 01:10:16 PM
    • Email
Re: Proportionate hitspark placement help
« Reply #5 on: May 03, 2011, 12:35:45 PM »
People do this often in grabs where theres no actual hitdef, and a - add life is used for damage. I just added in the scale = 0,0 line of code to change the size

I just coded one last week. I can post an example later which might be a little easier. I m working now, and cant remember it off the top of the head.

Offline O Ilusionista

  • Since 1999 and kicking :)
  • IMT Content Architect
  • *
  • Posts: 12476
  • Country: Brazil br
  • Last Login:November 11, 2024, 12:35:15 PM
  • OpenBOR & Mugen addicted
    • BMT - Brazil Mugen Team
    • Email
Re: Proportionate hitspark placement help
« Reply #6 on: May 03, 2011, 12:51:08 PM »
Quote
I want it to be a feature to re-size the character to your liking, and the hitsparks and other things are of proportionate size and location.

There is a easy way to solve this case when you use projectiles, explods and helpers:

Quote
scale = 0.5*const(size.xscale),0.5*const(size.yscale)

The 0.5 is the value you want (on my case, I want it cutted by half). So, if you want the normal size, just use:

Quote
scale = 1*const(size.xscale),1*const(size.yscale)

Since you're multiplying, you don't need to add .0 (like 1.0). But if we would make a division, we should use 1.0.
Mugen has a known bug handling real numbers.

For the position, its the same logic, just need to round the number:

Quote
pos = ceil(-28*const(size.xscale)),ceil(-38*const(size.yscale))

-28 and -38 are the values I want when my scale is 1.0

On the Acey code, you need to use a triggerall = NumEmeny, or it will give debug flood in some cases.



Post Merge: May 03, 2011, 12:56:45 PM
if you need it for a helper, the scale follow the same logic too:

Quote
[State 0, Helper]
type = Helper
trigger1 = !time
helpertype = normal ;player
name = "Fazedor de geladinho"
ID = 1005
stateno = 1005
pos = ceil(35*const(size.xscale)),0
postype = p1    ;p2,front,back,left,right
facing = 1
ownpal = 1
size.xscale = 1*const(size.xscale)
size.yscale = 1*const(size.yscale)
« Last Edit: May 03, 2011, 12:56:45 PM by .(O). »

Offline Luigi-Master

  • Skull fetishist
  • Forum Member
  • ***
  • Posts: 404
  • Last Login:December 08, 2013, 03:47:08 AM
  • Soviet enthusiast
    • Email
Re: Proportionate hitspark placement help
« Reply #7 on: May 03, 2011, 01:00:37 PM »
Ilusionista got the code right!  I knew I could count on him!  Thanks man!   :w00t:

pos = ceil(-28*const(size.xscale)),ceil(-38*const(size.yscale))

Question, will this also work for velocities?  Since when a character changes his size, the moves might not work right due to the new size, especially launchers and the like.

Offline O Ilusionista

  • Since 1999 and kicking :)
  • IMT Content Architect
  • *
  • Posts: 12476
  • Country: Brazil br
  • Last Login:November 11, 2024, 12:35:15 PM
  • OpenBOR & Mugen addicted
    • BMT - Brazil Mugen Team
    • Email
Re: Proportionate hitspark placement help
« Reply #8 on: May 03, 2011, 01:05:25 PM »
you are welcome. Knownledge is made to share.

yes, it will work for velocities too, like:

type = VelSet
X = 4*const(size.xscale)

4 is the base velocity. If you make the char smaller, it will go slowly. If you make it bigger, it would go faster.

using this method you can change your scale freely. This is what I use at PDC.

Offline Luigi-Master

  • Skull fetishist
  • Forum Member
  • ***
  • Posts: 404
  • Last Login:December 08, 2013, 03:47:08 AM
  • Soviet enthusiast
    • Email
Re: Proportionate hitspark placement help
« Reply #9 on: May 03, 2011, 01:45:13 PM »
I suppose it also works for hit velocities as well, right?  Thanks again!

Offline O Ilusionista

  • Since 1999 and kicking :)
  • IMT Content Architect
  • *
  • Posts: 12476
  • Country: Brazil br
  • Last Login:November 11, 2024, 12:35:15 PM
  • OpenBOR & Mugen addicted
    • BMT - Brazil Mugen Team
    • Email
Re: Proportionate hitspark placement help
« Reply #10 on: May 03, 2011, 02:08:06 PM »
probabily, but I never tested it.


Like I never tested if it works when the stage change your scale. As far as I know, it works, but I need to test.

Tags:
 


* IMT Facebook

Help us by Donating!

IMT Discord

Join us at our Discord! Click the image below!

* IMT Shoutbox

Sorry, this shoutbox does not exist.

* Recent Posts

Barkley Shut Up and Jam! Stages by Vegaz by LightFlare
[November 12, 2024, 11:26:21 AM]


[BOR] _Avengers United Battle Force_ by O Ilusionista
[November 11, 2024, 12:35:24 PM]


Eternal Lament Stage 1.1 & 1.0 by O Ilusionista
[November 11, 2024, 12:34:54 PM]


MatreroG's Stages W.I.P. Concepts by MatreroG
[November 11, 2024, 07:00:56 AM]


Marvel vs. Capcom: Eternity of Heroes REMAKE Game Update 1.3.0 - N.A.O.H. by ExShadow
[November 02, 2024, 04:54:41 AM]


Spooky House(1.1 Only/AIGS) by Vegaz by LightFlare
[October 31, 2024, 11:31:36 AM]


Rooftop Skyline(1.1 Only/AIGS) by Vegaz by LightFlare
[October 21, 2024, 12:13:37 PM]


Secluded Base(1.1 Only/AIGS) by Vegaz by LightFlare
[October 17, 2024, 01:21:06 PM]


Ultimate Balrog + stage by ELECTRO
[October 17, 2024, 05:40:31 AM]


Classic VS : Balrog by ELECTRO
[October 08, 2024, 04:35:53 PM]

* IMT Calendar

November 2024
Sun Mon Tue Wed Thu Fri Sat
1 2
3 4 5 6 7 8 9
10 11 12 13 14 [15] 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30

SimplePortal 2.3.5 © 2008-2012, SimplePortal