Register for your free account! | Forgot your password?

You last visited: Today at 11:36

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Quick question

Discussion on Quick question within the CO2 Private Server forum part of the Conquer Online 2 category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Nov 2010
Posts: 1,162
Received Thanks: 370
Quick question

I know &= & |= are assignment for opreators, but when do I use what.
The question was related to hybrids source.

Example:
Code:
            this.Entity.Spawn.StatusFlag &= ~StatusFlag.Fly;
            this.Entity.Spawn.StatusFlag |= StatusFlag.Dead;
Why would it not be?
this.Entity.Spawn.StatusFlag &= ~StatusFlag.Dead;
or
this.Entity.Spawn.StatusFlag |= StatusFlag.Fly;

I tried look up at msdn, but didn't really get it.

Thank you.
Syst3m_W1z4rd is offline  
Old 01/16/2011, 20:46   #2
 
© Haydz's Avatar
 
elite*gold: 20
Join Date: Jan 2008
Posts: 1,042
Received Thanks: 252
The operators you show are binary/bitwise operators.

OR = |
NOT = ~
AND = &

Basically:

&= ~Flag (Removal of a flag from BitField)
|= Flag (Addition of a flag into BitField)

I could go on to quote various information from Wikipedia to assert my intelligence, but I'll just provide the link.

Bitwise Operations

In your example, I assume it is the death handler, which removes anything you can't do while dead, and adds the death + ghost flags.
© Haydz is offline  
Thanks
1 User
Old 01/16/2011, 22:31   #3
 
elite*gold: 0
Join Date: Nov 2010
Posts: 1,162
Received Thanks: 370
Ahhh thank you. That's all I needed to know
Syst3m_W1z4rd is offline  
Old 01/17/2011, 00:32   #4
 
elite*gold: 21
Join Date: Jul 2005
Posts: 9,193
Received Thanks: 5,376
The handy thing about bit operations is you don't have to worry about 'double reversing' or whatever...

IE:

Client.Dead != Client.Dead would simply reverse a bool... but if you're working with a bit field and do

Client.Flags &= ~Flags.BlueName;

You simply set bluename to false and remove any related status effect from the 'pool' and such. It makes things nice and simple for handling effects.

Sadly I still haven't switched over simply because I already need a dictionary to control the duration of an effect but they are definitely very useful. I suppose I could always switch to using my DAQ system instead.. but w/e.
pro4never is offline  
Thanks
2 Users
Old 01/17/2011, 01:15   #5
 
elite*gold: 20
Join Date: Oct 2010
Posts: 451
Received Thanks: 259
Quote:
Originally Posted by pro4never View Post
The handy thing about bit operations is you don't have to worry about 'double reversing' or whatever...

IE:

Client.Dead != Client.Dead would simply reverse a bool... but if you're working with a bit field and do

Client.Flags ~= Flags.BlueName;

You simply set bluename to false and remove any related status effect from the 'pool' and such. It makes things nice and simple for handling effects.

Sadly I still haven't switched over simply because I already need a dictionary to control the duration of an effect but they are definitely very useful. I suppose I could always switch to using my DAQ system instead.. but w/e.
You just gave me an awesome idea =]
Thanks!
FuriousFang is offline  
Old 01/17/2011, 20:00   #6
 
_DreadNought_'s Avatar
 
elite*gold: 28
Join Date: Jun 2010
Posts: 2,223
Received Thanks: 867
It's explained in Hybrid tut's in the programming section for conquer.
_DreadNought_ is offline  
Reply


Similar Threads Similar Threads
A quick question
12/26/2010 - Silkroad Online - 3 Replies
Okey, this might sound pretty stupid.. But w/e I need to know in which server am I playing.. Since I don't have russian language isntalled in my laptop (can't be installed coz of win 7) I can'e see the names of the server in proper russian alphabet.. The picture which I get looks like that: http://i52.tinypic.com/2wfu149.jpg Umm, yeah, so if anyone can be cute enough and tell me the names of the servers I'd be really thankful.. Also, if there already is a topic like that, then...
Very quick question need quick answer!
10/26/2009 - Dekaron - 5 Replies
On line 21 of the CE non agro, what is the regular speed of the mobs? what do I change?? I wanna non agro that doesnt make the monsters so speedy... thansk!
quick question
05/18/2009 - EO PServer Hosting - 1 Replies
probablly really easy question. What is the table for the legion in navicat? I can't find it -.-
Quick question
10/22/2007 - Conquer Online 2 - 4 Replies
I'm level 130 trojan and i got super lvl 120 weapons :F Is there any good and fast way to get some dbs without paypalling? :S I'm pretty poor and cant afford even for one DB >.> Tips would be nice.
quick question
05/22/2006 - Conquer Online 2 - 2 Replies
a few days ago i aquired a prog off of this sight (not blaming anyone). it was to un-encript the monster.dat file so you could edit it, the re-encript it. the prog had a back up option so i didn't make a backup my self (my mistake). so i fooled around changing the sizes of monsters and stuff and re-encripted it and somehow the backup ruened and is now like the new monster.dat. i didn't take down the changes i made (another mistake) so i replaced the new one with the old one, but it didn't...



All times are GMT +2. The time now is 11:36.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2024 elitepvpers All Rights Reserved.