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.
Losing Triforce Pieces
Started by
klop422
, Sep 13 2017 09:14 AM
4 replies to this topic
#1
Posted 13 September 2017 - 09:14 AM
#2
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
Posted 13 September 2017 - 06:01 PM
In a script, right?
Thanks. May use this at some point.
#4
Posted 14 September 2017 - 10:38 AM
Shouldn't that be
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.
Game->LItems[1] &= ~LI_TRIFORCEThere 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
Posted 15 September 2017 - 04:04 AM
Shouldn't that be
Game->LItems[1] &= ~LI_TRIFORCEThere 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.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users