|
Martin Gühmann
|
 |
Berlin, Germany
Mar 2001 time: 06:31
|
|
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).
|