Jump to content

Photo

Losing Triforce Pieces


  • Please log in to reply
4 replies to this topic

#1 klop422

klop422

    Guess I'm full of monsters and treasure

  • Members
  • Real Name:Not George
  • Location:Planet Earth

Posted 13 September 2017 - 09:14 AM

Is there any way to make Link lose pieces of the Triforce? I imagine it would be useful if you want something like that to occur in your story.



#2 Jamian

Jamian

    ZC enthusiast

  • Members

Posted 13 September 2017 - 05:21 PM

Game->LItems[1]& LI_TRIFORCE = false;

 

will remove the Triforce piece for level 1. And so on.



#3 klop422

klop422

    Guess I'm full of monsters and treasure

  • Members
  • Real Name:Not George
  • Location:Planet Earth

Posted 13 September 2017 - 06:01 PM

In a script, right?

Thanks. May use this at some point.



#4 MoscowModder

MoscowModder

    Sometimes lurking. Rarely posting.

  • Members
  • Location:Wisconsin

Posted 14 September 2017 - 10:38 AM

Shouldn't that be
Game->LItems[1] &= ~LI_TRIFORCE
There might be a method to do this in std.zh.
Also I'm not 100% sure if ~ is the bitwise NOT operator.

But anyway that's the concept. You want to un-set a bitwise flag on the level's level items array entry.

#5 Timelord

Timelord

    The Timelord

  • Banned
  • Location:Prydon Academy

Posted 15 September 2017 - 04:04 AM

Shouldn't that be

Game->LItems[1] &= ~LI_TRIFORCE
There might be a method to do this in std.zh.
Also I'm not 100% sure if ~ is the bitwise NOT operator.
But anyway that's the concept. You want to un-set a bitwise flag on the level's level items array entry.

This is correct. Level Items are OR'd together, so, you need bitwise NOT here, and ZScript uses the standard C bitwise tokens. I have no idea what the bitwise stuff looks like in GML, or whatever you are now using, but ~ is the general standard in most languages.

I do not recall if there is a function for that in the 2.50.x series std.zh. (I added a long list of bitwise stuff to future/planned versions, and I do not recall if Get/SetLevelItem() was part of any older version.)

Edited by ZoriaRPG, 15 September 2017 - 04:07 AM.



1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users