Apolyton Archive  |  Preserved copy of the Apolyton Civilization Site and its forums as they stood in September 2005. Read-only; nothing here can be posted to or replied to.  |  Forum index |  About this archive |  The 1998–2001 UBB forums
Today on Apolyton WARDELL INTERVIEW PROMO A.C.S. HISTORY CHAPTER 4 GET CIV4 /w FREE PLUS! A.C.S. PHOTO GALLERY GET A.O.M. V1.1
Apolyton Civilization Forums
main| civ2| civ3| civ4| smac| ctp2| ron| moo3| galciv| galciv2| alt| about|
ApolytonPLUS | register | search | faq | new posts | pm (-/-) | upload | members
hall of fame new! | civgroups | civgroups news | interviews | the column | radio | chat | directory | news | store | PLUS
Apolyton Civilization Forums : Powered by vBulletin version 2.0.3 Apolyton Civilization Forums > Miscellaneous > Archive > CtP2-Creation/AI/Mods/Scenarios-Archive > I need slic help
Show a Printable Version | Email This Page to Someone! | Receive updates to this thread | Report this to Apolyton news!

bottom of page
  
Author
Thread    < Last Thread     Next Thread > Post New Thread     Post A Reply
kormer is offline kormer
Chieftain

Jan 2001
time: 05:14
Post  Old Post 22-01-2001 10:24
Edit/Delete Message Reply w/Quote
#1 Report this post to a moderator
I need slic help Support Apolyton, buy Call to Power 2

Right now I am just trying to get the game to display a message to the human civilization the first turn. I have gotten a message to display for the americans, but it won't display for any other nations. If anyone can give me some insite to this that would be appreciated. Also, when trying to display messages for other nations, nothing happens at all, no errors or messages.

int_t DM_USA_civ;

HandleEvent(BeginTurn) 'DMStartGame_F' post {

DM_USA_civ = CivilizationIndex('AMERICANS');

if(IsHumanPlayer(g.player)) {
humanciv = PlayerCivilization(g.player);
if(humanciv == DM_USA_civ) {
humanciv2 = PlayerCivilization(g.player);
Message (1, 'USA_StartA');
DisableTrigger('DMStartGame_F');
}
}
}

Locutus is offline Locutus
ACS CTP1/2 Manager & Civ4 Co-Manager
Hengelo, The Netherlands
Nov 1999
time: 06:14
Post  Old Post 23-01-2001 17:32 Visit Locutus<br><img src=/forums/images/staff-icon.gif>'s homepage!
Edit/Delete Message Reply w/Quote
#2 Report this post to a moderator
Support Apolyton, buy GURPS/ Alpha Centauri

I'm not sure what you're trying to do, if you really want this message to display for the first player, you shouldn't put in a check that only displays a message if a player is American, so the code would look like this:

code:
HandleEvent(BeginTurn) 'DMStartGame_F' post { if (IsHumanPlayer(player[0])) { humanciv2 = PlayerCivilization(player[0]); Message (player[0], 'USA_StartA'); DisableTrigger('DMStartGame_F'); } }


If however you want a different message to appear depending on which player the human is, you should expand the code to add more checks for nations, like this:

code:
int_t DM_USA_civ; int_t DM_France_civ; int_t DM_China_civ; // etc. for all nations HandleEvent(BeginTurn) 'DMStartGame_F' post { DM_USA_civ = CivilizationIndex('AMERICANS'); DM_France_civ = CivilizationIndex('FRENCH'); DM_China_civ = CivilizationIndex('CHINESE'); // etc. for all nations if (IsHumanPlayer(player[0])) { humanciv = PlayerCivilization(player[0]); if (humanciv == DM_USA_civ) { humanciv2 = PlayerCivilization(player[0]); Message(player[0], 'USA_StartA'); DisableTrigger('DMStartGame_F'); } elseif (humanciv == DM_France_civ) { humanciv2 = PlayerCivilization(player[0]); Message(player[0], 'France_StartA'); DisableTrigger('DMStartGame_F'); } elseif (humanciv == DM_China_civ) { humanciv2 = PlayerCivilization(player[0]); Message(player[0], 'China_StartA'); DisableTrigger('DMStartGame_F'); } // etc. for all nations } }


Hope this helps...

kormer is offline kormer
Chieftain

Jan 2001
time: 05:14
Post  Old Post 23-01-2001 21:31
Edit/Delete Message Reply w/Quote
#3 Report this post to a moderator
Increase Your PM Length

Cool thanks a lot locutus. Thats pretty much what I had before I scrapped it all. One question, you are using player[0] there, in my coding I was using g.player where you have player[0]. Whats the difference between the 2?

kormer is offline kormer
Chieftain

Jan 2001
time: 05:14
Post  Old Post 24-01-2001 00:23
Edit/Delete Message Reply w/Quote
#4 Report this post to a moderator
Support Apolyton, buy Galactic Civilizations

Locutus, I added all those checks that you mentioned and still no dice. No error messages, but also no popups for any countries. I've also tried it with both a pre and post handler. Heres an abbreviated version of the current script...

// Scenario script for Dawn of New Millenium


#include 'DM_mod.slc' // Mod Functions
#include 'DM_msg.slc'


//World Nations
//1. United States
//2. Canada
//3. Latin America
//4. South America
//5. Brazil
//6. European Union
//7. Russia
//8. China
//9. Japan
//10. Australia
//11. Indonesia
//12. India
//13. Arabia
//14. Muslim Nations
//15. Zulu
//16. West Africa

/// Abreviations
// USA - America
// CAN - Canada
// LAT - Latin America
// SAM - South America
// BRA - Brazil
// EU - European Union
// RUS - Russia
// JAP - Japan
// CHI - China
// AUS - Australia
// POL - Indonesia
// IND - India
// ARB - Arabia
// MUS - Muslim
// ZUL - Zulu
// WAF - Western Africa

///////////////////////////////////////////////////////////////
///////////GLOBAL VARIABLES////////////////////////////////////
///////////////////////////////////////////////////////////////

int_t humanciv; // keeps track of human player
int_t humanciv2;

//////////////////////////////////////////
////Variables to track human civindex/////
//////////////////////////////////////////


int_t DM_USA_civ;
int_t DM_CAN_civ;
int_t DM_LAT_civ;
int_t DM_SAM_civ;
int_t DM_BRA_civ;
int_t DM_EU_civ;
int_t DM_RUS_civ;
int_t DM_JAP_civ;
int_t DM_CHI_civ;
int_t DM_AUS_civ;
int_t DM_POL_civ;
int_t DM_IND_civ;
int_t DM_ARB_civ;
int_t DM_MUS_civ;
int_t DM_ZUL_civ;
int_t DM_WAF_civ;


HandleEvent(BeginTurn) 'DMStartGame_F' post {

// Inizatializes variables to track civ index
DM_USA_civ = CivilizationIndex('AMERICANS');
DM_CAN_civ = CivilizationIndex('CANADIANS');
DM_LAT_civ = CivilizationIndex('MEXICO');
DM_SAM_civ = CivilizationIndex('NATIVE_AMERICAN');
DM_BRA_civ = CivilizationIndex('BRAZIL');
DM_EU_civ = CivilizationIndex('ENGLISH');


if (IsHumanPlayer(player[0])) {
humanciv = PlayerCivilization(player[0]);
if (humanciv == DM_USA_civ) { humanciv2 = PlayerCivilization(player[0]); Message(player[0], 'USA_StartA'); DisableTrigger('DMStartGame_F');
} elseif (humanciv == DM_CAN_civ) {

humanciv2 = PlayerCivilization(player[0]); Message(player[0], 'CAN_StartA'); DisableTrigger('DMStartGame_F');
} elseif (humanciv == DM_LAT_civ) {

humanciv2 = PlayerCivilization(player[0]); Message(player[0], 'LAT_StartA'); DisableTrigger('DMStartGame_F');
} }

}

Locutus is offline Locutus
ACS CTP1/2 Manager & Civ4 Co-Manager
Hengelo, The Netherlands
Nov 1999
time: 06:14
Post  Old Post 24-01-2001 01:15 Visit Locutus<br><img src=/forums/images/staff-icon.gif>'s homepage!
Edit/Delete Message Reply w/Quote
#5 Report this post to a moderator
Full PM-box? Change here!

Hmm, odd. I don't see any reason why this shouldn't work. Try replacing player[0] with a user-defined variable, like below. I don't see why it should make a difference but that's how I always do it. (See code below)

The difference between player[0] and g.player is that g.player is the player who's turn begins and g.player is the current player. Normally this should be the same but one can imagine that a player has an extremely short turn and it's turn is over before the code processed all g.player instances of the SLIC code. If that is the case, the SLIC code may refer to player 3 while player 2 was intented by the programmer. I know, it's highly unlikely that this would ever happen but my saying is: better safe than sorry. If the tmpPlayer thing doesn't work, you could consider using g.player instead, though I don't think it will make much of a difference.

A last resort would be to use 1 instead of player[0] or g.player when you display the message (like you did earlier), but since you're probably using this code in the modern scenario, I'm not sure if the human player is always player 1.

code:
HandleEvent(BeginTurn) 'DMStartGame_F' post { int_t tmpPlayer; tmpPlayer = player[0]; // Inizatializes variables to track civ index DM_USA_civ = CivilizationIndex('AMERICANS'); DM_CAN_civ = CivilizationIndex('CANADIANS'); DM_LAT_civ = CivilizationIndex('MEXICO'); DM_SAM_civ = CivilizationIndex('NATIVE_AMERICAN'); DM_BRA_civ = CivilizationIndex('BRAZIL'); DM_EU_civ = CivilizationIndex('ENGLISH'); if (IsHumanPlayer(tmpPlayer)) { humanciv = PlayerCivilization(tmpPlayer); if (humanciv == DM_USA_civ) { humanciv2 = PlayerCivilization(tmpPlayer); Message(tmpPlayer, 'USA_StartA'); DisableTrigger('DMStartGame_F'); } elseif (humanciv == DM_CAN_civ) { humanciv2 = PlayerCivilization(tmpPlayer); Message(tmpPlayer, 'CAN_StartA'); DisableTrigger('DMStartGame_F'); } elseif (humanciv == DM_LAT_civ) { humanciv2 = PlayerCivilization(tmpPlayer); Message(tmpPlayer, 'LAT_StartA'); DisableTrigger('DMStartGame_F'); } } }

kormer is offline kormer
Chieftain

Jan 2001
time: 05:14
Post  Old Post 24-01-2001 01:45
Edit/Delete Message Reply w/Quote
#6 Report this post to a moderator
Put an end to popups!

Thanks for the help, but I just put in the tmpPlayer coding and that gave me the same results...none.

Dale is offline Dale
King
Sir! Why do you keep clicking on me?
Dec 2000
time: 15:14
Post  Old Post 24-01-2001 02:14
Edit/Delete Message Reply w/Quote
#7 Report this post to a moderator
Got spare money?

I know this may be obvious, but you did use an #import command on your text string file in strings.txt? That's the only reason I can see for this to fail.

------------------
Author of Diplomod. The mod to fix diplomacy.

Rommell to a sub-commander outside Tobruk: "Those Australians are in there somewhere. But where? Let's advance and wait till they shoot, then shoot back."

kormer is offline kormer
Chieftain

Jan 2001
time: 05:14
Post  Old Post 24-01-2001 02:41
Edit/Delete Message Reply w/Quote
#8 Report this post to a moderator
Got spare money?

My strings are all ing scen_str.txt, which is imported in the default strings.txt file, but just to make sure I copied it into my scenario folder, same result however. Besides, if it didn't import my strings text, then it would give errors saying it can't find any strings right? Thanks for the help though dale, and always check the obvious, just because it is to you, doesn't mean it isn't obvious to someone else.

Dale is offline Dale
King
Sir! Why do you keep clicking on me?
Dec 2000
time: 15:14
Post  Old Post 24-01-2001 03:53
Edit/Delete Message Reply w/Quote
#9 Report this post to a moderator
Support Apolyton, buy Civilization 2

kormer:
Yeah, I know about the obvious things. I work on a helpdesk. You wouldn't believe some of the questions I get asked.

Had a second thought on this, in your message function, I'd try using a Show(); command to force it open. If that doesn't work you know it ain't getting to the message function and must be something to do with the caller reference.

------------------
Author of Diplomod. The mod to fix diplomacy.

Rommell to a sub-commander outside Tobruk: "Those Australians are in there somewhere. But where? Let's advance and wait till they shoot, then shoot back."

kormer is offline kormer
Chieftain

Jan 2001
time: 05:14
Post  Old Post 24-01-2001 04:18
Edit/Delete Message Reply w/Quote
#10 Report this post to a moderator
Support Apolyton, buy Galactic Civilizations: Deluxe Edition

Dale, I was using the show function, but you were right, it wasn't getting to the message function!!! I put in a mod from alexander to not allow wonders to be built, and I noticed that wasn't working. Then I decided to take the #includes out, that made all kinds of errors. Then I put them back in at the bottom of the file, and I got more errors, but not the same ones. I found a few spelling errors and such so I know it was parsing the entire file now. The error I am stuck on now is, could not find 'americans' in asset tree, and thats in reference to the civilizationindex() function. Also, is there any difference between " and '. I've noticed several different places reference civilizationindex("nation") and civilizationindex('nation'). And lastly, I'm on a roll here, where should each of my #includes be in the file? Right now I have one for diplomod, a mod for wonders, and my msgs.

Dale is offline Dale
King
Sir! Why do you keep clicking on me?
Dec 2000
time: 15:14
Post  Old Post 24-01-2001 05:59
Edit/Delete Message Reply w/Quote
#11 Report this post to a moderator
Increase Your PM Length

In reference to Diplomod, the script file directly replaces diplomacy.slc, so replacing #include "diplomacy.slc" with #include "diplomod.slc" works fine. As for other mods, it would be determined by global variable and function calls. Can't call a something if it's defined in a later file type stuff. (I think)

As to the civindex error, I got no idea.

------------------
Author of Diplomod. The mod to fix diplomacy.

Rommell to a sub-commander outside Tobruk: "Those Australians are in there somewhere. But where? Let's advance and wait till they shoot, then shoot back."

Alpha Wolf is offline Alpha Wolf
Chieftain
Prince of the Barbarians
Feb 2001
time: 05:14
Post  Old Post 24-01-2001 11:37 Visit Alpha Wolf's homepage!
Edit/Delete Message Reply w/Quote
#12 Report this post to a moderator
Remove this text

Hey Dale,
i'm trying to scan this page but no matter how long I hold it up to the screen, it just wont scan.

Sorry, worked a helpdesk before, and I WOULD believe the questions you get....LOL

------------------
History is written by the victor.

Locutus is offline Locutus
ACS CTP1/2 Manager & Civ4 Co-Manager
Hengelo, The Netherlands
Nov 1999
time: 06:14
Post  Old Post 24-01-2001 20:50 Visit Locutus<br><img src=/forums/images/staff-icon.gif>'s homepage!
Edit/Delete Message Reply w/Quote
#13 Report this post to a moderator
Support Apolyton, buy Civilization 2

For messages it shouldn't make a difference where they are imported AFAIK, but functions always have to be defined before you can use them, so you need to place or import them near the top of your SLIC files. Same goes for global variables. And yes, it makes a big difference whether you use ' or ". The savest thing to do is just to put everything in one file, so if you're not sure, that's the way to go.

  < Last Thread     Next Thread > Post New Thread     Post A Reply
All times are GMT. The time now is 05:14.
Apolyton Time is 00:14.
    top of page
Rate This Thread:
archivepost
Forum Jump:
Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is ON
vB code is ON
Smilies are ON
[IMG] code is ON
 




Contact Us - Apolyton Civilization Site - Support Us!

Building a better Apolyton through better information. Click here and take our poll!
Non-US visitors, click here!

Powered by: vBulletin Version 2.0.3
Copyright ©2000, 2001, Jelsoft Enterprises Limited.

Page generated in 0.0404 seconds (83.36% PHP - 16.64% MySQL) with 31 queries
Page Loading Time:

Support Apolyton: Amazon USA | Amazon UK | Amazon DE | Amazon FR |
Support Apolyton and get FREE PLUS, Buy from Chips&Bits: Galactic Civilizations | Galactic Civilizations: Deluxe Edition | Call to Power 2 | Civilization: The Boardgame | GURPS/ Alpha Centauri | Alpha Centauri | Civilization IV | Civilization III: Complete |


Front Page | Civilization IV | Civilization III | Civilization II | Call to Power II | Alpha Centauri | Master of Orion III
Rise of Nations | Galactic Civilizations | Galactic Civilizations II | Misc
Alt.Civs | Civ I | C:CtP I | About | News | Directory | Apolyton Store | Forums | Chat | Columns | Interviews | Newsletter
Scenario League | CSC | Clash of Civs | Spanish Site | CtP Maps | Cradle of Civ | WesW's Ctp1/2 Site | Civ3 Haven

apolyton.net | apolyton.com | civilization2.net | civilization3.net | civilization4.net | civilizationiv.info | calltopower.net | galciv.net | galciv2.net | moo3.net