Announcement

Collapse
No announcement yet.

Look this code.

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

  • Look this code.


    trigger ' DOR_T_Give_Gold' when (IsHumanPlayer(g.player) && (player.1.gold <=200000))
    {
    AddGold(g.player,1000000);
    }

    This line programming enter in script.slc
    but this not working.
    In the hour of loading ctp2, appears an error message in the script.slc (sintax error)

    I found in site (gamezone.com)

    Which is the problem of that command?
    - TiTaN
    "Come to know Brazil"
    "The Amazonian and the Swampland is from Brazil"

  • #2
    Further to the email I sent you, CTP2 doesn't use triggers does it? I'm almost certain of it. Anyways, try this:

    Code:
    HandleEvent(BeginTurn) 'Give_Gold' pre {
         int_t tmpPlayer;
         tmpPlayer = g.player;
         if(IsHumanPlayer(tmpPlayer)) {
              AddGold(tmpPlayer, 1000000);
         }
    }
    Remember, untested, untried, unguarenteed.

    Comment


    • #3
      Code is Wrong.

      Thank you for the answer, Dale!

      But that command, will he make the one what?

      Now, because those site, that they publish that command, is showing the wrong command?

      Now, do I use Diplomod 3.6, in which file I do place that command?
      - TiTaN
      "Come to know Brazil"
      "The Amazonian and the Swampland is from Brazil"

      Comment


      • #4
        That code is an example of how to "cheat" in CTP1.

        Dale, that code gives gold every turn. The original cheat gives gold only when you have nearly run out.

        *checks documentation*

        There is no way of getting player.gold in CTP2? That isn't very good
        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


        • #5
          I am only selling the codes.

          But that I already knew. But the page was publishing as code for CTP2.

          Now, Dale, answer me my questions. Please.
          Was I giving a glance, and was I thinking, will it be that it is possible to do a code, for every time that you are below A hundred thousand of Gold, you receive other Five hundred thousand?
          - TiTaN
          "Come to know Brazil"
          "The Amazonian and the Swampland is from Brazil"

          Comment


          • #6
            Yep, that's CtP1 code, it won't work for CtP2. BRA_TiTaN, do you happen to have the exact URL where you found that code?

            Actually, Dale, triggers are still used in CtP2 but they are only useful for UI-events, so they only have a very limited value (though it's always good to have them of course).

            To check a players gold value, you can use the function PlayerGold(player), presuming it works So to make the code BRA_TiTaN wants, Dale's code should be adapted like this:

            Code:
            HandleEvent(BeginTurn) 'Give_Gold' pre {
                 int_t tmpPlayer;
                 tmpPlayer = g.player;
                 if(IsHumanPlayer(tmpPlayer) && PlayerGold(tmpPlayer) < 100000) {
                      AddGold(tmpPlayer, 500000);
                 }
            }
            BRA_TiTaN, you can basicly put this file in any file that ends with *.slc (if it doesn't work for a certain file, try another; it should always work with script.slc and scenario.slc).
            Administrator of WePlayCiv -- Civ5 Info Centre | Forum | Gallery

            Comment


            • #7
              Dale, your code worked perfect.
              But I will alter the value, because it is very loud.
              A million gold for turn is a lot of thing.
              When I was in the 50 tuns, I didn't know what to do provided money.....

              Locutus, Your code I didn't still test, but he will work.
              That is it more right. Because the person, would not be full of gold


              I thank all for the answer and attention.

              Locutus, I have the exact site, alias they are two.
              I will post here later. When I see in the History of the Browser
              - TiTaN
              "Come to know Brazil"
              "The Amazonian and the Swampland is from Brazil"

              Comment


              • #8
                Pedrunn, Faz um codigo pra mim, so que com public wokd (PW) por favor.
                Valeu cara.
                - TiTaN
                "Come to know Brazil"
                "The Amazonian and the Swampland is from Brazil"

                Comment


                • #9
                  I am not a programer so i don not know how to make codes.
                  But i got this one from a MM2 file that adds a small amount of PWs at the beginning of the game for some turns.

                  Code:
                  HandleEvent(NextStrategicState) 'ChangeHumanMayorStrategy' pre 
                  {
                  	// increase PW reserve for human players
                  	int_t db_index;
                  	int_t ss_priority;
                  	db_index = StrategyDB(STRATEGY_LARGE_PW_RESERVE);
                  	ss_priority = 500;
                  
                  	if (db_index >= 0 && IsHumanPlayer(player[0]))
                  	{
                  		ConsiderStrategicState(player[0], ss_priority, db_index);
                  	}
                  }
                  "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