Announcement

Collapse
No announcement yet.

[C4:AC][Programming] Resources for the Python Language

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

  • [C4:AC][Programming] Resources for the Python Language

    Python is freely available at:
    The official home of the Python Programming Language



    Useful introduction:



    Excellent resource page with many other links:

  • #2
    All hail Locutus...

    Comment


    • #3
      Wow indeed!
      -- What history has taught us is that people do not learn from history.
      -- Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.

      Comment


      • #4
        Nice to have a sneak-look at the SDK API :-)

        Python scripting will not suffice for most of our mod though...
        no sig

        Comment


        • #5
          Eh. Scripting can be a lot more powerful than you'd think.

          I can already see that the python scripting will be plenty powerful enough for:
          Orbitals
          Ecodamage
          Planetbusters
          Nerve Gas
          And a bunch of other stuff...

          What I don't think can be done so easily...
          Unit Workshop
          Psi Combat

          But something like the Planet buster is really easy. Just use the "Unit Victory" event, if the winning unit is a planetbuster, iterate over all units and cities in the area and kill() them, then change the terrain type in the area. It's a good sdk .

          Comment


          • #6
            What I don't think can be done so easily...
            Unit Workshop
            Psi Combat
            I dunno. Actually, I think Psi Combat might be pretty easy to add. (but won't have a chance to confirm till I see the actual game....on Friday )

            Comment


            • #7
              Hi All,

              just E-Mailed out a sampling of cIV Python files to those whose E-Mail address I have. If there is something more specific you guys want let me know and I can hunt it down for you.
              What I will do starting tomorrow night is start to document all the files in the various folders/ disks. FYI in case you think there is something else that should come first.


              D

              Comment


              • #8
                Hey D, I didn't get a copy of the example Python files... emails were listed in signup thread. (here too, for ease of reference )

                gertlex at gmail dawt com

                eric at osagesoftware dawt com
                I once was a slave to the Alderbaran 2 project!
                Now I shall work towards cIV:AC!... Oh Wait, that's dead too...
                It's Nword like 'lord' and 'sword'

                Comment


                • #9
                  Any python from the supplied scenarios/mods would be nifty.

                  Comment


                  • #10
                    What I don't think can be done so easily...
                    Unit Workshop
                    Psi Combat
                    Do I need to repeat ideas again and again?

                    We really need some 'idea/solution database'

                    Soren himself said how to do it - UI=python, parts = C++ (promotion abilities + strenghts)

                    Psi = special promotion ability (might be harder than the usual ones, but nothing big)
                    -- What history has taught us is that people do not learn from history.
                    -- Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.

                    Comment


                    • #11
                      Originally posted by binTravkin

                      Psi = special promotion ability (might be harder than the usual ones, but nothing big)
                      Sorry, don't mean to muddy the waters too much by intruding, but I think implementing PSI combat will require a little more than a special promotion ability. Actually, I think it'll have nothing to do with a special promotion ability (aside from increasing chances in PSI combat and capture chances).

                      You'll probably have to append (or override) the OnCombatCalc event. The capture code will look simlair to whatever's in place for capturing workers; the psi combat based on the normal combat script, but using unit Level rather than unit Strength, with a bonus for attackers and any PSI promotions worked into the equation.

                      (btw blake: There must be a way to determine unit type, otherwise capturing workers and bonuses verse certain unit types wouldn't work. Only question is if there's a way to determine unit Level as a subsitute for moral.)

                      If the combat script works the way I think it does, you'll mostly be copying and pasting.

                      Comment


                      • #12
                        You'll probably have to append (or override) the OnCombatCalc event. The capture code will look simlair to whatever's in place for capturing workers; the psi combat based on the normal combat script, but using unit Level rather than unit Strength, with a bonus for attackers and any PSI promotions worked into the equation.
                        You're right on the appending/capturing thing - I was not saying but I am expecting that we will be overwriting the combat init a bit.

                        Something like this:

                        PSI = [strenght = 1 * morale * (1 + modifiers)].

                        one of the modifiers then be the psi attack-defense difference.
                        -- What history has taught us is that people do not learn from history.
                        -- Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.

                        Comment


                        • #13
                          (btw blake: There must be a way to determine unit type, otherwise capturing workers and bonuses verse certain unit types wouldn't work. Only question is if there's a way to determine unit Level as a subsitute for moral.)
                          I'm talking about creating new unit-types on the fly, supplying base strength and attributes (like cost), mesh & skin data, AI 'hints' and finally making it available to be selected as a build.

                          Comment


                          • #14
                            Originally posted by Lord Nword
                            Hey D, I didn't get a copy of the example Python files... emails were listed in signup thread. (here too, for ease of reference )
                            Done this morning.


                            Originally posted by Lord Nword
                            Any python from the supplied scenarios/mods would be nifty.
                            I believe several of the files were from the scenarios. What I plan on doing is categorizing in an Excel spreadsheet the subdirectory infrastructure as well as exactly what files are in each folder. You can then see exactly where each of the files I sent came from, as well as being able to see if there are some other files from different directories you'd like me to send out. Sound like a good plan?


                            D

                            Comment

                            Working...
                            X