Thread Tools
Old February 7, 2003, 14:34   #1
Maquiladora
Call to Power II MultiplayerCTP2 Source Code ProjectCall to Power PBEMCall to Power Multiplayer
Emperor
 
Local Time: 16:54
Local Date: November 1, 2010
Join Date: Jun 2001
Posts: 7,665
PBEM code with Goodmod
Code:
HandleEvent(BeginTurn) 'LITE_StartUp' post {
location_t startLocation;
unit_t	startUnit;
unit_t	tmpUnit;
int_t	i;
int_t	PBEMPlayer;
	for(PBEMPlayer = 1; PBEMPlayer < 33; PBEMPlayer = PBEMPlayer + 1) {
		if(IsPlayerAlive(PBEMPlayer)) {
			// movement bonus for first turn
			GetUnitByIndex(PBEMPlayer, 0, startUnit);
			AddMovement(startUnit, 900);	
			startLocation = startUnit.location;
				
			// free units
	
			for (i = 0; i < 2; i = i + 1) {
				CreateUnit(PBEMPlayer, UnitDB(UNIT_SETTLER_NOMAD), startLocation, 0, tmpUnit);
				AddMovement(tmpUnit, 900);
			}
			// bonus Gold + PW
			SetPW(PBEMPlayer, 5000);
			AddGold(PBEMPlayer, 9900);
	
			// random extra bonus advance
			i = Random(6);
			if (i == 0) {
				GrantAdvance(PBEMPlayer, AdvanceDB(ADVANCE_MASONRY));
			} elseif (i == 1) {
				GrantAdvance(PBEMPlayer, AdvanceDB(ADVANCE_IRON_WORKING));
			} elseif (i == 2) {
				GrantAdvance(PBEMPlayer, AdvanceDB(ADVANCE_HULL_MAKING));
			} elseif (i == 3) {
				GrantAdvance(PBEMPlayer, AdvanceDB(ADVANCE_TRADE));
			} elseif (i == 4) {
				GrantAdvance(PBEMPlayer, AdvanceDB(ADVANCE_DRAMA));
			} elseif (i == 5) {
				GrantAdvance(PBEMPlayer, AdvanceDB(ADVANCE_JURISPRUDENCE));
			}
		}
	}
	DisableTrigger('LITE_StartUp');
}

// bonuses for first 3 cities
HandleEvent(CreateCity) 'LITE_CityBonus' post {
city_t	tmpCity;
	tmpCity = city[0];

	if (player[0].cities <= 3) {

		// for all 3 cities
		CreateUnit(player[0], UnitDB(UNIT_HOPLITE), tmpCity.location, 0);
		CreateUnit(player[0], UnitDB(UNIT_HOPLITE), tmpCity.location, 0);
		CreateUnit(player[0], UnitDB(UNIT_WARRIOR), tmpCity.location, 0);
		CreateUnit(player[0], UnitDB(UNIT_SETTLER_ORIG), tmpCity.location, 0);
		CreateUnit(player[0], UnitDB(UNIT_CARAVAN), tmpCity.location, 0);
		// extra for capital
		if (player[0].cities <= 1) {
			PlantGood(tmpCity.location);
			// Has to be event
			Event: CreateUnit(player[0], tmpCity.location, tmpCity, UnitDB(UNIT_CARAVAN), 0); 
			Event: CreateUnit(player[0], tmpCity.location, tmpCity, UnitDB(UNIT_CARAVAN), 0); 
			Event: CreateUnit(player[0], tmpCity.location, tmpCity, UnitDB(UNIT_CARAVAN), 0); 
		}
	}
	if (g.year > 10) {
		DisableTrigger('LITE_StartUp');
	}
}

Does anyone know why when i try to use this code with SAP+Goodmod, the trigger doesnt work? I think it might have something to do with the goods created with goodmod at the start.

Its also doesnt create the extra 2 settlers, doesnt give any of the 6 random advances to any players either and doesnt create the free caravans. Basically the whole trigger doesnt work with GoodMod but i dont know how to fix it, it does work with SAP2 alone though. Ignore the new settler names, its just a workaround for a fast moving settler to start the game with. I get no errors, it just doesnt work.
__________________
Call to Power 2: Apolyton Edition - download the latest version (7th June 2010)
CtP2 AE Wiki & Modding Reference
One way to compile the CtP2 Source Code.
Maquiladora is offline  
Old February 7, 2003, 19:25   #2
Pedrunn
Call to Power II Democracy Game
King
 
Pedrunn's Avatar
 
Local Time: 12:54
Local Date: November 1, 2010
Join Date: Jul 2001
Location: of Natal, Brazil
Posts: 2,555


Are you sure you coppied it in the right file???

Other than that try to change the event name from 'LITE_StartUp' to anything else like 'MAQ_LITE_StartUp'. There is a chance of 1 in 10000000000000000000000 that there is a event with same name which causes the problem.
__________________
"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  
Old February 7, 2003, 19:57   #3
MrBaggins
CTP2 Source Code Project
King
 
MrBaggins's Avatar
 
Local Time: 15:54
Local Date: November 1, 2010
Join Date: May 1999
Posts: 1,528
perhaps if you use the same local variable names in the same event handler (BeginTurn -post) then you get problems?
MrBaggins is offline  
Old February 7, 2003, 20:54   #4
Maquiladora
Call to Power II MultiplayerCTP2 Source Code ProjectCall to Power PBEMCall to Power Multiplayer
Emperor
 
Local Time: 16:54
Local Date: November 1, 2010
Join Date: Jun 2001
Posts: 7,665
*slaps forehead 10000000000000000000000 times.

I didnt include the new script.slc in gamefile.txt. I still get a weird turn progression with it though, like this...

-- Player1 starts at "turn 0", ends turn...
-- Player2 now starts playing on "turn 1" ends turn.
-- Player1 plays "turn 1" ends turn.
-- Player2 plays "turn 2"... etc etc strange. That could be a thing with hotseat mode and GoodMod. Anyhow.
__________________
Call to Power 2: Apolyton Edition - download the latest version (7th June 2010)
CtP2 AE Wiki & Modding Reference
One way to compile the CtP2 Source Code.
Maquiladora is offline  
Old February 7, 2003, 21:36   #5
Peter Triggs
CTP2 Source Code ProjectCivilization IV Creators
King
 
Local Time: 15:54
Local Date: November 1, 2010
Join Date: Jan 2000
Location: Gone Fishin, Canada
Posts: 1,059
Are you in debug mode? I put those handlers into the Vanilla game and got 'out of bounds' errors.
Peter Triggs is offline  
Old February 7, 2003, 21:53   #6
Maquiladora
Call to Power II MultiplayerCTP2 Source Code ProjectCall to Power PBEMCall to Power Multiplayer
Emperor
 
Local Time: 16:54
Local Date: November 1, 2010
Join Date: Jun 2001
Posts: 7,665
Its on "DebugSlic=Yes" yeah, i didnt get any errors at all though.
__________________
Call to Power 2: Apolyton Edition - download the latest version (7th June 2010)
CtP2 AE Wiki & Modding Reference
One way to compile the CtP2 Source Code.
Maquiladora is offline  
Old February 8, 2003, 11:27   #7
Turambar
Call to Power II Democracy GameCivilization II PBEMCall to Power Democracy GameCTP2 Source Code Project
Prince
 
Local Time: 15:54
Local Date: November 1, 2010
Join Date: Apr 2002
Location: England
Posts: 310
Don't suppose someone's fixed diplomacy in pbem yet?

Is Maq any good at pbem btw?
Turambar is offline  
Old February 8, 2003, 11:35   #8
Maquiladora
Call to Power II MultiplayerCTP2 Source Code ProjectCall to Power PBEMCall to Power Multiplayer
Emperor
 
Local Time: 16:54
Local Date: November 1, 2010
Join Date: Jun 2001
Posts: 7,665
I think Locutus and Pedrunn were most active in the diplomacy work but stopped.

And yes he is very good at PBEM. Check your email.
__________________
Call to Power 2: Apolyton Edition - download the latest version (7th June 2010)
CtP2 AE Wiki & Modding Reference
One way to compile the CtP2 Source Code.
Maquiladora is offline  
Old February 8, 2003, 13:27   #9
Pedrunn
Call to Power II Democracy Game
King
 
Pedrunn's Avatar
 
Local Time: 12:54
Local Date: November 1, 2010
Join Date: Jul 2001
Location: of Natal, Brazil
Posts: 2,555
Quote:
Originally posted by Turambar
Don't suppose someone's fixed diplomacy in pbem yet?
Quote:
Originally posted by Maquiladora
I think Locutus and Pedrunn were most active in the diplomacy work but stopped.
I was fixing the PBEM diplomacy but i totally gave up because the PBEM has its turns broken (you cant get out of turn 0). What makes it impossible to play! So the PBEM diplomacy fix will just work for hotseat. And seems like we dont have all this search for hotseat games so i gave up.
__________________
"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  
Old February 8, 2003, 13:42   #10
Maquiladora
Call to Power II MultiplayerCTP2 Source Code ProjectCall to Power PBEMCall to Power Multiplayer
Emperor
 
Local Time: 16:54
Local Date: November 1, 2010
Join Date: Jun 2001
Posts: 7,665
Yeah not alot of people wanna play CtP2 PBEM unfortunately or hotseat. Me and Turambar just started a PBEM game with the "dummy AI" trick so we can save it inbetween our turns and send it. Not ideal but what else is there...
__________________
Call to Power 2: Apolyton Edition - download the latest version (7th June 2010)
CtP2 AE Wiki & Modding Reference
One way to compile the CtP2 Source Code.
Maquiladora is offline  
Old February 8, 2003, 13:42   #11
MrBaggins
CTP2 Source Code Project
King
 
MrBaggins's Avatar
 
Local Time: 15:54
Local Date: November 1, 2010
Join Date: May 1999
Posts: 1,528
Broken how?

Couldn't we keep a 'virtual track' of turn numbers?
MrBaggins is offline  
Old February 8, 2003, 13:55   #12
Maquiladora
Call to Power II MultiplayerCTP2 Source Code ProjectCall to Power PBEMCall to Power Multiplayer
Emperor
 
Local Time: 16:54
Local Date: November 1, 2010
Join Date: Jun 2001
Posts: 7,665
When you end turn in PBEM mode the turn count just stays at "0" and even when you end turn and go around in turns, the units (only move once), buildings (dont build) and research just stays the same, it just goes around, without actually ending the turn for any of the players.

If you can force the turn to end and clear all movement points and build/research stuff it would be great.
__________________
Call to Power 2: Apolyton Edition - download the latest version (7th June 2010)
CtP2 AE Wiki & Modding Reference
One way to compile the CtP2 Source Code.
Maquiladora is offline  
Old February 8, 2003, 14:15   #13
MrBaggins
CTP2 Source Code Project
King
 
MrBaggins's Avatar
 
Local Time: 15:54
Local Date: November 1, 2010
Join Date: May 1999
Posts: 1,528
Isn't there an 'Begin Turn' event. What happens when its invoked?
MrBaggins 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 11:54.


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