 |
|
lozina
|
|
Mt. Kisco, NY USA
Mar 2000 time: 05:14
|
|
is there anyone out there who can give me a list of classes with their functions and variables used by the game? in order to write good scenarios you need to use SLIC which is just c++ and any moderate level programmer can use it- its just knowing the classes. in particular im looking for city_t class functions and unit_t class functions.
also any info on how "mod_CanPlayerHaveAdvance()" works would be appreciated... does the program automatically check this function if you put anything in or do you have to make a call to this function somewhere else???
hopefully a ctp2 programmer will find this post!
|
|
|  |
 |
|
Locutus
|
|
ACS CTP1/2 Manager & Civ4 Co-Manager
|
 |
Hengelo, The Netherlands
Nov 1999 time: 06:14
|
|
He, thanks for mentioning my site, phenyl I'm afraid I haven't updated the SLIC part in months though (it isn't called RIP for nothing ).
However, I'm currently working on extensive documentation for SLIC2, which will (hopefully) make it understandable for everyone, even for people without programming experience. Also, after the patch is released, Activision has promised to give out documentation as well, which will no doubt prove invaluable.
In the meantime, the documentation on SLIC1 is still very useful and also, if you have any questions, feel free to ask me: I've been working with SLIC2 for several months now (though it has undergone quite some changes in that time), so if I can't help you, most likely nobody can (well, except for the Activisioners of course) 
Though I have only very limited experiences with C++ myself (still using either regular C or Java (or VB)), I wouldn't say SLIC is just C++, but it does resemble it as far as syntax goes. I've found that saying that it's 'just C++' only deters people with little or no programming-experience from experimenting with SLIC, which is unjustified 'cause I believe anyone could learn it.
One difference between C++ and SLIC is that SLIC doesn't have real classes. What you refer to as classes are in fact no more than structs: objects with several variables attached to them. They can't have their own functions or whatever. All functions in the game are 'regular' functions (the majority of which are documented in the SLIC documentation Mr Ogre wrote for CtPI).
The mod_CanPlayerHaveAdvance() and similar functions are really one of the most exciting new features of SLIC2. It indeed works as you describe: they're checked automaticly, just use it the same way it's used in the Alexander scenario and it will give you unpresidented power over what people can and can't build or research.
To get a full list of all functions, variables and events you should simply open up ctp2.exe in a hex-editor and perform a search on known functions and events (such as BeginTurn or mod_CanPlayerHaveAdvance). That should give you full lists of all these and even some, limited, info on some of them. Of course, I already did this and if you'd like I could post these lists tonight once I get home.
[This message has been edited by Locutus (edited December 13, 2000).]
|
|
|  |
 |
|
lozina
|
|
Mt. Kisco, NY USA
Mar 2000 time: 05:14
|
|
phenyl,
yes that would be cool... im still trying to get a feel for how exactly slic works and how it and the program relate. but id be glad to share knowledge- after all two minds work better then one right? hey email me maybe u have AIM or icq so we can talk in realtime!
"lozina@cyburban.com"
Locotus: im currently trying to implement my idea on giving certain units prerequisite buildings. (like in order to build a fighter that city must have an airport + factory etc... whatever is rational unilke the current tech tree!!!) It's a pretty simple thing to do using mod_CanCityBuildUnit if i can figure out how to activate it... i also have lots of other cool ideas for ctp2 i cant wait to learn all the triggers and handlers so i can start on a mod. the thing is- i made a necessary scenario substructure under the ctp2 directory and put in only one file in \default\gamedata as mymod.slc (i assume the game uses default txt files for all other data u do not include under scenario subdirectories) in this slic file is a simple bit of code i copied off the nuclear scenario:
"int_f mod_CanCityBuildBuilding(city_t theCity, int_t theBuilding)
{
if (theBuilding == BuildingDB(IMPROVE_AIRPORT)) {
return 0;
} else {
return 1;
}
}
"
i then copied one of my old savegames into the \scenarioname directory and saved it as savegame.c2g- and ran the scenario expecting that i cannot build airports anymore (just to test that mod_ function) but it dosent work. do i need to make include statements in some file or do i need to make another slic file with something like HandleEvent(Building Buiding) or whatever its called? thanks for any info i really appreciate it! feel free to mail me too instead of replying on this forum. ill load up the exe on my hex editor now and see if i can find all the names (thats a good idea!)
|
|
|  |
 |
|
lozina
|
|
Mt. Kisco, NY USA
Mar 2000 time: 05:14
|
|
paul i love you! stupid me i was wondering what that "reload slic" button was for in the editor window! yeah i started a new game and its ok- now i can move on! thanks for pointing that out buddy
|
|
|  |
 |
|
lozina
|
|
Mt. Kisco, NY USA
Mar 2000 time: 05:14
|
|
yes thats the hard part ive been thinking about. There's the BuildListSequences file i can edit,and the buildlists themselves. i still need to study the ai's building system thoroughly... =\
|
|
|  |
All times are GMT. The time now is 05:14. Apolyton Time is 00:14. |
top of page
|
| archivepost |
|
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
|
|
|
|
|
|