Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
0 registered members (), 683 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
LucasJoshua, Baklazhan, Hanky27, firatv, wandaluciaia
19054 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
the opposite of : VIEW_ent.flags2 |= VISIBLE; #189263
03/18/08 16:08
03/18/08 16:08
Joined: Sep 2003
Posts: 271
Germany
Chris3D Offline OP
Member
Chris3D  Offline OP
Member

Joined: Sep 2003
Posts: 271
Germany
Hi,

this is really embarrassing for me, but I don't how to do it:

What is the opposite of :

VIEW_ent.flags2 |= VISIBLE;

(VIEW_ent.flags2 |= INVISIBLE; doesn't work)


Re: the opposite of : VIEW_ent.flags2 |= VISIBLE; [Re: Chris3D] #189264
03/18/08 16:17
03/18/08 16:17
Joined: Jan 2002
Posts: 4,225
Germany / Essen
Uhrwerk Offline
Expert
Uhrwerk  Offline
Expert

Joined: Jan 2002
Posts: 4,225
Germany / Essen
VIEW_ent->flags &= ~(VISIBLE);

or

VIEW_ent.flags &= ~(VISIBLE);


Always learn from history, to be sure you make the same mistakes again...
Re: the opposite of : VIEW_ent.flags2 |= VISIBLE; [Re: Uhrwerk] #189265
03/18/08 17:51
03/18/08 17:51
Joined: Sep 2003
Posts: 271
Germany
Chris3D Offline OP
Member
Chris3D  Offline OP
Member

Joined: Sep 2003
Posts: 271
Germany
Thx man!

Edit: Oh [censored], I found that also in the manual, sorry for posting!

Re: the opposite of : VIEW_ent.flags2 |= VISIBLE; [Re: Chris3D] #189266
03/18/08 19:12
03/18/08 19:12
Joined: Sep 2003
Posts: 271
Germany
Chris3D Offline OP
Member
Chris3D  Offline OP
Member

Joined: Sep 2003
Posts: 271
Germany
OH, but I didn't find that:

if is(VIEW_ent,VISIBLE){}

this works only with "flags" but not with "flags2", is there an if-statement for flags2 ?
Greetings Chris

well I tried: if(VIEW_ent.flags2 == VISIBLE) and I worked, very easy..


Last edited by Chris3D; 03/18/08 19:18.
Re: the opposite of : VIEW_ent.flags2 |= VISIBLE; [Re: Chris3D] #189267
03/18/08 19:32
03/18/08 19:32
Joined: Aug 2007
Posts: 1,922
Schweiz
Widi Offline
Serious User
Widi  Offline
Serious User

Joined: Aug 2007
Posts: 1,922
Schweiz
You can make a own define:
#define is_2(obj,flag) (obj.flags2 & (flag)) // Abfrage von flags2

then you can test the flag:
if is_2(Yourflag2,VISIBLE)

Re: the opposite of : VIEW_ent.flags2 |= VISIBLE; [Re: Chris3D] #189268
03/18/08 20:20
03/18/08 20:20
Joined: Jan 2002
Posts: 4,225
Germany / Essen
Uhrwerk Offline
Expert
Uhrwerk  Offline
Expert

Joined: Jan 2002
Posts: 4,225
Germany / Essen
Quote:

well I tried: if(VIEW_ent.flags2 == VISIBLE) and I worked, very easy..




Very easy and wrong. This will cause you sooner ar later lots of trouble. This condition will only evaluate to true if no other flags than VISIBLE are set. The correect condition is
Code:
if (VIEW_ent.flags2 & VISIBLE == VISIBLE)


or
Code:
if (VIEW_ent.flags2 & VISIBLE != 0)


or in it's most simple form
Code:
if (VIEW_ent.flags2 & VISIBLE)




Always learn from history, to be sure you make the same mistakes again...
Re: the opposite of : VIEW_ent.flags2 |= VISIBLE; [Re: Uhrwerk] #189269
03/18/08 20:39
03/18/08 20:39
Joined: Sep 2003
Posts: 271
Germany
Chris3D Offline OP
Member
Chris3D  Offline OP
Member

Joined: Sep 2003
Posts: 271
Germany
thanks again!!!


Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1