 |
|  |
 |
|  |
 |
|
William Keenan
|
 |
New Jersey, USA, Earth, Sol, Milky Way
Sep 1999 time: 00:14
|
|
Here is a excerpt from my upcoming tip on flags, quote: Everyone is familiar with the decimal number system, the base ten number system we use every day. The decimal number system is composed of ten digits: 0; 1; 2; 3; 4; 5; 6; 7; 8; and 9.
One digit in the decimal system can express ten different values, from 0 to 9.
Two digits together can express one hundred values - from 00 to 99.
Computers use the binary number system, the base two number system. The binary number system is composed of two digits: 0 and 1.
One digit in the binary system can express two different values, from 0 to 1.
Two digits together can express four values - 00, 01, 10, and 11.
Q. What is a Flag?
A. A flag is one binary digit.
Q. Why call it a flag?
A. It's a programmer lingo thing. It's on or off like a flag is up or down.
Q. What is a Mask?
A. A mask is two or more binary digits. 1100 is a mask made up of four flags.
Q. Why call it a mask?
A. Since programmers tend to hide behind their binary digits they decided to call them masks. |
Well, the truth is that the above is not an excerpt ... it is the entire work in progress. The small amount of progress have made on this paper is probably due to the fact that I find writing about binary digits slightly more exciting then poking myself in the eye.
|
|
|  |
 |
|
Civfan
|
|
Toronto, Canada
Sep 1999 time: 05:14
|
|
ummmmm guess I'll be checking the dummies version for this one..... Correct me If I'm wrong but my understanding of flags allows you to combine events in a game. Say I want a unit built when three cities have been conquered. City 1 will be called Rome, city 2 called Paris and 3 called Toronto.
To begin creating this event I would start by turning on a flag.
@IF
CITYTAKEN
city=Rome
attacker=YOu
defender=HIM
@THEN
TURNFLAG 000000001
@ENDIF
@IF
CITYTAKEN
city=Paris
@THEN
TURNFLAG 000000010
@ENDIF
@IF
CITYTAKEN
city=Toronto
@THEN
TURNFLAG 000000100
@ENDIF
Though this isn't in correct format in dealing with TOT, the picture is clear. It's been set up.
The last part would be something like this.
@IF
FLAG
000000111
@THEN
CREATEUNIT
unit=Mario
homeecity=?
location
11,33
233,44
ENDLOCATIONs
@ENDIF
SO binary thing. 0= OFF 1= ON
Is this sorta right?
I haven't tried it yet as TOT is off my system for now, working with FW scenario but is that right. Someone correct me If i'm wrong.... Thankx
Civfan........
|
|
|  |
 |
|
|
Thanks guys. I hope to implement this in my upcoming title. I look forward to seeing the design tip :-)
|
|
|  |
 |
|
William Keenan
|
 |
New Jersey, USA, Earth, Sol, Milky Way
Sep 1999 time: 00:14
|
|
Yes there are 32 flags for each civ and each flag is one binary digit. I did a shorthand above that has confused you, the mask should look like this:
@IF
CHECKFLAG
Who=You
Mask=0b00000000000000000000000000000111
Count=3
State=On
@THEN
CREATEUNIT
unit=Mario
homecity=Civfanville
LOCATIONS
11,33
233,44
ENDLOCATIONS
@ENDIF
with 32 positions. Because the first 16 were zeros I left them off, which is fine by the computer. Like the decimal number system leading zeros are not necessary, for example you could write the number one hundred like this 00000100, but we don't we just type 100. The same is true of binary.
Each civ has it's own set of 32 flags, including the barbarians. That means eight sets of 32 flags.
I agree with your closing remark
quote: If thats right, damn the possiblities are endless ...... and would make this the best purchase I made since Warcraft II |
|
|
|  |
 |
|  |
All times are GMT. The time now is 05:14. Apolyton Time is 00:14. |
top of page
|
|
|
Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is ON
vB code is ON
Smilies are ON
[IMG] code is ON
|
|
|
|
|
|