Announcement

Collapse
No announcement yet.

(how) Does mod_UnitAttack work?

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

  • #16
    Great to finally see someone trying to figure this out

    It's *extremely* annoying the ranged function doesn't work though, I had several uses in mind for that one should we ever have gotten in to work

    I briefly messed with this myself and so far I found out two important things:
    (1) it doesn't matter what arguments or return value you use, even when they are left out altogether the messageboxes appear. So the function (I only tested Attack, I assume Defense works the same) is *always* called during combat, regardless of what arguments value are used. The only thing you need to do is spell the function name correctly This means finding out proper arguments and return values could turn out to be tricky...
    (2) I couldn't seem to get the function to work, even with very high return values (100000) it didn't seem to make much of a difference. However, when I used the following code:
    Code:
    int_f mod_UnitAttack() {
    	
    	return 0;
    }
    The first round of combat was fought out normally, but then they units kept attacking eachother without results, as one would expect with an attack value of 0. Of course, this continued forever and closing the combat screen froze the game, as the game had entered an infinite loop. But apparently this function *does* do something...
    Administrator of WePlayCiv -- Civ5 Info Centre | Forum | Gallery

    Comment


    • #17
      Yeah, I got that too. I've only been able to get rid of a units attack or defense and not much else. Only int values can be returned and I see no change yet except for when I use 0. Maybe it's like the other mod_CanCityBuild* functions, a boolean saying you can or can't attack/defend. Hohum, on with the testing just in case . . .

      Comment


      • #18
        Yeah, that latter result is what I got as well.
        I got a weird result when I set it up to return the unit's defence value. I got hoplites that wouldn't die. It killed a tank.
        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
          So, IW, another Civ3 feature that we can import into CTP2.

          Comment


          • #20
            Administrator of WePlayCiv -- Civ5 Info Centre | Forum | Gallery

            Comment


            • #21
              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

              Working...
              X