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 > Call To Power II > CtP2-Source Code Project > DEBUG: Reimplementing the patch SLIC functions
Show a Printable Version | Email This Page to Someone! | Receive updates to this thread | Report this to Apolyton news!
CivGroups
CTP2 Source Code Project (59): Not a Member - Join

bottom of page
  
Author
Thread    < Last Thread     Next Thread > Post New Thread     Post A Reply
J Bytheway is offline J Bytheway
Emperor
England
Jul 2001
time: 05:31
  Old Post 10-11-2003 04:01 Visit J Bytheway's homepage!
Edit/Delete Message Reply w/Quote
#1 Report this post to a moderator
DEBUG: Reimplementing the patch SLIC functions Enter the AD-FREE zone

I said that I wanted to work on SLIC and so I thought that I should begin by reimplimenting all the missing functions.

Martin has already beaten me to the first step by inserting stubs for them all, but there's quite a lot to fill in yet.

So, I think we should coordinate our efforts so as not to duplicate work done by others. Post your requests for implementations, as well as your actual implementations, here.

For the moment I intend to simply work through those which I have seen used in mods already, filling them in as best I can. Testing them is obviously a much bigger job, and I doubt that I will do it sufficiently thoroughly. Does anyone have a good idea as to how testing might be made more easy. I was thinking that some knd of SLIC debugging system might be helpful, but I'm not sure what form it should take.

Comments welcome.

J Bytheway is offline J Bytheway
Emperor
England
Jul 2001
time: 05:31
  Old Post 10-11-2003 04:03 Visit J Bytheway's homepage!
Edit/Delete Message Reply w/Quote
#2 Report this post to a moderator
Browse Apolyton AD-FREE

Looking a little closer it seems that Martin has already filled in the details of some of the most important ones too . He has been busy.

J Bytheway is offline J Bytheway
Emperor
England
Jul 2001
time: 05:31
  Old Post 10-11-2003 04:51 Visit J Bytheway's homepage!
Edit/Delete Message Reply w/Quote
#3 Report this post to a moderator
Get a bigger avatar today!

For starters here are some functions about wonders, successfully compiled but untested:

code:
// JJB filled this function SFN_ERROR Slic_PlayerHasWonder::Call(SlicArgList *args) { if(args->m_numArgs != 2) return SFN_ERROR_NUM_ARGS; sint32 pl; if(!args->GetPlayer(0, pl)) return SFN_ERROR_TYPE_ARGS; if(pl < 0 || pl >= k_MAX_PLAYERS) return SFN_ERROR_OUT_OF_RANGE; if(!g_player[pl]) { return SFN_ERROR_DEAD_PLAYER; } sint32 wonder; if(!args->GetInt(1, wonder)) { return SFN_ERROR_TYPE_ARGS; } sint32 owner = wonderutil_GetOwner(wonder); if (owner == pl) m_result.m_int = 1; else m_result.m_int = 0; return SFN_ERROR_OK; } // JJB filled this function SFN_ERROR Slic_WonderOwner::Call(SlicArgList *args) { if(args->m_numArgs != 1) return SFN_ERROR_NUM_ARGS; sint32 wonder; if(!args->GetInt(0, wonder)) { return SFN_ERROR_TYPE_ARGS; } sint32 owner = wonderutil_GetOwner(wonder); if (owner == PLAYER_INDEX_INVALID) m_result.m_int = -1; else m_result.m_int = owner; return SFN_ERROR_OK; } // JJB filled this function SFN_ERROR Slic_CityHasWonder::Call(SlicArgList *args) { if(args->m_numArgs != 2) return SFN_ERROR_NUM_ARGS; Unit city; if(!args->GetCity(0, city)) return SFN_ERROR_TYPE_BUILTIN; sint32 wonder; if(!args->GetInt(1, wonder)) { return SFN_ERROR_TYPE_ARGS; } if (city.GetCityData()->GetBuiltWonders() & ((uint64)1 << wonder)) { m_result.m_int = 1; return SFN_ERROR_OK; } m_result.m_int = 0; return SFN_ERROR_OK; }

Martin Gühmann is offline Martin Gühmann
Emperor
Berlin, Germany
Mar 2001
time: 06:31
Post  Old Post 10-11-2003 21:17 Visit Martin Gühmann's homepage!
Edit/Delete Message Reply w/Quote
#4 Report this post to a moderator
Support Apolyton buy from Amazon

quote:
Originally posted by J Bytheway
Testing them is obviously a much bigger job, and I doubt that I will do it sufficiently thoroughly. Does anyone have a good idea as to how testing might be made more easy.


Of course there is a more easy way to test it:

Add this to your scen_str.txt in your ..\ctp2_data\english\gamedata\ folder:

quote:

TEST_MESSAGE_FOR_MAE "0: {int0}, 1: {int1}, 2: {int2}, 3: {int3}, 4: {int4}, 5: {int5}, 6: {int6}, 7: {int7}, 8: {int8}, 9: {int9}, 10: {int10}, 11: {int11}, 12: {int12}, 13: {int13}, 14: {int14}, 15: {int15}, 16: {int16}, 17: {int17}, 18: {int18}, 19: {int19}, 20: {int20} 21: {int21}, 22: {int22}, 23: {int23}, 24: {int24}, 25: {int25}, 26: {int26}, 27: {int27}, 28: {int28}, 29: {int29}"


And put into your scenario\.slc in your ..\ctp2_data\default\gamedata\ folder: (I know John you already know this but I also explain it to those who aren't so familiar with the CTP2 file structure.)

code:
int_t int0; int_t int1; int_t int2; int_t int3; int_t int4; int_t int5; int_t int6; int_t int7; int_t int8; int_t int9; int_t int10; int_t int11; int_t int12; int_t int13; int_t int14; int_t int15; int_t int16; int_t int17; int_t int18; int_t int19; int_t int20; int_t int21; int_t int22; int_t int23; int_t int24; int_t int25; int_t int26; int_t int27; int_t int28; int_t int29; HandleEvent(ArmyClicked)'MG_Testing'post{ } HandleEvent(CityClicked)'MG_TestingH'post{ } MessageBox'MGMAETestMessage'{ Text(ID_TEST_MESSAGE_FOR_MAE); Duration(1); MessageType("GIFT"); }


You just need to fill the Event handlers that asign the return values of your functions to some of the ints. And add the message box call to the handler and you should see something. Alternativly you can use the files from the attachment, there I have included lots of examples how to test slic code in general. Of course the stuff is outcommented.

-Martin

Attachment: slictest.zip
This has been downloaded 1 time(s).

  < Last Thread     Next Thread > Post New Thread     Post A Reply
All times are GMT. The time now is 05:31.
Apolyton Time is 00:31.
    top of page
Rate This Thread:
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.0278 seconds (87.15% PHP - 12.85% MySQL) with 36 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