Thread Tools
Old January 22, 2001, 15:01   #1
Jerk
Chieftain
 
Jerk's Avatar
 
Local Time: 03:51
Local Date: October 31, 2010
Join Date: Nov 2000
Location: Green Bay, WI USA
Posts: 81
Can anyone explain the mod_functions?
Can anyone explain the mod_functions? I can see in the senarios that come with the game what a few of them need and do but the others don't seem to be documented in any way. Much help would be appreciated for all of them. What arguements does each require, what do they do, what are the return values? Here is the list of mod_ functions aparantly built into the game:
mod_CanPlayerHaveAdvance
mod_CanCityBuildUnit
mod_CanCityBuildBuilding
mod_CanCityBuildWonder
mod_CityHappiness
mod_UnitAttack
mod_UnitRangedAttack
mod_UnitDefense

Thanks
Jerk is offline  
Old January 23, 2001, 02:17   #2
heardie
Prince
 
heardie's Avatar
 
Local Time: 20:51
Local Date: October 31, 2010
Join Date: Aug 1999
Posts: 684
some (all) of these aer not built in, and they are contained in ag_mod.slc, and the respective files for the other scenarios.
heardie is offline  
Old January 23, 2001, 09:01   #3
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: 11:51
Local Date: October 31, 2010
Join Date: Nov 1999
Location: De Hel van Enschede
Posts: 11,702
You can find examples of the first 4 in the alexander scenario (and possibly others), they determine if a player can have a certain advance and if cities can build a certain unit/building/wonder. The others, I haven't seen in action yet and I suspect they aren't implemented and simply don't do anything. If anyone knows anything about those, I'd love to know too...
Locutus is offline  
Old January 24, 2001, 05:53   #4
Jerk
Chieftain
 
Jerk's Avatar
 
Local Time: 03:51
Local Date: October 31, 2010
Join Date: Nov 2000
Location: Green Bay, WI USA
Posts: 81
Thanks guys, I was looking for info on the last 4.

Herdie: I was under the impression that they were built in functions that get automatically called. In the senarios I can't find anything that really triggers them. The last 4 I found near the first few in the ctp2.exe file. It would be great if they were in fact implemented in the game and just happened to not be used in the senarios that came with the game. Guess we'll never know (insert activision whining here)
Jerk is offline  
Old January 24, 2001, 11:41   #5
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: 11:51
Local Date: October 31, 2010
Join Date: Nov 1999
Location: De Hel van Enschede
Posts: 11,702
Yes, they are indeed called automatically. I found the last 4 in the ctp2.exe as well but I never got to actually trying them out. Who says we'll never know if they are implemented or not? The only reason I didn't experiment with them yet is because that's only chapter 9 of my SLIC documentation and I'm currently working on chapter 5 I don't need Activision when it comes to SLIC, I can figure it all out on my own just as well (though a little help would make things a hell-of-a-lot easier...)
[This message has been edited by Locutus (edited January 24, 2001).]
Locutus is offline  
Old January 24, 2001, 17:09   #6
Jerk
Chieftain
 
Jerk's Avatar
 
Local Time: 03:51
Local Date: October 31, 2010
Join Date: Nov 2000
Location: Green Bay, WI USA
Posts: 81
A little help as to what those functions need, what they do, and what they are supposed to return would be a huge bonus. I suppose one can play around with it and see what it does or what errors it creates.

On another note Locutus, did you see my last post in the creating natural disasters with slic thread?
quote:


Is it possible to access the player built in variables for a civ that is not player[0]? With this quake mod I would like
to message the human player if a quake hits another civilization. Any attempts to do this so far have resulted in slic
syntax or out of bounds errors. To do this I would like to use the results of CellOwner() when its >= 0 like in my
previous post. If I try to use player[tmpCellOwner].country_name I get out of bounds errors. I get a syntax error if
I try player.tmpCellOwner.country_name. forcing player[0] = tmpCellOwner doesnt cause a slic error when it does
player[0].country_name but it also doesn't work (it's not getting set to the country name at all). I am probably
overlooking something simple. Help appreciated.



How does one use the player array in an event for players other than player[0]. Any time I try to use anything other than player[0] I get a slic error that the array is out of bounds.
Jerk is offline  
Old January 24, 2001, 19:17   #7
Dale
Emperor
 
Dale's Avatar
 
Local Time: 19:51
Local Date: October 31, 2010
Join Date: Dec 2000
Posts: 3,944
What I used to scan through the number of players was a for loop, then a player[1] = command.

Code:
for(count = 0; count < NumOfPlayers; count = count + 1) {
     player[1] = count;
     // this should force player[1] to whatever player you want.
     // player[0] I feel should always reference the current player whose turn it is.
}
------------------
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."
[This message has been edited by Dale (edited January 24, 2001).]
[This message has been edited by Dale (edited January 24, 2001).]
Dale is offline  
Old January 30, 2001, 07:22   #8
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: 11:51
Local Date: October 31, 2010
Join Date: Nov 1999
Location: De Hel van Enschede
Posts: 11,702
No, I seem to have missed that post, sorry about that. Sometimes I'm so busy with all kinds of stuff I have to leave the forums for a few days and try to catch up on everything when I get back, but when I'm catching up I can't always read through everything very carefully and sometimes overlook a few paragraphs or posts.

Dale is basicly correct, by default most events only give player[0] a value. Some events also use player[1], but if you use higher numbers it's not likely they will contain a valid value. So to use these array-elements, give them a value yourself first. The way you do it, if tmpCellOwner is 7, you try to read player[7] which by default doesn't exist. Like you suggested yourself, the way to get tmpCellOwner in a player variable is 'player[3] = tmpCellOwner;' and then use player[3].country_name where-ever you need it (3 can be any other value as well but I tend to use values that are by default unused - better safe than sorry).
Also, keep in mind that player[0].country_name returns a string and that strings are usually only useful as part of messages (in the textfiles), they can't really be used in other SLIC functions or anything (or at least not officially).
Locutus 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 05:51.


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