I need help with flags!

Which modifier do you use most?

  • @AND

    Votes: 0 0.0%
  • Continuous

    Votes: 0 0.0%
  • Delay

    Votes: 0 0.0%
  • Justonce

    Votes: 5 83.3%
  • Randomize

    Votes: 0 0.0%
  • Delayperflag

    Votes: 0 0.0%
  • None

    Votes: 1 16.7%

  • Total voters
    6

Katlover97

The liberal
Joined
Feb 3, 2004
Messages
101
Location
At the bottom of a bottomless pit
I need help.
I can mark flags,
:saiyan:
but I can't check them!
Here's what I do.
  1. @beginevents
  2. @debug
  3. @initflag
  4. @if
  5. Turn
  6. turn=1
  7. @then
  8. flag
  9. who=indians
  10. continuous
  11. state=on
  12. flag=0
  13. @endif
  14. @if
  15. turn
  16. turn=2
  17. @and
  18. checkflag
  19. who=indians
  20. flag=0
  21. state=on
  22. @then
  23. text
  24. show this text if my flag worked
  25. endtext
  26. @endif
  27. @endevents
    [/list=1]
    This is for Civilization 2, TOT.
    I looked the macro language up in the book that came
    with it.
    I also can't figure out how the mask option works.
    And yes, I know you cant use it in the same event as flag.
    Can any of you help?
    I even checked the report, but it didn't register that the flag was turned on.
    If i'm not using the modifier correctly, please tell me.
    :thanx:

    If anyone else has some questions, post them here!
 
:hmm: A bit of a strange suggestion perhaps, but could you add an empty line between the last "@endif" and "@endevents"... I'm pretty sure that should make it work.

I copied what you have above, but I wanted to make it a bit easier on the eye by adding capitalization and white-space between the events. That worked just fine.

Then I went back to your original (everything in lowercase, no blank lines) and that didn't work.

After a little bit more tinkering I discovered that one blank line before the @endevents made all the difference!

So I suggest you make your events files a little easier to read next time! :p
 
Thanks!:goodjob: :thanx:
Dose anyone by chance know where the map editor is in civi2 TOT?
 
Katlover97, what is it you are trying to do with the flags? (Sorry, haven't checked the ToT manual or Macto.txt in a while.)

I have to admit I'm not very familiar with the flags system but would be interested in potential scenario applications.

Good tip Mercator. (I've just never not left a space so I never ran into this problem. Good to know anyway because @DEBUG isn't specific.)

There is no Map Editor for ToT (MP figured that it wasn't worth adding it in). It's assumed that you have the Original or MGE and you create the maps using that. Map (.MP) files work using all versions. (It's the saved games that aren't compatible --there are utilities for this.)

I know there is a Random Map Generator utility program for ToT on the net --possibly even at Mercator's site (not sure).
(Mercator's 'Map Edit' is only designed for Original and MGE versions, last I checked.)

BTW, I agree with M: capitalization and spacing between each event is much easier on the eyes (the MGE Events Editor does this automatically --although that won't do you much good if you have ToT).
 
what is it you are trying to do with the flags? (Sorry, haven't checked the ToT manual or Macto.txt in a while.)

I have to admit I'm not very familiar with the flags system but would be interested in potential scenario applications.

The flags would be used to mark certain events.
Example in a revolutionary scen.: If george washington is captured by the british, then a flag for the americans is turned on. Later, if the city newyork is captured by the british, check for that flag (The one the americans got when George was captured), and if it is on, George was captured and thus cannot muster forces to get newyork back in time, and that ends the game. If the flag is off, George wasn't captured and musters enough armys to get back newyork in time. I don't think I explained that very well, so look at the flags intro at apolyton.net in more detail. Anyway, in that ^ Event, I was trying to create text on the seond turn by turning the flag on during the first turn. You can use flags for all sorts of things. Definetly look at the flags intro at apolyton.net more closely. It will help.

T.T.Y.L.
 
There is no Map Editor for ToT (MP figured that it wasn't worth adding it in). It's assumed that you have the Original or MGE and you create the maps using that. Map (.MP) files work using all versions.

Yoshi,
do you know by chance if you get the map editor when you download Cedric's MGE patch?

Also, if you download the MGE patch, can you still play using ToT without downloading someting for that?
 
Yikes... You should have posted rather than edited that map editor question... I made a map editor for Test of Time! It can be found on my site.

Oh, and yoshi/Katlover my MapEdit and the random map generator (CivMapGen by Peter Blackman) work for all versions of civ2. Both are also available on my website.

my utility website's here (just to be sure ;)): http://www.civgaming.net/mercator/mapedit
 
Thanx Mercator!
I have found the editor and I am presently downloading it.
After I UnZip the files, I may need to ask you a few questions about it, as I have had no experience with it.
T.T.Y.L.
:Thanx:
~Katlover~
 
Yoshi,
do you know by chance if you get the map editor when you download Cedric's MGE patch?

Also, if you download the MGE patch, can you still play using ToT without downloading someting for that?

Cedric's MGE download just updates the minimum files needed in order to upgrade your Original Civ2 so that you can play the latest scenarios and multiplayer. If you only have ToT, then the MGE upgrade will do you no good and if you have a version of Civ2 previous to MGE then you already have the Map Editor.

If you want to create maps, forget the Civ2 Map Editor and just use M's Map Edit --a superior program to Map Editor.

Another of Mercator's line of helpful utilities is Map Copy which you can use to modify fertility (e.g. set all tiles' fertility to zero thus AI never settles --no more AI building non-historical cities!); it's nowhere near as nice-looking as Map Edit though --not to mention that it's DOS-based.

Sorry for the mixup: since Civ2 maps work with any version, ALL map programs will work for ToT and MGE alike.


About flags:

32 flags concern the 32 actions and triggers available in ToT right?
So if you activate flag=0 then the first (ALPHACENTAURIARRIVAL) trigger (as listed in Macro.txt) can trigger. If you turn the flag 'off,' the trigger can no longer activate.
If the above is correct then it means that ALL events with that trigger/action won't work when the state is 'off.' So if the flag deactivates CREATEUNIT, the flag will deactivate ALL CREATEUNIT events in the file? It's the first time I've seriously looked over this stuff so you'll have to forgive me if I'm completely off.

Assuming I'm right, flags are bit limited aren't they (i.e. their effects are general)? It would have been better if the flags worked based on individual events (i.e. using the same system only activating/deactivating specific tirggers/actions within a specific event --starting from the top). Just a thought.

I guess since ToT isn't very popular, not a lot of civers have experience designing scenarios using flags. Flags seem to be similar to the Conditions event feature found in the Starcraft Editor for instance. Too bad MGE doesn't include this in its macro.
 
Originally posted by yoshi
Another of Mercator's line of helpful utilities is Map Copy [...]

I didn't make it! "Dusty" Reichwein did.

About flags:

32 flags concern the 32 actions and triggers available in ToT right?

Not at all! They're just 32 switches you can turn on or off (separately for each civ), so they're sort of 32 things to remember. In any event, you can turn any number of switches on or off.

Say, you could make killing two special units and capturing one particular city a way of winning a scenario. When any of these three things occur, you set one of the flags. You then also have an event that checks for all three flags, once they're all set, you win.
 
I didn't make it! "Dusty" Reichwein did.
Oops! BTW, do you know of any map utilities that can rotate maps? (I know Map Edit can invert/flip/shift maps --I don't have the latest version but I read the latest readme and as far as I can remember, it doesn't mention anything about rotating maps.) Clearly rotating is more complex than simply flipping/inverting, but it would definitely be useful for editing already existing maps (e.g. rotate Europe GM so that North faces N/NE thus including more of NW Africa and cutting out more of Persia without having to include more space for Atlantic).

They're just 32 switches you can turn on or off (separately for each civ), so they're sort of 32 things to remember. In any event, you can turn any number of switches on or off.
So when you write an event you add in which flag it switches on, then you include a list of flags that are...crap, I'm having trouble picturing it. Would it be too much trouble to ask for you to post your example in macro format? That would be the best solution --I can then just compare the two.
 
Yoshi:
If you picture the Flags like this:
00000000000000000000000000000001
flag zero* is on.

Mercator:
Would you PM me the Readme for the ToT map editor?
I looked at the readme on your website, but it was for
a different version. Also, Do you know what, and how to open, *.SPR files are? I also can't open the *.DLL files.



*the one marked with a 1.
P.S. to yoshi(Please don't use words like that. I don't know why, I just find them offensive. I'm not meaning to bite your head off.)
 
Originally posted by yoshi
Oops! BTW, do you know of any map utilities that can rotate maps?

The main reason that isn't in is because that actually requires some more complex calculations, like resizing a map (i.e. not just changing the "canvas" size), to put all the terrain right. I might someday implement that too... For now, you would have to do this by exporting the map to a bitmap, rotating the image in an image editor and importing it back to a civ2 map again.

Would it be too much trouble to ask for you to post your example in macro format? That would be the best solution --I can then just compare the two.

Yes it would. :p
Ok, Ok... ;)

Code:
@BEGINEVENTS
@DEBUG
@INITFLAG

@IF
UnitKilled
unit=Warriors
attacker=Babylonians
defender=Anybody
@THEN
Flag
Continuous
who=TriggerAttacker
state=On
flag=0
@ENDIF

@IF
UnitKilled
unit=Horsemen
attacker=Babylonians
defender=Anybody
@THEN
Flag
Continuous
who=TriggerAttacker
state=On
flag=1
@ENDIF

@IF
CityTaken
city=Rome
attacker=Babylonians
defender=Anybody
@THEN
Flag
Continuous
who=TriggerAttacker
state=On
flag=2
@ENDIF

@IF
CheckFlag
who=Babylonians
mask=0b00000000000000000000000000000111
count=3
state=On
@THEN
Text
You win!
EndText
EndGame
endscreens=On
@ENDIF

@ENDEVENTS

You should be able to test this by playing the Babylonians in a game with the Romans (just to get the city of Rome). Kill a warrior, a horseman and capture Rome (in whatever order). Each time, a switch is set. The last event checks if all those 3 are on, displays a message and shows the game stats.


Originally posted by Katlover97
Mercator:
Would you PM me the Readme for the ToT map editor? I looked at the readme on your website, but it was for
a different version.

:confused: You might be looking at the wrong thing. Download the "Test of Time Map Editor", there's a readme included in the zip file (MPRead.txt). There's no readme of it online on my website, that's for my MapEdit utility.

Also, Do you know what, and how to open, *.SPR files are? I also can't open the *.DLL files.

CivSprite can read the .spr files. It's a rather limited utility, though. It can export the images in the sprite files to bitmaps (and import them again). The readme for it is viewable online, also on my website, of course...

The best utility for the DLL files (for ToT anyway) is ResHacker:
http://www.users.on.net/johnson/resourcehacker/

There are a some limitations to what images you can load. The image dimensions and palette must remain the same.
 
P.S. to yoshi(Please don't use words like that. I don't know why, I just find them offensive. I'm not meaning to bite your head off.)
:lol: ... :confused:


Thanks for the macro example M. It's pretty clear now. (Sorry to trouble you.)

One thing: what happens if you set 'count=3' to 2 instead? Then only the first 2 events are needed to trigger the Endgame? Wouldn't that be the same as writing, 'mask=0b00000000000000000000000000000011?'
 
Yoshi, Here's a quote from macro.txt that, may help(For ToT):
Using Count, you limit the trigger to activating only if the total number of matches is exactly the number you specify.

I hope that helps.
 
CivSprite can read the .spr files. It's a rather limited utility, though. It can export the images in the sprite files to bitmaps (and import them again).

Where can I get CivSprite? Was it installed with ToT?

The best utility for the DLL files (for ToT anyway) is ResHacker

What dose it mean, "hack" into the recourses?
Can you change the images? I thought that the bmp's
did that(i.e. terrain1.bmp, terrain2.bmp, etc.).
 
I have just downloaded the CivSprite application and unZiped it. It's rather tedious going, converting sprites to bitmaps. I started a good ten minutes ago, and right now, it has only exported 343 out of 405. It's a pace I'm used to with this darned computer though.
 
I hope that helps.
Ah yes, that explains it. I should have another look at ToT's Macro. Thanks. (I just tend to work with MGE most of the time.)

(BTW, I read M's post about DLL files for ToT. What about DLL files for MGE? It would be nice to be able to alter the leader pics.)

In ToT, you can only use the @AND feature once right? It'd be neat if you could trigger different events following the capture of a certain set of cities. My question is:

How could you do the equivilant of the following using flags (and without using up all 32 switches)?

@IF
CITYTAKEN
city=Carthage
attacker=Romans
defender=Anybody
@AND
CITYTAKEN
city=Athens
attacker=Romans
defender=Anybody
@AND
CITYTAKEN
city=Alexandria
attacker=Romans
defender=Anybody
@AND
CITYTAKEN
city=Damascus
attacker=Romans
defender=Anybody
@THEN
Text
Romans win the game!
EndText
EndGame
endscreens=On
@ENDIF

[Note that there are 3 @ANDs, 4 cities, where ToT only allows 2.]
 
Originally posted by Katlover97
What dose it mean, "hack" into the recourses?
Can you change the images? I thought that the bmp's
did that(i.e. terrain1.bmp, terrain2.bmp, etc.). [/B]

The bitmaps do change graphics, but not all of them. For instance, the king's portraits, spaceship parts and diplomacy screens are located in the DLL's.

Most of the Civ2 DLL's are basically collections of images. "Hacking", in this case, simply means you change images in that collection.

Originally posted by yoshi
(BTW, I read M's post about DLL files for ToT. What about DLL files for MGE? It would be nice to be able to alter the leader pics.)

ResHacker works for MGE too, not for the earlier versions though. For those you'd need Gif Extractor, which is available, again, on my site. GifX has some more limitations though.

In ToT, you can only use the @AND feature once right? It'd be neat if you could trigger different events following the capture of a certain set of cities. My question is:

How could you do the equivilant of the following using flags (and without using up all 32 switches)?

That would work just about exactly as my previous example. Have four CityTaken events, each setting a different flag. Then a CheckFlag event that gives the final result.

It might be possible to reduce it to 3 event structures. Combining two cities per event with an @AND (not 100% sure if that works)... I think for that, you'd have to add the "Continuous" modifier to both CityTaken triggers so that the cities do not necessarily have to be taken in the same turn.

That would make 2 events with 2 cities, each setting a flag (in this case, you'd only need one flag per two cities, thanks to the Continuous modifier for CityTaken). Then the 3rd again checking those flags.

If that works, you could combine some more if it were only 3 cities. One event structure with @AND for two cities, the second with the 3rd city "@AND'ed" with the flag check of the others.

Ahem... I hope that was clear.
 
ResHacker works for MGE too, not for the earlier versions though. For those you'd need Gif Extractor, which is available, again, on my site. GifX has some more limitations though.

Right. Thanks. BTW, while on the subject of graphics, does anyone know if there nuclear explosion graphic frames can be edited? Is it located in a DLL file? (It’s odd that MP didn’t include it into icons.gif as it did the combat explosion graphics.)


It might be possible to reduce it to 3 event structures. Combining two cities per event with an @AND (not 100% sure if that works)... I think for that, you'd have to add the "Continuous" modifier to both CityTaken triggers so that the cities do not necessarily have to be taken in the same turn.


@BEGINEVENTS
@INITFLAG

@IF
Continuous
CityTaken
city=Carthage
attacker=Romans
defender=Anybody
@AND
Continuous
CityTaken
city=Athens
attacker=Romans
defender=Anybody
@THEN
Flag
who=Romans
state=On
flag=0
@ENDIF

@IF
Continuous
CityTaken
city=Alexandria
attacker=Romans
defender=Anybody
@AND
Continuous
CityTaken
city=Damascus
attacker=Romans
defender=Anybody
@THEN
Flag
who=Romans
state=On
flag=1
@ENDIF

@IF
CheckFlag
who=Romans
mask=0b00000000000000000000000000000011
count=2
state=On
@THEN
Text
Romans win!
EndText
EndGame
endscreens=On
@ENDIF

@ENDEVENTS


Tried it as written above. It works. (I didn’t realise that the EndGame action is hard-coded to delay one turn once triggered.)


If that works, you could combine some more if it were only 3 cities. One event structure with @AND for two cities, the second with the 3rd city "@AND'ed" with the flag check of the others.

Didn’t get this part.


(This would make for an interesting ‘resource’ application: if CivA loses control over x # of key Oil cities, they lose the tech with which to build more tanks or use CHANGETERRAIN to lower production output of CivA’s city Factory tiles.)
 
Back
Top Bottom