Announcement

Collapse
No announcement yet.

Hidden Nationality SLICable?

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

  • #16
    and c:
    Attached Files

    Comment


    • #17
      Rather than event 'Battle' you could try using some of the movement-related events to get the Barb unit to attack in the same turn: when CtP2 was still under development and Harlan suggested MAD as addition to the game, Mr Ogre told us that that was possible because at that time, units couldn't move outside their own turn. A few days later he reported MAD would be implemented after all since he had found a way to make units move outside their own turn. That might be key here: he may have created a new event that made units move without checking if this was legal. There are many movement related events in the game, so if you try some of these to get the unit to move into the square that should be attacked, that *might* just work...
      Administrator of WePlayCiv -- Civ5 Info Centre | Forum | Gallery

      Comment


      • #18
        This is the original news topic might be of some interest

        [QUOTE](8 July 2000, 09:34 | CtP2) That's right! CTP2 is going to model Mutually Assured Destruction! Here's what Mr. Ogre announced on our forums

        We now have a system for targeting and then auto-launching nukes when you get nuked in the main game. I had said we weren't doing anything new for nukes, but I was wrong, we are, it's in and working.

        There's still a whole lot more in that monster Nuke thread that we're not doing, but this one "little" thing is pretty cool.

        If only we had one of those alpha(?) builds to see this in action... [QUOTE]

        Now whatever happened to that idea i wonder? Any thoughts on weather it would be good to implement IF it could be done? And gives some backup that there is code there that could be put to use for the privateer but how????


        SMIFFGIG
        Oxygen should be considered a drug
        Tiberian Sun Retro
        My Mod for Tiberian Sun Webmaster of
        http://www.tiberiumsun.com

        Comment


        • #19
          Code:
          //MoveUnits(army_t, location_t, location_t)
                   //An army always moves on this event, no more legality checks at this point
          //MADLaunch(unit_t)
          //SetTarget(unit_t, city_t) Give a nuclear missile (unit) a target 
          //TargetOrder(army_t, location_t) Give a nuclear missile a target
          //INT CreateCity(owner, nearlocation, distance[, savecity])
          I've tried all those. The first one has no effect even though it says the army should move.
          The second one always gives me a serious error in the ctp.exe while executing no matter how I try. E.g I tried to just create a city at that spot to use settarget. That's all events/functions I could find in the documentation. In the NuclearWar scenario there's a function called
          Code:
          TargetNuclearAttack(1, 2, 1)
          but without knowing what the values stand for...

          Edit: Made the post a little narrower...
          Last edited by mapfi; September 9, 2002, 07:52.

          Comment


          • #20
            Played with other possibilities too, e.g. my own battle deciding algorithm. I had to use the unitrecord variable for accessing the defense value of a unit but somehow the code doesn't work exactly the way I want it yet. Has anybody any experiences with unitrecord array?

            Comment


            • #21
              Here is the Elite Unit code wich uses the unitrecord array.

              Background: This makes code makes a unit only buildable by a civ that dicovered an advance and got luck ina 1/6 random number.
              Our CTP2 version of unique units.
              Attached Files
              "Kill a man and you are a murder.
              Kill thousands and you are a conquer.
              Kill all and you are a God!"
              -Jean Rostand

              Comment


              • #22
                Thanks Pedrunn. Seems like I used it the correct way then.
                Off the Thread-Topic: Is this code included in any particular mod? I find the refugee bit pretty attractive.

                Comment


                • #23
                  Originally posted by mapfi
                  Thanks Pedrunn. Seems like I used it the correct way then.
                  Off the Thread-Topic: Is this code included in any particular mod? I find the refugee bit pretty attractive.
                  The file name looks like taken from MedPack2 and the features that it should have are also part of MedPack2.

                  So play MedPack if you want to see this in action.

                  -Martin
                  Civ2 military advisor: "No complaints, Sir!"

                  Comment


                  • #24
                    MedMod does have both codes included. But the file isnt from there since I am using it in my owns modifications. The Refugee came as bonus since i was toolazy to take it off. I am glady you liked my laziness consequences though.
                    Last edited by Pedrunn; September 9, 2002, 10:53.
                    "Kill a man and you are a murder.
                    Kill thousands and you are a conquer.
                    Kill all and you are a God!"
                    -Jean Rostand

                    Comment


                    • #25
                      Here's what I've tried now:
                      Code:
                      HandleEvent(EntrenchOrder) 'PrivateerAttack' pre {
                      unit_t tmpUnit;
                      unit_t tmpUnit2;
                      army_t tmpArmy;
                      army_t tmpArmy2;
                      location_t tmpLocation;
                      location_t tmpLocation2;
                      int_t i;
                      int_t k;
                      int_t end;
                      int_t factor;
                      int_t factor2;
                      	tmpLocation = army[0].location;
                      	if (UnitsInCell(tmpLocation) == 1) {
                      		GetUnitFromCell(tmpLocation, 0, tmpUnit);
                      		if (tmpUnit.type == UnitDB(UNIT_LONGSHIP)) {
                      			while (i <= 7 && end == 0) {
                      				GetNeighbor(tmpLocation, i, tmpLocation2);
                      				if(TerrainType(tmpLocation2) >= 10 && TerrainType(tmpLocation2) <= 17) {
                      					k = UnitsInCell(tmpLocation2);
                      					if (k == 1) {
                      						GetUnitFromCell(tmpLocation2, 0, tmpUnit2);
                      						if (tmpUnit2.owner != tmpUnit.owner && tmpUnit2.owner != 0) {
                      							unitrecord[0] = tmpUnit2.type;
                      							factor = tmpUnit2.hp*unitrecord[0].Defense;
                      							factor2 = tmpUnit.hp*30;
                      							if (factor2 > (factor*2) / 3) {
                      								KillUnit(tmpUnit2);
                      							}
                      							elseif (factor2 < factor2 / 3) {
                      								KillUnit(tmpUnit);
                      							}
                      							else {
                      								DamageUnit(tmpUnit, 5);
                      								DamageUnit(tmpUnit2, 5);
                      							}
                      						end = 1;
                      						}
                      					}
                      				}
                      				i = i + 1;
                      			}
                      		}
                      	}
                      	return STOP;
                      }
                      Funny thing is - it works exactly once and only once like it should - after that any fortify order to my longship has no effect on the enemy's ships anymore. Anybody got a clue?

                      Comment


                      • #26
                        Originally posted by mapfi
                        factor = tmpUnit2.hp*unitrecord[0].Defense;
                        This line is the problem. You can't just use unitrecord[0] out of context, it will give you a void unit record, meaning that all values from it will be 0. Some value should be assigned to unitrecord[0] before it can be used, just like with unit[0], city[0] and any other object. But since you can't assign a value to a unitrecord object yourself, you must use a different approach, namely the database functions:

                        Code:
                        factor = tmpUnit2.hp*UnitDB(tmpUnit.type).Defense;
                        Administrator of WePlayCiv -- Civ5 Info Centre | Forum | Gallery

                        Comment


                        • #27
                          Code:
                          unitrecord[0] = tmpUnit2.type;
                          You mean that part is not working? Thanks a lot, I'll try tonight.

                          Comment


                          • #28
                            Tried and had no luck - it will still execute once and only once - there must be some other flaw we didn't spot. I took out the unitrecord but now I'm not sure if it wouldn't have worked after all. Locutus did you just not see the assigning lign and it should work after all? Even if, that's not what's going wrong in this thingie. The temp variables in this handler are reinitialized each time for sure, aren't they?! What else could it be???

                            Comment


                            • #29
                              Originally posted by mapfi
                              The temp variables in this handler are reinitialized each time for sure, aren't they?! What else could it be???
                              No, the temp variables are just initialized once, that is true for every other variable, too. That saves some time. I learned this lesson the hard way as I tried to used an array to store location data and wondered why the ComImpsForAIs3.slc code still build the tile imps, even if all coditions were wrong. The current version allows now the array to grow to infinite, so far no problems weren't reported. That is actual a memory lack, and I don't know how to reduce the size of the array afterwards it has been grown dinymically. When Dave release Cradle v.1.33 I will put the latest version into the directory, I hope I don't have to modify it.

                              -Martin
                              Civ2 military advisor: "No complaints, Sir!"

                              Comment


                              • #30
                                You're saying my int_t end stays 1 after this code has been executed the first time? If so then it's clear why it won't work. But hey, what a screwed language this is!!!

                                Comment

                                Working...
                                X