Announcement

Collapse
No announcement yet.

IW, Could you help with one of yours Slics?

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

  • #16
    Oh, yeah, sorry, its GetUnitsAtLocation, or UnitsInCell.
    Concrete, Abstract, or Squoingy?
    "I don't believe in giving scripting languages because the only additional power they give users is the power to create bugs." - Mike Breitkreutz, Firaxis

    Comment


    • #17
      It strikes me that the veteran function is never actually used in the code. I don't know how that got through...
      Add these lines:
      Code:
      HandleEvent(MoveUnits) 'MakeVeteran' pre {
                   location_t tmpLoc;
                   tmpLoc = unit[0].location;
                   tmpPlayer = unit[0].owner;
                   VeteranEffect(tmpLoc, tmpPlayer);
      }
      It strikes me too, soo how do i use the veteran fuction alone. I want to make special leaders units buildable as any other now instead of only coming after discovering an advance. Can you change the code for me again?
      "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


      • #18
        Just use this:
        Code:
        void_f VeteranEffect (location_t tmpLoc, int_t tmpPlayer)
        {
        int_t	i;
        unit_t	tmpUnit;
        int_t	tmpNum;
        int_t	numUnits;
        int_t	tmpPlayer2;
        
        	player[0] = tmpPlayer;
        	numUnits = player[0].units;
        	tmpPlayer2 = tmpPlayer;
        	if (IsPlayerAlive(tmpPlayer2)) {
        	// Make all Units non veteran, except Special Units
        		for (i = 0; i < numUnits; i = i + 1) {
        			GetUnitByIndex(tmpPlayer2, i, tmpUnit);
        			tmpNum = tmpUnit.type;
        			if (tmpNum >= 106 && tmpNum <= 112) {                           
        				ToggleVeteran(tmpUnit, 1);
        			} else {
        				ToggleVeteran(tmpUnit, 0);
        			}
        		}
        	}
        	
        	// Make all Units veterans who share the location Alexander, Robin Hood and Richard The Lion Heart
        	tmpNum = GetUnitsAtLocation(tmpLoc);
        	for (i = 0; i < tmpNum; i = i + 1) {
        		GetUnitFromCell(tmpLoc, i, tmpUnit);
        		ToggleVeteran(tmpUnit, 1);
        	}
        }
        
        
        HandleEvent(MoveUnits) 'MakeVeteran' pre {
                     location_t tmpLoc;
                     tmpLoc = unit[0].location;
                     tmpPlayer = unit[0].owner;
                     VeteranEffect(tmpLoc, tmpPlayer);
        }
        Make sure the tmpNum in the first function has the right boundaries (includes only the wonder units) and that you have not got CannotBuild lines in their units.txt entries.
        Ben
        Concrete, Abstract, or Squoingy?
        "I don't believe in giving scripting languages because the only additional power they give users is the power to create bugs." - Mike Breitkreutz, Firaxis

        Comment


        • #19
          Originally posted by Immortal Wombat
          and that you have not got CannotBuild lines in their units.txt entries.
          Ben
          Call me stupid, please . Just take the cantBuild lines off, Pedrunn. Is that so hard?
          "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

          Working...
          X