Apolyton Archive  |  Preserved copy of the Apolyton Civilization Site and its forums as they stood in September 2005. Read-only; nothing here can be posted to or replied to.  |  Forum index |  About this archive |  The 1998–2001 UBB forums
Today on Apolyton WARDELL INTERVIEW PROMO A.C.S. HISTORY CHAPTER 4 GET CIV4 /w FREE PLUS! A.C.S. PHOTO GALLERY GET A.O.M. V1.1
Apolyton Civilization Forums
main| civ2| civ3| civ4| smac| ctp2| ron| moo3| galciv| galciv2| alt| about|
ApolytonPLUS | register | search | faq | new posts | pm (-/-) | upload | members
hall of fame new! | civgroups | civgroups news | interviews | the column | radio | chat | directory | news | store | PLUS
Apolyton Civilization Forums : Powered by vBulletin version 2.0.3 Apolyton Civilization Forums > Civilization II > Civ2-Test of Time > Calling William Keenan or John P - Need help with flag masks
Show a Printable Version | Email This Page to Someone! | Receive updates to this thread | Report this to Apolyton news!
29.Jul: MOVING UP ON REVISED `TOP 100` INDEX
29.May: GAME MECHANICS REFERENCE BOOKLET
06.Mar: DROPPING FROM SECOND TO THIRD

bottom of page
  - CIVILIZATION 2 from $6.95 - CIVILIZATION 2 from $4.25 - CIV2: TEST OF TIME from $2.50 - CIV2: MULTIPLAYER GOLD EDITION from $4.99
Author
Thread    < Last Thread     Next Thread > Post New Thread     Post A Reply
Miner is offline Miner
Prince
of London
Jul 1999
time: 05:14
Exclamation  Old Post 13-02-2000 00:45 Visit Miner's homepage!
Edit/Delete Message Reply w/Quote
#1 Report this post to a moderator
Calling William Keenan or John P - Need help with flag masks Support Apolyton, buy Civilization III: Complete

...or anybody, I'm not fussy.

Please help.

I am having difficulty with using flag masks. Note, just masks, not the individual flags. I have those sussed and having no problem with them. However, as soon as I use a mask - nothing happens. I have checked the report.txt produced by the event parser and it shows no errors. In fact the rest of the event actions fires fine, but the FLAG action used with a mask appears to do bugger all. Here is the event I am referring to:

@IF
UNITKILLED
unit=Werewolf
attacker=ANYBODY
defender=Firetop Mountain
@AND
CHECKFLAG
who=Firetop Mountain
flag=2
state=on
@THEN
TEXT
Congratulations! you have killed the werewolf
but something has heard you...
ENDTEXT
FLAG
continuous
who=Firetop Mountain
mask=0b111111111111111111111111111111111
state=off
@ENDIF

I know the event fires because I see the text, so I know thats not the problem.
But the events that rely on the setting of all the flags back to off don't. (I am using the flags as a resettable counter).

Any suggestions? 'cos I'm out. I can get round this by setting 32 individual flags but this takes up 32 events!!!!!!!!

PS no errors in report.txt
PPS have tried hex notation
PPPS have patch
PPPPS the event is from my upcoming scenario,
the release date of which is slipping...

John Possidente is offline John Possidente
Prince
Hunt Valley, MD USA
Jun 1999
time: 00:14
Post  Old Post 14-02-2000 19:46
Edit/Delete Message Reply w/Quote
#2 Report this post to a moderator
Tired of ads?

I haven't passed this one through the programmers to be sure, but...try it without the Continuous modifier.

I wasn't as clear about this in the manual as I should have been, but where flags are concerned, Continuous is necessary to preserve an On state; as far as I can determine, it's unnecessary for the Off state, because that's what the flag reverts to at end of turn if there's no Continuous to prevent it.

Miner is offline Miner
Prince
of London
Jul 1999
time: 05:14
Thumbs up  Old Post 15-02-2000 00:17 Visit Miner's homepage!
Edit/Delete Message Reply w/Quote
#3 Report this post to a moderator
Support Apolyton buy from Amazon

Thanks for that, back in 5.

Miner is offline Miner
Prince
of London
Jul 1999
time: 05:14
Angry  Old Post 15-02-2000 00:31 Visit Miner's homepage!
Edit/Delete Message Reply w/Quote
#4 Report this post to a moderator
Full PM-box? Change here!

OK, just tried it without the continuous modifier. No joy. Exactly the same thing happens ie nothing. The event fires, I see the text, but the flags are definately not being set.

As a matter of interest, I put in the following debug event to to fire when the flags are indeed all off:

@IF
CHECKFLAG
who=Firetop Mountain
mask=0b11111111111111111111111111111111
state=off
@THEN
TEXT
all flags off
ENDTEXT
@ENDIF

Given the above circumstances, how often do you think this event would fire, considering that the flags do not appear to be reset?
Just once - after INITFLAG does it's stuff.
Well no - it actually fires every turn! It's firing on turns where I know at least one of the flags is set to on because there are other events firing because of flags being set to on! What gives?

What am I doing wrong? anyone else have this trouble? As far I can see flags masks do not work - but I know they do because of the event structures in Midguard etc etc.

Help me I am losing my mind!.!>!!>"()"&)(&"£

William Keenan is offline William Keenan
Prince
New Jersey, USA, Earth, Sol, Milky Way
Sep 1999
time: 00:14
Smile  Old Post 15-02-2000 06:16 Visit William Keenan's homepage!
Edit/Delete Message Reply w/Quote
#5 Report this post to a moderator
Support Apolyton, buy Galactic Civilizations

Miner: The first thing I noticed was that your Mask had 33 bits, that is to say 33 ones in it. This will cause an overflow, which can cause unpredictable errors. Using hexadecimal notation (0hFFFFFFFF) tends to eliminate those kinds of errors.

Fix your mask and try it again. If your file still does not work send me your events file.

John Possidente is offline John Possidente
Prince
Hunt Valley, MD USA
Jun 1999
time: 00:14
Post  Old Post 15-02-2000 19:10
Edit/Delete Message Reply w/Quote
#6 Report this post to a moderator
Support Apolyton, pre-order Civilization IV

Agh! I should have counted! Good catch. That sure would do it.

Miner is offline Miner
Prince
of London
Jul 1999
time: 05:14
Exclamation  Old Post 16-02-2000 00:14 Visit Miner's homepage!
Edit/Delete Message Reply w/Quote
#7 Report this post to a moderator
Full PM-box? Change here!

0b
1:1
1:2
1:3
1:4
1:5
1:6
1:7
1:8
1:9
1:10
1:11
1:12
1:13
1:14
1:15
1:16
1:17
1:18
1:19
1:20
1:21
1:22
1:23
1:24
1:25
1:26
1:27
1:28
1:29
1:30
1:31
1:32

Are you sure?! I just copied & pasted from my prior post, which is itself copied & pasted from events.txt. I only count 32.

Oh well, I'm off to try knocking one off.

I will also try the hex notation you gave, although I have already tried hex. Back in 10...

Miner is offline Miner
Prince
of London
Jul 1999
time: 05:14
Unhappy  Old Post 16-02-2000 00:31 Visit Miner's homepage!
Edit/Delete Message Reply w/Quote
#8 Report this post to a moderator
Support Apolyton, buy Call to Power 2

Still no joy. I knocked off a 1, and events did compile but the end result is the same.

I tried the hex notation you gave, but it didn't like the 0h, it wants 0x so the EPD gave an error.

So I put hex notation back in and it still doesn't work, although it compiles.

When I put in my 32*1 string, the EPD recognises it as being mask 0xffffffff because it translates it in report.txt. But it still won't work! So, Mr Keenan, events.txt is on it's way to you.

Miner is offline Miner
Prince
of London
Jul 1999
time: 05:14
Lightbulb  Old Post 16-02-2000 01:30 Visit Miner's homepage!
Edit/Delete Message Reply w/Quote
#9 Report this post to a moderator
Lose 30 kilos (of popups)

OK YOUR NOT GONNA BELIEVE THIS

I got it to work!!!!!!!!!!!!!!!!!!!

But I think I have discovered a bug in the flags. I was just in the process of sending the events to Mr Keenan when I tried something else.

Instead of setting the mask in the above event, I did this instead:

@IF
UNITKILLED
unit=Werewolf
attacker=ANYBODY
defender=Firetop Mountain
@AND
CHECKFLAG
who=Firetop Mountain
flag=2
state=on
@THEN
TEXT
Congratulations! you have killed the werewolf
but something has heard you...
ENDTEXT
GIVETECHNOLOGY
technology=88
receiver=Firetop Mountain
@ENDIF

coupled with

@IF
RECEIVEDTECHNOLOGY
receiver=Firetop Mountain
technology=88
@THEN
FLAG
who=Firetop Mountain
state=off
mask=0xffffffff
TAKETECHNOLOGY
whom=Firetop Mountain
technology=88
TEXT
victory all flags should now be off
ENDTEXT
@ENDIF

A bit long winded perhaps, but worth a try.
And guess what? it works, the following events that rely on the flags being reset do now work!

I conclude that there is somekind of bug in the events. Be warned.

John Possidente is offline John Possidente
Prince
Hunt Valley, MD USA
Jun 1999
time: 00:14
Post  Old Post 16-02-2000 02:07
Edit/Delete Message Reply w/Quote
#10 Report this post to a moderator
Support Apolyton or Terrorists Win

I'm tempted to think that it's a bad interaction between checking flags in the trigger and setting flags in the action.

Waitaminute...(leafing through manual)....aha!

Page 213, under Flag and CheckFlag: "The flag and mask parameters are mutually exclusive; you can only use one or the other in any single event." (bold added).

Notice that it doesn't say "in any one trigger or action". That's the problem; you can't mix flag and mask parameters in the same event, no matter where in the event they are. So the "flag=2" in your trigger and the "mask..." in your action cannot coexist.

William Keenan is offline William Keenan
Prince
New Jersey, USA, Earth, Sol, Milky Way
Sep 1999
time: 00:14
Thumbs down  Old Post 16-02-2000 04:22 Visit William Keenan's homepage!
Edit/Delete Message Reply w/Quote
#11 Report this post to a moderator
Support Apolyton

Nice try John! But Mick's example from the Midgard scenario contradicts your theory.

@IF
CHECKFLAG
WHO=EVERYBODY
mask=0x00180000
count=2
state=on
@THEN
JUSTONCE
DELAYPERFLAG
randomize
basedelay=50
perflagdelay=20
mask=0x000003FF
TEXT
Yet another weakening of Volsang's magical bonds occurs; all of the races
begin to exhibit real fear now. Can anyone stop Volsang before he breaks
completely free?
ENDTEXT
CHANGETERRAIN
terraintype=9
map=0
exceptionmask=0x0620
maprect
44,98,86,98,86,152,44,152
PLAYAVIFILE
Scene9b.avi
FLAG
continuous
flag=21
state=on
@ENDIF

John Possidente is offline John Possidente
Prince
Hunt Valley, MD USA
Jun 1999
time: 00:14
Post  Old Post 16-02-2000 18:45
Edit/Delete Message Reply w/Quote
#12 Report this post to a moderator
Get a bigger avatar today!

Hmm...sure seems to. That Mick, always showing me up.

William Keenan is offline William Keenan
Prince
New Jersey, USA, Earth, Sol, Milky Way
Sep 1999
time: 00:14
Wink  Old Post 16-02-2000 20:58 Visit William Keenan's homepage!
Edit/Delete Message Reply w/Quote
#13 Report this post to a moderator
Support Apolyton, buy Galactic Civilizations

The moral of this story is:

quote:


don't believe what you read, even if you wrote it


[This message has been edited by William Keenan (edited February 16, 2000).]

Miner is offline Miner
Prince
of London
Jul 1999
time: 05:14
  Old Post 17-02-2000 01:58 Visit Miner's homepage!
Edit/Delete Message Reply w/Quote
#14 Report this post to a moderator
Get a bigger avatar today!

For those reading this entertaining thread but who have wisely not posted, WK is now examining the original events.txt to check my logic and ensure that there really is a bug and that I haven't just posted this nonsense for nothing.

  < Last Thread     Next Thread > Post New Thread     Post A Reply
All times are GMT. The time now is 05:14.
Apolyton Time is 00:14.
    top of page
Rate This Thread:
Forum Jump:
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
 




Contact Us - Apolyton Civilization Site - Support Us!

Building a better Apolyton through better information. Click here and take our poll!
Non-US visitors, click here!

Powered by: vBulletin Version 2.0.3
Copyright ©2000, 2001, Jelsoft Enterprises Limited.

Page generated in 0.0485 seconds (90.70% PHP - 9.30% MySQL) with 30 queries
Page Loading Time:

Support Apolyton: Amazon USA | Amazon UK | Amazon DE | Amazon FR |
Support Apolyton and get FREE PLUS, Buy from Chips&Bits: Galactic Civilizations | Galactic Civilizations: Deluxe Edition | Call to Power 2 | Civilization: The Boardgame | GURPS/ Alpha Centauri | Alpha Centauri | Civilization IV | Civilization III: Complete |


Front Page | Civilization IV | Civilization III | Civilization II | Call to Power II | Alpha Centauri | Master of Orion III
Rise of Nations | Galactic Civilizations | Galactic Civilizations II | Misc
Alt.Civs | Civ I | C:CtP I | About | News | Directory | Apolyton Store | Forums | Chat | Columns | Interviews | Newsletter
Scenario League | CSC | Clash of Civs | Spanish Site | CtP Maps | Cradle of Civ | WesW's Ctp1/2 Site | Civ3 Haven

apolyton.net | apolyton.com | civilization2.net | civilization3.net | civilization4.net | civilizationiv.info | calltopower.net | galciv.net | galciv2.net | moo3.net