Jump to content

Photo

Losing Triforce Pieces


  • Please log in to reply
4 replies to this topic

#1 klop422

klop422

    Evil Crazy Mastermind

  • Members
  • Real Name:Not Valentino
  • Gender:Male
  • Location:Planet Earth

Posted 13 September 2017 - 08: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
  • Gender:Unspecified

Posted 13 September 2017 - 04:21 PM

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

 

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



#3 klop422

klop422

    Evil Crazy Mastermind

  • Members
  • Real Name:Not Valentino
  • Gender:Male
  • Location:Planet Earth

Posted 13 September 2017 - 05:01 PM

In a script, right?

Thanks. May use this at some point.



#4 MoscowModder

MoscowModder

    Still fighting the inevitable

  • Members
  • Gender:Male
  • Location:Wisconsin (WHAT)

Posted 14 September 2017 - 09: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 ZoriaRPG

ZoriaRPG

    ZC Contributor & Wiki Editor

  • Members
  • Gender:Unspecified
  • Location:Prydon Academy

Posted 15 September 2017 - 03: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 - 03:07 AM.



0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users