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

  • #46
    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].
    Well, if it does exist it certainly isn't documented. I'll check it out.

    mines on oil goods
    I don't see anyway to check for this ?
    "

    Comment


    • #47
      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].
      I had to go back to a post made by Mr. Ogre in 1999 to figure out how to get this to work, but it works! debugslic = yes must be set. Thanks Maq.
      "

      Comment


      • #48
        Originally posted by EPW View Post
        I had to go back to a post made by Mr. Ogre in 1999 to figure out how to get this to work, but it works! debugslic = yes must be set. Thanks Maq.
        Wow, been awhile since I heard that name!
        Hi, I'm RAH and I'm a Benaholic.-rah

        Comment


        • #49
          Progress Report

          What's Done:
          Oil Resource and Oil Refinery Count. Currently each one 20 oil/fuel per turn. You can save fuel from turn to turn.

          Unit Maintenance in Oil. Each mechanized unit takes a certain amount of oil to maintain, which is subtracted at the beginning of each turn.

          If you do not have enough oil to cover your maintenance costs, damage and movement penalties occur until you have 25 oil. In other words, if your Oil Count is negative, you recover Oil by penalizing your units until you have 25 oil.

          Moving a unit one square uses up oil depending on that units "burnrate." When you run out of fuel, all your mechanized units movement points are set to zero.*

          What I am working on:
          New Messages which tell you your oil amount, Maintenance Costs, etc. The old messages are out of date. keyboard command to popup said message.

          Future:

          Increase oil/per turn if Oil resource is mined if possible.
          Modify PW based on End-Turn Oil Amount.
          Oil-trade with allies if possible.
          Use less oil if uses road/train if possible.


          *This causes the dreaded invisible unit glitch, may be revised.
          "

          Comment


          • #50
            Originally posted by EPW View Post

            *This causes the dreaded invisible unit glitch, may be revised.
            So you encountered that one too What you can do is reset the unit's moves, then you can deduct just enough movement based on unit type. How do you reset the unit's moves? I guess you could kill it and create a new one (with the same HP if damaged, or veteran).
            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


            • #51
              Another possibility is to let you keep moving, but your unit is damaged as a result.
              "

              Comment


              • #52
                (with the same HP if damaged, or veteran)
                What functions return these values?
                "

                Comment


                • #53
                  Originally posted by EPW View Post
                  What functions return these values?
                  Built-in variable unit.hp, for veteran I don't know. I can't see any function, but have you tried IsVeteran(unit)?
                  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


                  • #54
                    Wow, I fixed it without having to kill all the units.




                    Okay Okay hatschy and/or Tamerlin fixed it and I just copied.
                    "

                    Comment


                    • #55
                      So how'd you do it?
                      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


                      • #56
                        SetOrder(1, 10); //teleport command
                        AddOrder(unit, unit.location)

                        Issue the teleport command of course! It resets movement to 0.
                        "

                        Comment


                        • #57
                          Very cool EPW!
                          Hi, I'm RAH and I'm a Benaholic.-rah

                          Comment


                          • #58
                            Quick SLIC question. I run the following function at the beginning of every turn to get the oil resource and oil refinery count and it works fine. However, if I try to run it while you are playing a turn, it does not work.

                            Code:
                            messagebox 'OilResourceandRefinaryCount' {
                            	Abort();
                            	aCity = 0;
                            	oilResource = 0;
                            	refCount = 0;
                            	while(aCity < player.cities) {
                            		SetCityByIndex(1, g.player, aCity);
                                    oilResource = oilResource + CityCollectingGood(city.1,5);
                            		if(CityHasBuilding(city.1, "IMPROVE_OIL_REFINERY")) {
                            			refCount = refCount + 1;
                            		}
                            		aCity = aCity + 1;
                            	}
                            	oilProduction = oilValue * oilResource + refValue * refCount;
                            }
                            This is the trigger that activates it during the turn, though I don't see how it could cause it to fail:

                            Code:
                            messagebox 'OilInfo' {
                            
                            	Message(g.player, 'OilResourceandRefinaryCount'); 
                            	Message(g.player,'MaintenanceCost');
                            	Text(ID_OIL_INFO_A);
                            	Title(ID_OIL_INFO_TITLE);
                            	MessageType("BOMB_CABINET");
                            	
                            }
                            "

                            Comment


                            • #59
                              How is the 'OilInfo' msgbox triggered, and does 'MaintenanceCost' not fire too?
                              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


                              • #60
                                Player Trigger:
                                Code:
                                Trigger 'OilInfoButton' when (key.1.pressed)
                                {	
                                	//Triggers OilInfoScreen
                                	Message(g.player, 'OilInfo');
                                }
                                Start of turn trigger:
                                Code:
                                Trigger 'OilisGood' when (IsHumanPlayer(g.player)) {
                                	//variable resets
                                	warning = 0; //warning message
                                	oilCount = 0;
                                	check = 0; //for 'movingisbad' trigger
                                	//Calculates Unit Oil Maintanence Cost
                                	Message(g.player, 'MaintenanceCost');	
                                	//Counts Oil Resources and Refinaries, then reports total oil to player
                                	Message(g.player, 'OilResourceandRefinaryCount');
                                	//Calculates oil each player has at beginning of their turn
                                	Message(g.player, 'turnStartOil');
                                	//Punishment for not having enough fuel at beginning of turn to cover Maintanence Costs
                                	Message(g.player, 'BeginTurnPunishment');
                                	//Oil Info Message
                                	Message(g.player, 'OilInfo');
                                }
                                Yes, MaintenceCost is fired. In fact, testing show that OilInfo fires - but doesn't go into the while loop.
                                "

                                Comment

                                Working...
                                X