Announcement

Collapse
No announcement yet.

[CREATION] How do you think a WW II Era only units would work?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #31
    If player one isn't playing...player 2 will receive two messages(at least one of which incorrect), assuming the AI doesn't trigger the unit.selected event. This will only occur on the first turn and only if player 1 isn't playing, which is highly unlikely. Otherwise it should work perfectly.
    "

    Comment


    • #32
      Did you have any luck using only the title to display the date, as it's larger? I can't remember if you can give different strings for that, but I'm sure it can be done in a roundabout way.

      You can use Show(); so it pops up straight away too.

      Also maybe we shouldn't use this in the current game, just to keep all our slic synchronised.
      Call to Power 2: Apolyton Edition - download the latest version (12th June 2011)
      CtP2 AE Wiki & Modding Reference
      One way to compile the CtP2 Source Code.

      Comment


      • #33
        Yes, I used Title. Now I'll look at Show();

        "Also maybe we shouldn't use this in the current game, just to keep all our slic synchronised. "

        "

        Comment


        • #34
          Originally posted by EPW View Post
          Yes, I used Title. Now I'll look at Show();
          Oh yeah I didn't notice
          Call to Power 2: Apolyton Edition - download the latest version (12th June 2011)
          CtP2 AE Wiki & Modding Reference
          One way to compile the CtP2 Source Code.

          Comment


          • #35
            I added Show() to the code in post #30.
            "

            Comment


            • #36
              Originally posted by EPW View Post
              Are there any player-made units that could be added?
              There are plenty, non-animated, but plenty.

              I wanted to use the brown Machine Gunner from CtP2, but the sprites made by Activision for CtP2 are in a new version of the sprite maker, and don't work with CtP1.
              Call to Power 2: Apolyton Edition - download the latest version (12th June 2011)
              CtP2 AE Wiki & Modding Reference
              One way to compile the CtP2 Source Code.

              Comment


              • #37
                Oil Unit Support Slic

                I've wrote a SLIC mod for strategic resources: namely oil upkeep for tanks. It can easily be appended so other units are dependent oil or any other resource.

                1 oil resource supports 20 tanks. If you do not have enough oil penalties will ensue:

                10 over the limit:
                -1 Movement points for all tanks
                20 over the limit:
                -2 Movement points
                30 over the limit:
                -3 Movement points
                Up to 3 damage for all tanks per turn
                40 over the limit:
                -4 Movement points
                Up to 6 damage for all tanks per turn
                50 over the limit:
                -5 Movement points
                Up to 10 damage for all tanks per turn
                50+ over the limit:
                -5.5 Movement points
                Up to 12 damage for all tanks per turn.

                There is a new message which tells you how many tanks you can support, and warning messages when you go over the limits.

                Here's the code and files(includes date and settler slic):

                Spoiler:
                Code:
                //****************KILL SETTLERS**********************
                trigger 'WW2PBEM_NoSettlersAlive' when (unit.built && unit.type == UnitType("UNIT_SETTLER")) {
                	KillUnit(unit);
                }
                
                //****************DATE BUTTON**********************
                trigger 'TInitVars' when (g.player || unit.selected) {
                	initial_year = g.year;
                	last_checked_year = g.year;
                	year = 1941;
                	month = 12;
                	Message(g.player, 'The Date');
                	oilCount = 0;
                	while(aCity < player.cities) {
                		SetCityByIndex(1, g.player, aCity);
                        oilCount = oilCount + CityCollectingGood(city.1,5);
                		aCity = aCity + 1;
                	}
                	Message(g.player, 'Oil Count');
                	DisableTrigger('TInitVars');
                }
                
                trigger 'WW2PBEM_Date' when (IsHumanPlayer(g.player)) {
                	
                	if(g.year > last_checked_year && g.year > initial_year) {
                		if(month < 12)
                		{
                			month = month + 1;
                		} elseif(month == 12) {
                			month = 1;
                			year = year + 1;
                		}
                		last_checked_year = g.year;
                	}
                	Message(g.player, 'The Date');
                }
                
                messagebox 'The Date' {
                	if(month == 1) {
                		SetString(1,ID_JANUARY);
                	} elseif(month == 2) {
                		SetString(1,ID_FEBRUARY);
                	} elseif(month == 3) {
                		SetString(1,ID_MARCH);
                	} elseif(month == 4) {
                		SetString(1,ID_APRIL);
                	} elseif(month == 5) {
                		SetString(1,ID_MAY);
                	} elseif(month == 6) {
                		SetString(1,ID_JUNE);
                	} elseif(month == 7) {
                		SetString(1,ID_JULY);
                	} elseif(month == 8) {
                		SetString(1,ID_AUGUST);
                	} elseif(month == 9) {
                		SetString(1,ID_SEPTEMBER);
                	} elseif(month == 10) {
                		SetString(1,ID_OCTOBER);
                	} elseif(month == 11) {
                		SetString(1,ID_NOVEMBER);
                	} elseif(month == 12) {
                		SetString(1,ID_DECEMBER);
                	}
                	
                	if(year == 1941 || year == 0) {
                		Title(ID_REAL_DATE_FO);
                	} elseif(year == 1942) {
                		Title(ID_REAL_DATE_FT);
                	} elseif(year == 1943) {
                		Title(ID_REAL_DATE_FTR);
                	} elseif(year == 1944) {
                		Title(ID_REAL_DATE_FF);
                	} elseif(year == 1945) {
                		Title(ID_REAL_DATE_FFI);
                	}
                	
                	MessageType("INFECT_CITY");
                	Show();
                }
                
                //****************OIL COUNT**********************
                
                Trigger 'OilisGood' when (IsHumanPlayer(g.player)) {
                	aCity = 0;
                	oilCount = 0;
                	while(aCity < player.cities) {
                		SetCityByIndex(1, g.player, aCity);
                        oilCount = oilCount + CityCollectingGood(city.1,5);
                		aCity = aCity + 1;
                	}
                	Message(g.player, 'Oil Count');
                	
                	tCount = UnitCount(g.player, UnitType("UNIT_TANK"));
                	tDifference = tCount - (20 * oilCount);
                	if((20 * oilCount) < tCount) {
                		aUnits = 0;
                		while(aUnits < player.totalunits) {
                			SetUnitByIndex(1, g.player, aUnits);
                			if(unit.type == unitType("UNIT_TANK")) {
                				if(tDifference < 10) { 
                					AddMovement(unit.1, -100);
                				} elseif(tDifference < 20) { 
                					AddMovement(unit.1, -200);
                				} elseif(tDifference < 30) { 
                					AddMovement(unit.1, -300);
                					DamageUnit(unit.1, Random(3));
                				} elseif(tDifference < 40) { 
                					AddMovement(unit.1, -400);
                					DamageUnit(unit.1, Random(6));
                				} elseif(tDifference < 50) { 
                					AddMovement(unit.1, -500);
                					DamageUnit(unit.1, Random(10)); 
                				} elseif(tDifference >= 50) { 
                					AddMovement(unit.1, -550);
                					DamageUnit(unit.1, Random(12)); 
                				}
                			}
                			aUnits = aUnits + 1;
                		}
                		Message(g.player,'Warning');
                	}
                }
                
                messagebox 'Oil Count' {
                
                	if(oilCount == 0) {
                		Text(ID_OIL_ZERO);
                	} elseif(oilCount == 1) {
                		Text(ID_OIL_ONE);
                	} elseif(oilCount == 2) {
                		Text(ID_OIL_TWO);
                	} elseif(oilCount == 3) {
                		Text(ID_OIL_THREE);
                	} elseif(oilCount == 4) {
                		Text(ID_OIL_FOUR);
                	} elseif(oilCount == 5) {
                		Text(ID_OIL_FIVE);
                	} elseif(oilCount == 6) {
                		Text(ID_OIL_SIX);
                	} elseif(oilCount == 7) {
                		Text(ID_OIL_SEVEN);
                	} elseif(oilCount == 8) {
                		Text(ID_OIL_EIGHT);
                	} elseif(oilCount == 9) {
                		Text(ID_OIL_NINE);
                	} elseif(oilCount >= 10) {
                		Text(ID_OIL_MAX);
                	}
                	Title(ID_OIL_SUPPORT);
                	MessageType("BOMB_CABINET");
                }
                
                messagebox 'Warning' {
                	if(tDifference < 10) { 
                		Text(ID_WARN_A);
                	} elseif(tDifference < 20) { 
                		Text(ID_WARN_B);
                	} elseif(tDifference < 30) { 
                		Text(ID_WARN_C);
                	} elseif(tDifference < 40) { 
                		Text(ID_WARN_D);
                	} elseif(tDifference < 50) { 
                		Text(ID_WARN_E); 
                	} elseif(tDifference >= 50) { 
                		Text(ID_WARN_F); 
                	}
                	Title(ID_WARNING);
                	MessageType("BOMB_CABINET");
                	Show();
                }


                And the new scen_str.txt:

                Spoiler:
                Code:
                REAL_DATE_FO "[string.2.name],1941."
                REAL_DATE_FT "[string.2.name],1942."
                REAL_DATE_FTR "[string.2.name],1943."
                REAL_DATE_FF "[string.2.name],1944."
                REAL_DATE_FFI "[string.2.name],1945."
                JANUARY "January"
                FEBRUARY "February"
                MARCH "March"
                APRIL "April"
                MAY "May"
                JUNE "June"
                JULY "July"
                AUGUST "August"
                SEPTEMBER "September"
                OCTOBER "October"
                NOVEMBER "November"
                DECEMBER "December"
                OIL_ZERO "You are working 0 oil resources. You can't build any Tanks."
                OIL_ONE "You are working 1 oil resource. You can build up to 20 Tanks." 
                OIL_TWO "You are working 2 oil resources. You can build up to 40 Tanks." 
                OIL_THREE "You are working 3 oil resources. You can build up to 60 Tanks."
                OIL_FOUR "You are working 4 oil resources. You can build up to 80 Tanks." 
                OIL_FIVE "You are working 5 oil resources. You can build up to 100 Tanks." 
                OIL_SIX "You are working 6 oil resources. You can build up to 120 Tanks." 
                OIL_SEVEN "You are working 7 oil resources. You can build up to 140 Tanks." 
                OIL_EIGHT "You are working 8 oil resources. You can build up to 160 Tanks." 
                OIL_NINE "You are working 9 oil resources. You can build up to 180 Tanks."
                OIL_MAX "You are working 10 or more oil resources. You can have an unlimited number of Tanks."
                OIL_SUPPORT "Oil Unit Support"
                WARNING "Warning!"
                WARN_A "You have exceeded the number of mechanized units you can support. Your units can no longer function at peak efficiency(-1 Movement Points). You must acquire new sources of oil or disband some of your units or the problem may worsen."
                WARN_B "You have exceeded the number of mechanized units you can support. Your units are now deteriorating at a rapid rate(-2 Movement Points). You must acquire new sources of oil or disband some of your units or the problem may worsen."
                WARN_C "Some of your units are now experiencing random mechanical failures. Your army will fall apart if something isn't done. You must acquire new sources of oil or disband some of your units or the problem may worsen. (-3 Movement Points, minor random damage)"
                WARN_D "What was once a magnificant fighting force is now turning into a junk yard. Something must be done at once to stem the tide(-4 Movement points, moderate random damage)"
                WARN_E "Something must be done NOW. Invade the Middle East or face defeat. (-5 Movement points, heavf random damage)"
                WARN_F "You are screwed. Better luck next time.(-5.5 Movement Points, Severe random damage)"


                And the files,rename scenario.slc.txt to scenario.slc and put it in WorldWar2PBEM/scen0000/default\gamedata\. (Don't use it for our current game of course):
                Attached Files
                "

                Comment


                • #38
                  "You are screwed. Better luck next time" nice. Gonna try it now
                  Call to Power 2: Apolyton Edition - download the latest version (12th June 2011)
                  CtP2 AE Wiki & Modding Reference
                  One way to compile the CtP2 Source Code.

                  Comment


                  • #39
                    Looks great. The only change I would make so far is in the wording of:

                    "You are working 2 oil resources. You can build up to 40 Tanks."

                    to:

                    "You are working 2 oil resources. You can support up to 40 Tanks without penalty."

                    Now you just need to extend it to fighters, battleships, destroyers, and maybe Troop ships.

                    Also some ideas to expand this (if you wanted to):

                    - Each nation starts with an oil reserve number, this reserve is built up, or depleted, depending on oil consumption, and oil being worked.
                    - Oil is consumed each time a specific unit moves one square.
                    - Perhaps reserves (that add a lump sum to your reserves one time only) can also be captured with certain cities, maybe cities with refineries.
                    - Some trigger would be needed to pop up the oil summary window on command.
                    - Mined oil gives more.
                    Call to Power 2: Apolyton Edition - download the latest version (12th June 2011)
                    CtP2 AE Wiki & Modding Reference
                    One way to compile the CtP2 Source Code.

                    Comment


                    • #40
                      As far as I can tell, there is no way to print out variables. This means you wouldn't know your exact oil count, which could be annoying.

                      Also, we are either going to need a lot more oil or lower oil support costs significantly if we are going to use it for other units.
                      "

                      Comment


                      • #41
                        "You are working 2 oil resources. You can build up to 40 Tanks."

                        to:

                        "You are working 2 oil resources. You can support up to 40 Tanks without penalty."
                        The original idea was to prevent them from being built after you got the max. But I think these penalties are better. I'll make the change for the next version.
                        "

                        Comment


                        • #42
                          "- Oil is consumed each time a specific unit moves one square."

                          I really want to implement this, but I'm not sure unit.moved works this way.

                          Edit: I checked it, and it does work that way!
                          Last edited by EPW; February 28, 2009, 05:02.
                          "

                          Comment


                          • #43
                            Okay, since counting unit moves is possible, I am going to revise the oil system in the following way:
                            All Mechanized units will have a small maintenance cost in oil deducted every turn.
                            Exp: 1 for each tank, 3 for a battleship.
                            When a Unit moves a space, it will use fuel.
                            Exp: 1 for each tank, 3 for fighter, 5 for Battleship.

                            If you do not have enough oil to cover the maintenance, there will be an HP hit.
                            If you do not have enough fuel to move, you won't beable to move!

                            To help you keep track of your fuel supply, I am hoping to use a Barbarian city to use as a counter by adding and subtracting population.
                            "

                            Comment


                            • #44
                              Originally posted by EPW View Post
                              As far as I can tell, there is no way to print out variables. This means you wouldn't know your exact oil count, which could be annoying.
                              Really? Have a look at some of the slic mods in the downloads section. I'm pretty sure user variables are used in messages there like [var.value].

                              Also, we are either going to need a lot more oil or lower oil support costs significantly if we are going to use it for other units.
                              Or increase the value of each good. Could also use oil refinery building and mines on oil goods to further increase supply. Perhaps even PW tax could add interest to your current oil reserve, say +1% for each 10% pw tax. Like creating synthetic fuel.

                              Also each nation should start with a big oil reserve, at least enough to get them through a year or two. After that you're reliant on supply. If the Germans have moved their Tanks and Fighters everywhere but gained no ground (and captured no reserves), they're screwed after two years.
                              Call to Power 2: Apolyton Edition - download the latest version (12th June 2011)
                              CtP2 AE Wiki & Modding Reference
                              One way to compile the CtP2 Source Code.

                              Comment


                              • #45
                                Originally posted by Maquiladora View Post
                                Really? Have a look at some of the slic mods in the downloads section. I'm pretty sure user variables are used in messages there like [var.value].



                                Or increase the value of each good. Could also use oil refinery building and mines on oil goods to further increase supply. Perhaps even PW tax could add interest to your current oil reserve, say +1% for each 10% pw tax. Like creating synthetic fuel.

                                Also each nation should start with a big oil reserve, at least enough to get them through a year or two. After that you're reliant on supply. If the Germans have moved their Tanks and Fighters everywhere but gained no ground (and captured no reserves), they're screwed after two years.
                                MAQ

                                I really love your ideas here, sound much more reasonable, increase production on an already taxed supply source, makes sense, and as a further note, probably would be hard, but if a say mine on oil was destroyed/pillaged it would take longer to rebuild, as in real life.

                                Not sure if it could be worked, unless somehow tied into same criteria as when "scorched earth" a.k.a. a tile becoming dead, where you have to first terraform a tile to workable then build an improvement, but now as I type this, how could you keep the oil source?

                                I would have to defer back to you sir!

                                Gramps "trying to help"
                                Hi, I'm RAH and I'm a Benaholic.-rah

                                Comment

                                Working...
                                X