Jump to content

Photo

How do I check if the right angle slash flag is set?

Right angle slash

  • Please log in to reply
10 replies to this topic

#1 Shadowblitz16

Shadowblitz16

    Illustrious

  • Members

Posted 01 January 2017 - 01:48 PM

How do I check if the right angle slash flag is set?

 

I did a search for slash in stdConstants.zh and zscript.txt and came up with nothing


Edited by Shadowblitz16, 01 January 2017 - 01:49 PM.


#2 Timelord

Timelord

    The Timelord

  • Banned
  • Location:Prydon Academy

Posted 02 January 2017 - 06:34 PM

How do I check if the right angle slash flag is set?

 

I did a search for slash in stdConstants.zh and zscript.txt and came up with nothing

 

Do you mean to check if Link has slash, or if slash direction is not reversed?



#3 Shadowblitz16

Shadowblitz16

    Illustrious

  • Members

Posted 02 January 2017 - 07:25 PM

slash direction is not reversed



#4 Timelord

Timelord

    The Timelord

  • Banned
  • Location:Prydon Academy

Posted 02 January 2017 - 09:13 PM

slash direction is not reversed



Sorry, clarify. You want to check if slash direction is not reversed? (Quest->Rules->Items->1->Flip Right Facing Slash)

That's a quest rule.

There is no way to check it in 2.50, directly, but you can do this:
 
bool SwordFlipped(){
	lweapon l;
	for ( int q = Screen->NumLWeapons(); q > 0; q-- ) {
		l = Screen->LoadLWeapon(q);
		if ( l->ID == LW_SWORD ) {
			return (l->Flip != 0);
		}
	}
}
Note that this will return '2' when it is flipped, but the sword animation ends on a non-slash sprite, which will return 0. There are fourteen frames of the slash animation, and the last four will return 0 even if the slash is flipped, so you want to catch it on the first frame of the sword's animation.

You can't do it from an item script, because the script runs before the lweapon is generated, so you are effectively required to set up some conditions wherever you do elect to do the check, so that you catch it on the first frame of the sword.

Edited by ZoriaRPG, 02 January 2017 - 09:38 PM.


#5 Shadowblitz16

Shadowblitz16

    Illustrious

  • Members

Posted 02 January 2017 - 09:37 PM

ok nevermind then thankyou



#6 Timelord

Timelord

    The Timelord

  • Banned
  • Location:Prydon Academy

Posted 02 January 2017 - 09:41 PM

ok nevermind then thankyou


?

You need to check it before the sword appears; is that it?

#7 Shadowblitz16

Shadowblitz16

    Illustrious

  • Members

Posted 02 January 2017 - 11:27 PM

well I need to check it for a stdWeapons type weapon



#8 Timelord

Timelord

    The Timelord

  • Banned
  • Location:Prydon Academy

Posted 03 January 2017 - 11:40 AM

well I need to check it for a stdWeapons type weapon


If you are using that header, why not just create swords with it...? Checking the quest rule bit is superfluous. Just use some kind of setting to decide if a sword should be flipped.

#9 Shadowblitz16

Shadowblitz16

    Illustrious

  • Members

Posted 03 January 2017 - 12:04 PM

ok I will then.

I just thought that making it configurable within the editor would be nice



#10 Timelord

Timelord

    The Timelord

  • Banned
  • Location:Prydon Academy

Posted 04 January 2017 - 01:34 AM

ok I will then.
I just thought that making it configurable within the editor would be nice


Well, this is precisely why I expanded itemdata, and made items heavily configurable for ZC [2.future] v2.54.

Using that, quite a lot of stdWeapons.zh can be simplified, and reconfigured to use the item editor for almost every value, down to selecting the sprites from menus. You could use some kind of arg in 2.50.x to make it configurable though, unless Alucard is still using both the decimal, and integer sides of every Script D value to set its sprites and values.

#11 Shadowblitz16

Shadowblitz16

    Illustrious

  • Members

Posted 04 January 2017 - 02:55 PM

I don't know really.

but that sounds cool I can't wait until v2.54.

are you guys planning on adding the Link hitbox variables? I just ask since that's what I'm looking forward to most.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users