Announcement

Collapse
No announcement yet.

Slic

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

  • #76
    Originally posted by stankarp
    I have printed copies of most things from the 'Resources for Modmakers'. bUt there is so much there for an amateur programmer but I am getting better.
    I can certainly understand that. It's just that the combination of your attempt to use an event and a function and your unfamiliarity with the GameOver function got me thinking: wouldn't want you to miss out on any useful info...

    Good to see you're making progress though
    Administrator of WePlayCiv -- Civ5 Info Centre | Forum | Gallery

    Comment


    • #77
      Only by dogged perserverance

      Comment


      • #78
        And I occassionaly find an error in someone else's code, or, if I can't understand it, cut out all the bits I don't understand and then put in bits I do understand till it works

        Comment


        • #79
          Stankarp,

          It looks like you are doing cool stuff with SLIC any chance you can just post your SLIC files only so others can take a look at. I havent found anythinglike a SLIC library for (potential) modders to go through to get ideas etc.
          Formerly known as "E" on Apolyton

          See me at Civfanatics.com

          Comment


          • #80
            If you see this Stankarp.
            In a mod I tried I had it where a unit built roads that acted like forts. it extended the boundaries and it was great when I wentto war and pillaged roads it started reducing the enemys territory and I built roads in its place. So I'm looking to make an improvent maybe with a small mark or flag to allow capture territory in view.

            2) on your migrant, I was thinking that using mapfi and pendrun religion slic to make nationality and if a player uses a migrant that "attacks" by adding one foriegn population to a city it can eventualy make the city more ethnically different and if the city revolts then it may join the other civ. Its better than culture flipping in Civ3.




            Originally posted by stankarp
            "I wish there was a way to "capture" teritory with units or if anything certain improvements (not related to pop) would increase the control of your territory."

            Forts and Watchtowers extend borders, but I cant remember if watchtowers were in the original or SAP games.

            In my mod I introduced a new unit, the MIGRANT for transferring population from city to city. It's basically a very low value combat unit that cuses a pop point when built, then returns the pop point if disbanded in a city. I aded a cost of 250 gold for the function and extended that to all settler/nomad types.

            In addition, I created a new tile improvement, the BORDER FORT, if you disband a migrant in the open inside existing territory and have 100 gold and 100-250 pw, you get a border fort which is like a watchtower, extends borders, but has no defence.
            Formerly known as "E" on Apolyton

            See me at Civfanatics.com

            Comment


            • #81
              Has anyone ever used the 'AttachRobot' or 'DetachRobot' handlers?

              I tried them a couple of times and they appear to do nothing, i.e., not what the slic manual says they should do.

              Thanks for any help.

              Comment


              • #82
                Originally posted by stankarp
                Has anyone ever used the 'AttachRobot' or 'DetachRobot' handlers?

                I tried them a couple of times and they appear to do nothing, i.e., not what the slic manual says they should do.

                Thanks for any help.
                I tried them, but however they seemed not to work properly. Sometimes I got an effect sometimes I didn't got one. At least from the source code I know that it has only an effect for player 0 or 1 to 9.

                I usually switch to the Barbarian player and use the /rnd command to let the AIs play.

                Well that's for the chat window commands.

                For the slic function, its source code looks ok. And if the network is inactive there shouldn't be a problem. But of course there might be a problem that I cannot see by just looking on the code.

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

                Comment


                • #83
                  I'm looking to do slic where if you have a tile imp outside your city radius then it just gives you PW or gold. The idea here is that you can set up imps by building a colony tile imp but each turn it givesgold or PW. I looked in Stan's code and didnt see anything like that

                  I drafted this:
                  Code:
                  HandleEvent(BeginTurn) 'FindOilPW' post {
                  	int_t	tmpPlayer;
                  	tmpPlayer = thePlayer;
                  	int_t i;
                  	int_t	j;
                  
                  	for(i=0; i < GetMapWidth(); i = i + 1){
                  		for(j=0; j < GetMapHeight(); j = j + 1){
                  			MakeLocation(tmpLoc,i,j);	// scan map for locations
                  
                  			if (TileHasImprovement(tmpLoc, TerrainImprovementDB(TILEIMP_OIL_REFINERY))){
                  				if(CellOwner(tmpLoc)== player[0]){		// and owned
                  					AddPW(player[0], 500);
                  				}
                  			}
                  		}
                  	}

                  BUT i think checking each turn will really slow the game down. How do I create an array so that everytime I build a tileimp outside the radius it adds the imp to it and everytime it is pillaged it subtracts it. Is it by an array or should I keep a score and then just multiple the score? Any recomendations?
                  Formerly known as "E" on Apolyton

                  See me at Civfanatics.com

                  Comment


                  • #84
                    I looked in Stan's code and didnt see anything like that
                    By E.

                    ?? Look in my disasters.slc file, this is precisely what my outposts do. In addition to acting as a normal tile imp if in a city radius, they also gather some gold and/or public works as well, regardless of location (as long as they are in your owned territory). Used inconjunction with border forts or watch towers, outposts let you use any, and potentially EVERY, resource on the land map

                    With public works you need to use this type of code to add PW.
                    player[0]=CellOwner(tmpLoc); ppw = player[0].publicworkslevel;
                    ppw = ppw + 20;
                    SetPW(player[0],ppw);

                    A warning, when I was setting this up, I had trouble with the slic and eventually gave up in frustration. At that time I was using "colony" as the tile improvement. I tried changing it all to "outpost" and everything worked. Do not know why, it was a long time ago.

                    Comment


                    • #85
                      Thanks Stan,

                      That stuff is exactly what i was looking for. I guess I overlooked it because it was in disasters and not in a tileimp slic file.

                      I havent fired up AoM or any game in awhile but I cant recall if the Ai builds outposts. I dont think it does...if I'm wrong how did you get it to do it?



                      and for those that can help here is a draft of my gift code, I know STan wasnt for it, but I tend to try to build up AI and do balance of power (when I actually play) so a gift code works for me. But I'm not sure about the war part is this right?
                      Code:
                      HandleEvent(DisbandUnit) 'GiftUnit' post {
                      
                      location_t	UnitLoc;
                      unit_t	tmpUnit;
                      	
                      	unitLoc = unit[0].location;
                      	player[0] = unit[0].owner;
                      	player[1]= CellOwner(unitLoc )
                      	tmpUnit0=unit[0];
                      
                      	If(player[1] != 0) {
                      		if (!AtWarWith(player[1],i){
                      			if(CellOwner(unitLoc ) > 0 && CellOwner(unitLoc ) != player[0].owner){
                      				KillUnit(tmpUnit);
                      				CreateUnit (player[1], tmpUnit, unitLoc, 0, tmpDist);
                      			}
                      		}
                      	}
                      }
                      Formerly known as "E" on Apolyton

                      See me at Civfanatics.com

                      Comment


                      • #86
                        I havent fired up AoM or any game in awhile but I cant recall if the Ai builds outposts. I dont think it does...if I'm wrong how did you get it to do it?
                        By making them tile improvements, the AI builds them automatically anyway. Hex noted than in AOM V 1.00, the AI public works cheat meant the AI could spam the map with outposts which are quiet powerful. So we greatly reduced the ai pw cheat. I found it not uncommon for the ai to have 500,000 plus in pw it did not use because of the pw cheat and the fact the ai could allocate up to 30% on pw. I reduced that to 20%.

                        If you look in the disasters code,

                        Code:
                        			if(CellOwner(tmpLoc)>1 && HasGood(tmpLoc)>=0	//ai tiles with good and no outpost
                        			&& g.year > 100
                        			&& !TileHasImprovement(tmpLoc, TerrainImprovementDB(TILEIMP_OUTPOST))){
                        				player[0] =CellOwner(tmpLoc);
                        				ppw = player[0].publicworkslevel;
                        				if (ppw > 2500){
                        				Event:CreateImprovement(player[0], tmpLoc, TerrainImprovementDB(TILEIMP_OUTPOST), 0);
                        				}
                        			}
                        This also helps the ai build outposts on goods it owns.

                        In this line of your code, you have not defined i anywhere.

                        "if (!AtWarWith(player[1],i){"

                        Replace i with player[0].

                        Comment

                        Working...
                        X