Thread Tools
Old July 18, 2001, 19:33   #1
BRA_TiTaN
Settler
 
BRA_TiTaN's Avatar
 
Local Time: 08:39
Local Date: October 31, 2010
Join Date: Jul 2001
Location: Rio de Janeiro, Brazil
Posts: 27
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"
BRA_TiTaN is offline  
Old July 18, 2001, 21:45   #2
Dale
Emperor
 
Dale's Avatar
 
Local Time: 21:39
Local Date: October 31, 2010
Join Date: Dec 2000
Posts: 3,944
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.
Dale is offline  
Old July 18, 2001, 21:53   #3
BRA_TiTaN
Settler
 
BRA_TiTaN's Avatar
 
Local Time: 08:39
Local Date: October 31, 2010
Join Date: Jul 2001
Location: Rio de Janeiro, Brazil
Posts: 27
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"
BRA_TiTaN is offline  
Old July 19, 2001, 07:03   #4
Immortal Wombat
Apolytoners Hall of Fame
Prince
 
Immortal Wombat's Avatar
 
Local Time: 12:39
Local Date: October 31, 2010
Join Date: Dec 2000
Location: in perpetuity
Posts: 4,962
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
Immortal Wombat is offline  
Old July 19, 2001, 12:24   #5
BRA_TiTaN
Settler
 
BRA_TiTaN's Avatar
 
Local Time: 08:39
Local Date: October 31, 2010
Join Date: Jul 2001
Location: Rio de Janeiro, Brazil
Posts: 27
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"
BRA_TiTaN is offline  
Old July 19, 2001, 16:21   #6
Locutus
Apolytoners Hall of FameCiv4 SP Democracy GameCiv4 InterSite DG: Apolyton TeamBtS Tri-LeagueC4BtSDG TemplarsC4WDG Team ApolytonCivilization IV CreatorsCTP2 Source Code ProjectPolyCast Team
Deity
 
Locutus's Avatar
 
Local Time: 13:39
Local Date: October 31, 2010
Join Date: Nov 1999
Location: De Hel van Enschede
Posts: 11,702
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
Locutus is offline  
Old July 19, 2001, 20:24   #7
BRA_TiTaN
Settler
 
BRA_TiTaN's Avatar
 
Local Time: 08:39
Local Date: October 31, 2010
Join Date: Jul 2001
Location: Rio de Janeiro, Brazil
Posts: 27
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"
BRA_TiTaN is offline  
Old September 13, 2001, 16:43   #8
BRA_TiTaN
Settler
 
BRA_TiTaN's Avatar
 
Local Time: 08:39
Local Date: October 31, 2010
Join Date: Jul 2001
Location: Rio de Janeiro, Brazil
Posts: 27
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"
BRA_TiTaN is offline  
Old September 14, 2001, 00:14   #9
Pedrunn
Call to Power II Democracy Game
King
 
Pedrunn's Avatar
 
Local Time: 08:39
Local Date: October 31, 2010
Join Date: Jul 2001
Location: of Natal, Brazil
Posts: 2,555
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
Pedrunn is offline  
 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT -4. The time now is 07:39.


Design by Vjacheslav Trushkin, color scheme by ColorizeIt!.
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Apolyton Civilization Site | Copyright © The Apolyton Team