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
Originally posted by yoshi
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.)

Yep... Nuke is in there too... You might want to have a look at my "Hacking! Changing The Civilization2 In-Game Graphics" guide in the reference section of my website... The download version has a complete listing of all images in the DLL files, what they do and where they are. It's a list for the FW version, but it should at least be similar for ToT.

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

:goodjob: A little strange though, you put the Continuous before the CityTaken, didn't know that worked too.


Didn’t get this part.

:D

Let me try again...

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.

Code:
@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
CheckFlag
who=Romans
mask=0b00000000000000000000000000000001
count=1
state=On
@THEN
Text
Romans win!
EndText
EndGame
endscreens=On
@ENDIF

@ENDEVENTS

That's what I had in mind... (didn't test it)

(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.)

Great idea...
 
Let me try again...
Got it this time. Neat trick...now to see if it works. ;)

It's a list for the FW version, but it should at least be similar for ToT.
That's fine --I use both FW/MGE and ToT.

(I wonder why they put the combat graphics in icon.gif and not the nuke? Well, doesn't matter: there are probably reasons for all the weird things MP did in Civ2.)

A little strange though, you put the Continuous before the CityTaken, didn't know that worked too.
That was an assumption on my part. NOTE: I did the test in one turn (i.e. as Romans, captured all cities in same turn), so the Continuous modifier may have been ignored and I wouldn't have known --serves me right for not paying attention to procedure in those high school biology Labs. :D

Great idea...
This is only the beginning... I'll post more in my Events Thread. :)


[If the ToT source code were ever released, it would be awsome if you could MOD the number of @ANDs allowable by the macro to unlimited. Think about it, you could have 40 CityTaken triggers (39 @ANDs) in one event and only take up 1 of the 32 available flags!]
 
I had understood that there were thirty two different flags for each civ.? I am currently working on a "Tremors" Mod pack.
I was wondering if there was an easier way to edit the animations?
 
You should be able to use 32 flags for each civ because of the 'who' parameter which determines to whom the flags apply right?

I just downloaded CivSprite from Mercator's site. It's a neat little program.

A few things I found out about ToT using this program:

You get 6 frames for attack, 5 frames for death, 4 frames for standing and 12 frames for moving. Each of these in 5 different directions; N, NE, E, SE, S --SW, W, NW are mirrored, hence the reversing of the unit (.gif) image when moving westward. Although it saves quite abit of memory, this looks kind of stupid if the unit is asymmetrical (e.g. Warrior hols spear in right hand when attacking in the original 5 directions but then switches to his left hand when attacking west).

The only way that I can think would be easier to use the program is if the .img files were separate from the .msk files so you can 'flip' through the .img files without the .msk files interfereing.

I found it easier to place the different actions (i.e. attack, move, stand, die) into separate directories (folders) when working on them. Spearating animations for each direction into files also helps.

To literally draw the new animated unit, assuming you're using MSPaint, I can only suggest that you trace over the already existing generic unit formes (i.e. infantry, armor, cavalry, artillery, ships, etc.) and make your own changes (kind of lame but that's all I can think of).

If I were you, I wouldn't bother with the Resource.spr animations (they're not as generic as the unit files which all use the same number of frames/directions as far as I know --haven't checked them all though).

That reminds me: Mercator, does CivSprite with CtP's sprite files?
 
Originally posted by yoshi
I just downloaded CivSprite from Mercator's site. It's a neat little program.

:D Thanks...

You get 6 frames for attack, 5 frames for death, 4 frames for standing and 12 frames for moving. Each of these in 5 different directions; N, NE, E, SE, S --SW, W, NW are mirrored, hence the reversing of the unit (.gif) image when moving westward.

Nope... In theory anyway, there is no fixed amount of frames for anything, it can be anything you want, not to mention the mirroring, fading and looping that's possible... Unfortunately, CivSprite can't do any of that yet.

The units.bmp and static sprite file do use mirroring, but the animated sprite files do not. They have 8 different directions.

The only way that I can think would be easier to use the program is if the .img files were separate from the .msk files so you can 'flip' through the .img files without the .msk files interfereing.

Well, you can just delete all the mask files. That only means none of the units will sport their civilization colors.

I found it easier to place the different actions (i.e. attack, move, stand, die) into separate directories (folders) when working on them. Spearating animations for each direction into files also helps.

That's probably true. It's all a bit cumbersome with all those images. I do have some ideas about how I would do a next version, but that's all it is so far, ideas.

If I were you, I wouldn't bother with the Resource.spr animations (they're not as generic as the unit files which all use the same number of frames/directions as far as I know --haven't checked them all though).

The same goes for these as what I said earlier, but it is true that they're not as generic. The resource animations are a little fancier, and for now there's no way to turn on animations that aren't already there (not all resources are animated).

That reminds me: Mercator, does CivSprite with CtP's sprite files?

Nope, they just share a (rather commonly used) name. As far as I know, this sprite format is entirely made up by the ToT people.
 
The units.bmp and static sprite file do use mirroring, but the animated sprite files do not. They have 8 different directions.
But I used CivSprite to Export Unit02.spr (Warrior in the Original game) and found that there are frames for each of the 5 directions mentioned in my last post but frames for South-West, West and North-West are not there. I even play-tested this to see if the animated unit was actually mirrored and sure enough, the Warrior is carrying the spear in his left hand (i.e. the image is the exact opposite of the first 5 directions). Besides, this would explain why the units.bmp is mirrored (it seemed odd to me that designers at MP would go out of their way just to mirror the bitmap units --it's just a nice side effect).

And it makes sense: by not including those 3 extra directions, MP saves itself 81 extra frames. Assuming MP decided to use the same number of frames for each unit (it's possible that 'special' units like the Cruise Msl. use a different number of frames), that adds up to a total of extra 6480 frames (i.e. 81 extra frames per unit)! That's a lot of kilobytes saved by just using mirrors! Considering MP was cheap enough to not include so much as an Editor in ToT, it's a given that they would cut corners wherever possible IMO.

(M, I know sprite files can be given a different number of frames but since you said CivSprite can't add/remove frames yet. I take that into accountwhen I'm talk about the numebr of available frames for each unit.)

Well, you can just delete all the mask files. That only means none of the units will sport their civilization colors.
I just placed the .msk files into a separate directory. It's just that it takes time to select them all --there's no way of sorting them since they have the same name, are of the same type, size and date and there are 135 of them, for the Warrior at least.

I do have some ideas about how I would do a next version, but that's all it is so far, ideas.
Sounds good. Here's to ideas becoming reality! :)

Nope, they just share a (rather commonly used) name. As far as I know, this sprite format is entirely made up by the ToT people.
I see. The only reason why I asked is because I've seen some pretty good unit designs for CtP MODs and it would be nice to be able to convert them to ToT format --or at least convert them to bitmaps, transfer them to ToT exported sprite files (i.e. bitmaps using CivSprite), manually cut and past from one bitmap to the other and then Import the ToT bitmaps containing the CtP images back to ToT sprite format...as simple as that... :D
 
I will have to find out if that's right. I will convert the Warriors sprite.
To literally draw the new animated unit, assuming you're using MSPaint, I can only suggest that you trace over the already existing generic unit formes (i.e. infantry, armor, cavalry, artillery, ships, etc.) and make your own changes (kind of lame but that's all I can think of).
I think it's a rather good idea. I will use this for the gaboids in my "Tremors" Mod pack(I'll use the Worm from Fantasy). There are some unts that this won't work for. Such as shreikers(The pupal form of Graboids) And(I didn't come up with the name) Ass-Blasters(The adult form.)). Those look more like two-footed giant green mice.
 
And(I didn't come up with the name) Ass-Blasters(The adult form.)). Those look more like two-footed giant green mice.
I'm trying to imagine the facial expression someone who hasn't seen the two movies is making after reading that. :lol:


I think I'm going to use CivSprite in my next ToT scenario (that would be my first complete one). It's just a $hit-load of work! If I use all 80 available unit slots, it comes out to 10800 frames (27 frames in 5 directions multiplied by 80 units)!!! :eek: That's assuming M isn't able to give CivSprite the ability to add/remove frames before that. :king: Otherwise, it could take a while, heh, heh. I'll try to cut corners wherever possible.
 
I'm trying to imagine the facial expression someone who hasn't seen the two movies is making after reading that.
There were three movies.

I only count 79 actual units. The 80th sprite is for I don't know what. I still count 8 dirrections (N, NE, E, SE, S, SW, W, and NW), but maybe that's just me. Are you sure that each one has 27 frames? I am going to change Airlift to Tunnle system. Instead of being blocked by fighter planes, they are blocked by graboids. Is there a flag for fighter capabilies?

BTW, did you know that (In NewYork anyway) there is now a tremors series? It's on the Sci-Fi chanel.

I have just recently downloaded a short, not complicated lord of the rings scenario, but it just locks the game up (and gives me one of those "Illegal Opperation" numbers). All the zip included was a modified rules.txt and a *.scn file. Do you by chance know how to make it work?
 
Originally posted by yoshi
I think I'm going to use CivSprite in my next ToT scenario (that would be my first complete one).

:goodjob:


It's just a $hit-load of work! If I use all 80 available unit slots, it comes out to 10800 frames (27 frames in 5 directions multiplied by 80 units)!!! :eek: That's assuming M isn't able to give CivSprite the ability to add/remove frames before that. :king: Otherwise, it could take a while, heh, heh. I'll try to cut corners wherever possible.

Not very likely... And even if I would add that ability, if you want animations you're still going to have to make a ****load of frames. If you don't necessarily want the animations, but just the 8 facing directions, you might be satisfied enough with just editing static.spr.

Originally posted by Katlover97
I only count 79 actual units.

Counting starts at 0, so there's 80 units. The 81st is the barbarian leader. The Unit99.spr file is the train animation for when you move your units on railroads.

I still count 8 dirrections (N, NE, E, SE, S, SW, W, and NW), but maybe that's just me. Are you sure that each one has 27 frames?

Units definitely have different amount of frames, mostly around 150 frames in total...

I am going to change Airlift to Tunnle system. Instead of being blocked by fighter planes, they are blocked by graboids. Is there a flag for fighter capabilies?

I think giving units the "Air Superiority" role will give them intercepting capabilities.

I have just recently downloaded a short, not complicated lord of the rings scenario, but it just locks the game up (and gives me one of those "Illegal Opperation" numbers). All the zip included was a modified rules.txt and a *.scn file. Do you by chance know how to make it work?

I bet that's an error of the creator. Bad errors in the rules or scenario. It really depends. First to check is probably the tech tree. Make sure there aren't any loops, and the future tech can be reached... Do you have a link?
 
If you don't necessarily want the animations, but just the 8 facing directions, you might be satisfied enough with just editing static.spr.
No, no. If I do this thing, I'm going all the way. ;)

Although, if the unit is a mechanized unit I figured out a few ways to cu corners:

1. For the move animation (12 frames AFAIK), just repeat the same first 6 frames --the other 6 are nedded so that legged units can move the other leg (i.e. walk: right, left).

2. Cut frames: instead of using the Warrior's 6 attack frames, only use 3 (i.e. frames 2,4,6 are copies of frames 1,3,5). Or, you could just use frames 1,2,3 and have 4,5,6 standing (i.e. pause after each attack).

3. In addition to 1, you can simplify mechanized movement by just using the same movement frame but add slight changes (e.g. wheeles rotating, dust behind vehicle, etc.).

4. When mechanized units attack, no need to make it move too much, just add a n explosion or something (e.g. when Armor attacks, just use the same frame all 6 times only add an explosion animation near the gun --tank chassis doesn't move).

5. Standing animation: this is just extra eye candy so just use the same initial standing position (i.e. same as static.spr).

The Unit99.spr file is the train animation for when you move your units on railroads.
Never noticed that. Could be useful (I just don't like using RR most of the time because of the infinite movement --how many times have you heard that).
 
Originally posted by yoshi
No, no. If I do this thing, I'm going all the way. ;)

:D

2. Cut frames: instead of using the Warrior's 6 attack frames, only use 3 (i.e. frames 2,4,6 are copies of frames 1,3,5). Or, you could just use frames 1,2,3 and have 4,5,6 standing (i.e. pause after each attack).

Or repeat the 3-frame animation.

... I had a look at all of the animated sprites (rather tedious, extracting them all... not to mention I had to delete the masks, because there were too many files, and it all took several hundred MBs)... Anyway, the catapult (unit23) uses the least amount of frames, I think. It only have 5 directions. 10 frames for the attack, 5 for death and only one for the Idle and Move animations... You could perhaps use this unit's sprite file as a template for some mechanised units (all unit animation sprite file are interchangeable... well, except the unit99.spr).
 
Or repeat the 3-frame animation.
That too. It's just that if you did that, the Warrior would attack at x2 speed...as if he had too much coffee this morning. :D

... I had a look at all of the animated sprites (rather tedious, extracting them all... not to mention I had to delete the masks, because there were too many files, and it all took several hundred MBs)...
Holy shi...you did ALL THAT? Okay, I take back my earlier complaint about having too much work with just the Warrior. :o

It only have 5 directions. 10 frames for the attack, 5 for death and only one for the Idle and Move animations... You could perhaps use this unit's sprite file as a template for some mechanised units (all unit animation sprite file are interchangeable...

It only uses 1 frame for movement?! That's a bit cheap, even for me. ;) If I'm going to go through all the trouble of designing an animated unit, I at least want the satisfaction of seeing the wheels rotate when the unit moves! :D

I can use it as a template but I can' actually swap the sprite file with another one and just rename it as that right?

I assume that if the Catapult only uses 1 frame for movement, then the same goes for the Cannon, Artillery and Howtizer units?
 
It only have 5 directions. 10 frames for the attack, 5 for death and only one for the Idle and Move animations... You could perhaps use this unit's sprite file as a template for some mechanised units (all unit animation sprite file are interchangeable...

Wait a minute? I thought that there were movement anims. in the sprite file and the static.spr file? The ones in static.spr are for if you have the animated units flag turned off.

BTW, if, when you download a scenario, there is no requirement, will it work with ToT? Or just Classic?
 
Originally posted by yoshi
Holy shi...you did ALL THAT? Okay, I take back my earlier complaint about having too much work with just the Warrior. :o

:D Just wanted to check. ;) I deleted them all again.

I can use it as a template but I can' actually swap the sprite file with another one and just rename it as that right?

Yes you can. All unit sprite files (except unit99) are the same format. You could easily, say, use the catapult file as a template, paste in some tank graphics and use that for a new unit.

I assume that if the Catapult only uses 1 frame for movement, then the same goes for the Cannon, Artillery and Howtizer units?

:o Not sure... I don't believe so.


Originally posted by Katlover97
Wait a minute? I thought that there were movement anims. in the sprite file and the static.spr file? The ones in static.spr are for if you have the animated units flag turned off.

The unit animation sprite files contain animations for moving, dying, attacking and "standing still". The static.spr doesn't have any animations, just one image, usually for 5 different directions (the other 3 are mirrored).

If you have everything turned on, the static.spr file is used for all units on the map. the animated sprite file is only used for the currently active unit. If you turn off animation, the static.spr is still used for all units.

The units.bmp is only used if you've toggled the ".spr override" in either the rules.txt or cheat menu. The bitmap image is always used in the civilopedia, though.

BTW, if, when you download a scenario, there is no requirement, will it work with ToT? Or just Classic?

Just classic... But you should be able to convert many scenarios to ToT using Angelo Scotto's CivConverter. You can find it here:
http://www.civfanatics.com/civ2utility.shtml
 
Yes you can. All unit sprite files (except unit99) are the same format. You could easily, say, use the catapult file as a template, paste in some tank graphics and use that for a new unit.
Good idea. :)
Not sure... I don't believe so.
I just exported all the units. Artillery and Howtzer sprites use lots more frames.
Just wanted to check. I deleted them all again.
You must be using a faster way than I am. How did you separate the .msk diles from the .img files without having to do it one by one (see why I ask in previous post)? ...Unless of course you did select them one by one in which case I'm very impressed. ;)
 
Originally posted by yoshi
You must be using a faster way than I am. How did you separate the .msk diles from the .img files without having to do it one by one (see why I ask in previous post)? ...Unless of course you did select them one by one in which case I'm very impressed. ;)

I used the Windows file search. Search for all "*.msk.bmp" files in the directory you exported your sprites to. Select all and delete. Voila!
 
Ah yes, of course. Thanks for replying to such a dumb question. ;)


Okay finally here's something related directly to flags:

Remember that resource example I gave in a previous post? Well I was think of adding a Delay modifier as follows:

Note:
Terraintype=8 is 'Supply Depot' that gives extra many shields with which to maintain more units.
Terraintype=1 is Plains (default) that gives only 1 shield.

@IF
CITYTAKEN
city=Oil City
attacker=Anybody
defender=Romans
@THEN
Text
Romans lose control of Oil City! Supply Depots will run out in 3 turns.
EndText
DELAY
delay=3
@THEN
Text
Roman Supply Depots run out!
Endtext
CHANGETERRAIN
terraintype=1 [change to unproductive terrain]
maprect
x1,y1,x1,y1,x1,y1,x1,y1 (coordinates of Depot near city)
@ENDIF

@IF
CITYTAKEN
city=Oil City
attacker=Romans
defender=Anybody
@THEN
Text
Romans regain control of Oil City! Supply Depots re-stocked.
EndText
CHANGETERRAIN
terraintype=8 [change back to Depot terrain]
maprect
x1,y1,x1,y1,x1,y1,x1,y1 (same coordinates)
@ENDIF

From the example you can probably tell that by having control over 'Oil City,' the Roman civ will keep its Supply Depot terrain (the event would be repeated for each city unless you decided to use the optional Terrainmask parameter) thus being able to maintain, or at least not disband more units.

The problem:
If the Roman civ regains Oil City before the delayed event triggers, the second event will just change the square to Supply Depot (which is already there) thus there is no change. When turn 3 comes along, the delayed event will still change the Supply Depot square to Plains and you'll get the message telling you that the Romans lose Depots, even though the Romans have already regained control of Oil City.

My question:
Is there any way you can think of, possibly using flags, to prevent the delayed event from triggering once the second event (Oil city recaptured) has been triggered?

If you can find a solution...:worship:


-----------------------------------------------
Interesting note:

I've tried this event in MGE. As you know, MGE's macro doesn't include the Delay modifier. What I did was simply place an immobile unit in a remote part of the map, on a strip of land 4 tiles long. When destoryed, it triggers an event like the second event from the ToT example above.
In place of the Delay modifier, I simply use CREATEUNIT to place a Barbarian 'attacker' unit (with 'destroyed after attacking flag') 3 spaces away from the trigger unit when the Romans lose 'Oil City' and set the attacker unit to move in the trigger unit using MOVEUNIT. The attacker unit will get to the trigger unit after 3 turns and destroy it thus triggering tirggering the seconf event (Supply Depot tile removed).

The advantage here is that if the Romans retake Oil City before the attacker unit destroyes the trigger unit (before 3 turns are up), I simply use CHANGETERRAIN to chnage all squares (3) next to the trigger unit (usually takes 3 events) thus deleting the attacker unit on any one of the three land tiles before the trigger unit. Hence, the second CHANGETERRAIN event (removing Supply Depot) doesn't trigger.

...Similar in effect but ten times the work! :D

(Note that you can't set the owner to Barbarian if using MGE's Editor --you have to do it through Events.txt and use Delevent to clear the Events header.)
 
The delay modifiers cannot be affected once the count-down has begun. So the change terrain can't be prevented, nor the text message by the way! So you probably shouldn't add a delayed text message (an immediate text message, and the actual terrain change should be obvious enough)...

:hmm: I thought I might have a solution, by using flags and changing the terrain immediately back again when the right flag is set... But I got all confused when I tried to figure out what would happen if the city was lost, taken and lost again within the delay, or lost and taken twice... Gaaah!
 
:Sayan: Mercator, I have a big problem.
I just (a few days ago.) downloaded a (realy cool looking) mod pack. I converted, via civconverter, the wrath of khon scen.
But all it did was give me thatv message:confused: . Sorry it's streched. I had to strech it in photosuite III. I addmit that I havn't yet checked the rules.txt file, but I still don't see why it won't work.

:( :mad: :cry:
 
Top Bottom