Skip to content

Commit

Permalink
Scripting demo release candidate :) :) :)
Browse files Browse the repository at this point in the history
 - Hidden margin and threshold AI debug controls since they'll cause replay mismatches if used
 - In singleplayer you can switch players on F11 panel without having debug cheats on (caused an assert before)
 - Goals are checked for AIs so OnPlayerDefeated event works in town tutorial/battle tutorial

git-svn-id: svn://localhost/branches/ScriptingDemoRC@5057 a386ff7f-d321-c144-bb17-e251d28fee14
  • Loading branch information
lewinjh committed Apr 6, 2013
1 parent 747052c commit 8ee1ee2
Show file tree
Hide file tree
Showing 14 changed files with 75 additions and 18 deletions.
2 changes: 1 addition & 1 deletion Docs/Build folder instructions.txt
Expand Up @@ -14,7 +14,7 @@ Note: When extracting items from SVN folders use SVN Export (right click drag le
10. SVN export Sounds folder
11. SVN export tutorials folder
12. Compile Campaign Builder and put it in build folder as CampaignBuilder.exe
13. Compile TranslationManager (in user mode?) and put it in build folder as TranslationManager.exe
13. Compile TranslationManager (first remove '..\..\' from fWorkDir) and put it in build folder as TranslationManager.exe
14. Compile dedicated server on Windows and Linux x86 / x86_64 (KaM_Remake_Server_win32.exe, KaM_Remake_Server_x86, KaM_Remake_Server_x86_64)
15. Include music library dll (libzplay.dll or bass.dll)
16. Copy KM_TextIDs.inc from SVN into build folder (required for Translation Manager to work properly)
Expand Down
2 changes: 1 addition & 1 deletion Installer/InstallerFull.iss
@@ -1,7 +1,7 @@
; For each "Full" build there is only one thing to change: Revision

; REVISION
#define Revision 'r4179'
#define Revision 'r5057'

; These don't need to change
#define InstallType 'Full'
Expand Down
8 changes: 5 additions & 3 deletions KM_AI.pas
Expand Up @@ -286,13 +286,15 @@ procedure TKMPlayerAI.SyncLoad;
procedure TKMPlayerAI.UpdateState(aTick: Cardinal);
begin
//Check goals for all players to maintain multiplayer consistency
//AI does not care if it won or lost and Human dont need Mayor and Army management
//AI victory/defeat is used in scripts (e.g. OnPlayerDefeated in battle tutorial)
if (aTick + Byte(fOwner)) mod MAX_PLAYERS = 0 then
CheckGoals; //This procedure manages victory and loss

case fPlayers[fOwner].PlayerType of
pt_Human: begin
if (aTick + Byte(fOwner)) mod MAX_PLAYERS = 0 then
CheckGoals; //This procedure manages victory and loss
end;
pt_Computer: begin
//Human dont need Mayor and Army management
fMayor.UpdateState(aTick);
fGeneral.UpdateState(aTick);
end;
Expand Down
14 changes: 7 additions & 7 deletions KM_Defaults.pas
Expand Up @@ -27,8 +27,8 @@ interface
MENU_DESIGN_X = 1024; //Thats the size menu was designed for. All elements are placed in this size
MENU_DESIGN_Y = 768; //Thats the size menu was designed for. All elements are placed in this size

GAME_REVISION = 'r4956'; //Should be updated for every release (each time save format is changed)
GAME_VERSION = 'Scripting Demo ' + GAME_REVISION; //Game version string displayed in menu corner
GAME_REVISION = 'r5057'; //Should be updated for every release (each time save format is changed)
GAME_VERSION = 'Scripting Demo Release Candidate ' + GAME_REVISION; //Game version string displayed in menu corner
NET_PROTOCOL_REVISON = GAME_REVISION; //Clients of this version may connect to the dedicated server

SETTINGS_FILE = 'KaM_Remake_Settings.ini';
Expand All @@ -45,7 +45,7 @@ interface
FREE_POINTERS :Boolean = True; //If True, units/houses will be freed and removed from the list once they are no longer needed
CAP_MAX_FPS :Boolean = True; //Should limit rendering performance to avoid GPU overheating (disable to measure debug performance)
CRASH_ON_REPLAY :Boolean = True; //Crash as soon as replay consistency fails (random numbers mismatch)
BLOCK_DUPLICATE_APP :Boolean = False; //Do not allow to run multiple games at once (to prevent MP cheating)
BLOCK_DUPLICATE_APP :Boolean = True; //Do not allow to run multiple games at once (to prevent MP cheating)

//Implemented
MOUSEWHEEL_ZOOM_ENABLE:Boolean = True; //Should we allow to zoom in game or not
Expand Down Expand Up @@ -119,14 +119,14 @@ interface
UNLOCK_CAMPAIGN_MAPS :Boolean = False; //Unlock more maps for debug
FREE_ROCK_THROWING :Boolean = False; //Throwing a rock from Tower costs nothing. To debug throw algoritm
REDUCE_SHOOTING_RANGE :Boolean = False; //Reduce shooting range for debug
MULTIPLAYER_CHEATS :Boolean = True; //Allow cheats and debug overlays (e.g. CanWalk) in Multiplayer
DEBUG_CHEATS :Boolean = True; //Cheats for debug (place scout and reveal map) which can be turned On from menu
MULTIPLAYER_SPEEDUP :Boolean = True; //Allow you to use F8 to speed up multiplayer for debugging (only effects local client)
MULTIPLAYER_CHEATS :Boolean = False; //Allow cheats and debug overlays (e.g. CanWalk) in Multiplayer
DEBUG_CHEATS :Boolean = False; //Cheats for debug (place scout and reveal map) which can be turned On from menu
MULTIPLAYER_SPEEDUP :Boolean = False; //Allow you to use F8 to speed up multiplayer for debugging (only effects local client)
SKIP_EXE_CRC :Boolean = False; //Don't check KaM_Remake.exe CRC before MP game (useful for testing with different versions)
ALLOW_MP_MODS :Boolean = False; //Don't let people enter MP mode if they are using mods (unit.dat, house.dat, etc.)
ALLOW_TAKE_AI_PLAYERS :Boolean = False; //Allow to load SP maps without Human player (usefull for AI testing)
{Data output}
WRITE_DECODED_MISSION :Boolean = True; //Save decoded mission as txt file
WRITE_DECODED_MISSION :Boolean = False; //Save decoded mission as txt file
WRITE_DELIVERY_LOG :Boolean = False; //Write even more output into log + slows down game noticably
WRITE_WALKTO_LOG :Boolean = False; //Write even more output into log + slows down game noticably
WRITE_RECONNECT_LOG :Boolean = True;
Expand Down
4 changes: 4 additions & 0 deletions KM_FormMain.dfm
Expand Up @@ -204,13 +204,15 @@ object FormMain: TFormMain
Width = 32
Height = 13
Caption = 'Margin'
Visible = False
end
object Label6: TLabel
Left = 108
Top = 116
Width = 47
Height = 13
Caption = 'Threshold'
Visible = False
end
object chkShowOwnership: TCheckBox
Left = 8
Expand Down Expand Up @@ -260,6 +262,7 @@ object FormMain: TFormMain
ThumbLength = 14
TickMarks = tmBoth
TickStyle = tsNone
Visible = False
OnChange = ControlsUpdate
end
object tbOwnThresh: TTrackBar
Expand All @@ -274,6 +277,7 @@ object FormMain: TFormMain
ThumbLength = 14
TickMarks = tmBoth
TickStyle = tsNone
Visible = False
OnChange = ControlsUpdate
end
object chkShowDefences: TCheckBox
Expand Down
2 changes: 1 addition & 1 deletion KM_PlayerSpectator.pas
Expand Up @@ -130,7 +130,7 @@ procedure TKMSpectator.SetHighlight(Value: TObject);

procedure TKMSpectator.SetPlayerIndex(const Value: TPlayerIndex);
begin
Assert(DEBUG_CHEATS and (MULTIPLAYER_CHEATS or not fGame.IsMultiplayer) or fGame.IsReplay or fGame.IsMapEditor);
Assert((MULTIPLAYER_CHEATS or not fGame.IsMultiplayer) or fGame.IsReplay or fGame.IsMapEditor);
fPlayerIndex := Value;

if not fGame.IsReplay and not fGame.IsMapEditor then
Expand Down
2 changes: 1 addition & 1 deletion KaM_Remake.dof
Expand Up @@ -83,7 +83,7 @@ UnsafeCast=0
MapFile=0
OutputObjs=0
ConsoleApp=1
DebugInfo=1
DebugInfo=0
RemoteSymbols=0
MinStackSize=16384
MaxStackSize=2097152
Expand Down
2 changes: 1 addition & 1 deletion KaM_Remake.inc
Expand Up @@ -14,5 +14,5 @@

{$IFDEF WDC}
//Project can be compiled without madExcept features (if you dont have madExcept installed)
{.$DEFINE USE_MAD_EXCEPT}
{$DEFINE USE_MAD_EXCEPT}
{$ENDIF}
3 changes: 3 additions & 0 deletions Maps/Description.txt
Expand Up @@ -7,6 +7,8 @@ Folder contains all required map files. So far these are:
- MAP_NAME.dat which is a script file of the map
- MAP_NAME.map which is map terrain
- MAP_NAME.mi temporary file created by the game which stores the map/mission info so it is not necessary to scan the files each time. It can be safely deleted.
- MAP_NAME.script dynamic script file
- MAP_NAME.eng.libx Translation file for text used in dynamic script
other files may be included later

________________________________________________________________________________________
Expand All @@ -18,6 +20,7 @@ MAP_NAME.txt notes
SmallDesc - map description given in few words
BigDesc - large description shown in SingleMap menu when player chooses the map
SetCoop - Sets this mission as cooperative (different list in multiplayer lobby)
SetSpecial - Sets this mission as special (different list in multiplayer lobby)

- Few other options could be added (these are undecided yet, feel free to make
suggestions)
Expand Down
43 changes: 43 additions & 0 deletions MapsMP/Description.txt
@@ -0,0 +1,43 @@
Each folder represents a single map (named MAP_NAME through this document).

Folder name should match MAP_NAME

Folder contains all required map files. So far these are:
- MAP_NAME.txt which contains map properties and description shown in menu
- MAP_NAME.dat which is a script file of the map
- MAP_NAME.map which is map terrain
- MAP_NAME.mi temporary file created by the game which stores the map/mission info so it is not necessary to scan the files each time. It can be safely deleted.
- MAP_NAME.script dynamic script file
- MAP_NAME.eng.libx Translation file for text used in dynamic script
other files may be included later

________________________________________________________________________________________

MAP_NAME.txt notes

- Following options will remain and maybe get changed a little
Author - author(s) of the map
SmallDesc - map description given in few words
BigDesc - large description shown in SingleMap menu when player chooses the map
SetCoop - Sets this mission as cooperative (different list in multiplayer lobby)
SetSpecial - Sets this mission as special (different list in multiplayer lobby)

- Few other options could be added (these are undecided yet, feel free to make
suggestions)
MapDifficulty - default or restrictions or options ...
Win/DefCond - custom text conditions for win/defeat
PlayerColor - player color selector


________________________________________________________________________________________

MAP_NAME.dat notes

- Map name specified in DAT file will be ignored by KaM Remake. Instead KaM Remake
will access MAP_NAME.map from the map folder

________________________________________________________________________________________

MAP_NAME.map notes

- None yet
Binary file removed Sounds/Chat/ChatArrive_old.wav
Binary file not shown.
2 changes: 1 addition & 1 deletion Tutorials/Battle Tutorial/Battle Tutorial.dat
@@ -1 +1 @@
μ�����������μ�����������������μ���������������������μ������������������Ϊ����������������μ����������������μ������������������ά��������������������ά�����������������ά�����������������ά�����������������ά�����������������ά�����������������ά�����������������ά�����������������ά�����������������ά�����������������ά�����������������ά�����������������ά�����������������ά�����������������ά�����������������ά�����������������ά�������������������ή�����������������ή�����������������ή�����������������ή�����������������ή������������������������μ��������������������������μ���������������Ͻ����������μ���������������ϸ�����������������μ���������������Ϭ���������������μ���������������ϻ�����������������μ���������������Ϫ������������������������μ���������������Ϫ��������������������μ���������������Ϯ������������������μ���������������Ͻ���������������μ���������������ϻ������������������μ���������������ϻ������������������μ���������������ϻ������������������μ���������������ϻ��������������������������μ�����������������μ�����������������μ�����������������μ�������������������������μ��������������������������μ�������������������������μ��������������������������μ��������������������������μ�����������������������������μ������������������Ϊ����������������μ��������������μ���������������������μ����������������������������μ����������������μ���������������Ͻ����������μ���������������ϸ�����������������μ���������������Ϭ���������������μ���������������ϻ���������������μ���������������Ϫ������������������������μ���������������Ϫ��������������������μ���������������Ϯ������������������μ���������������Ͻ���������������μ���������������ϻ������������������μ���������������ϻ������������������μ���������������ϻ������������������μ���������������ϻ��������������������μ������������������������������μ������������������������������μ������������������������������������μ�����������������μ�����������������μ�����������������μ�������������������������μ�������������������������μ�������������������������μ������������������������������μ������������������Ϊ����������������μ��������������μ����������������������μ����������������������������μ����������������μ���������������Ͻ����������μ���������������ϸ�����������������μ���������������Ϭ���������������μ���������������ϻ���������������μ���������������Ϫ������������������������μ���������������Ϫ��������������������μ���������������Ϯ������������������μ���������������Ͻ���������������μ���������������ϻ������������������μ���������������ϻ������������������μ���������������ϻ������������������μ���������������ϻ��������������������μ������������������������������������μ�����������������μ�����������������μ�����������������μ�������������������������μ������������������������������μ������������������Ϊ����������������μ��������������μ����������������������μ����������������������������μ����������������μ���������������Ͻ����������μ���������������ϸ�����������������μ���������������Ϭ���������������μ���������������ϻ���������������μ���������������Ϫ������������������������μ���������������Ϫ��������������������μ���������������Ϯ������������������μ���������������Ͻ���������������μ���������������ϻ������������������μ���������������ϻ������������������μ���������������ϻ������������������μ���������������ϻ��������������������μ������������������������������������μ�����������������μ�����������������μ�����������������μ�������������������������μ������������������������������μ������������������Ϊ����������������μ��������������μ����������������������μ����������������������������μ����������������μ���������������Ͻ����������μ���������������ϸ�����������������μ���������������Ϭ���������������μ���������������ϻ���������������μ���������������Ϫ������������������������μ���������������Ϫ��������������������μ���������������Ϯ������������������μ���������������Ͻ���������������μ���������������ϻ������������������μ���������������ϻ������������������μ���������������ϻ������������������μ���������������ϻ��������������������μ������������������������������������μ�����������������μ�����������������μ�����������������μ�������������������������μ������������������������������������������������ς������Ϙ��ς���Ϙ���Ϥ��Ͻ�����Ϣ��Ϫ�����ϙ������ϼ��������ϫ���ϝ����ώ�����������������������
μ�����������μ�����������������μ���������������������μ������������������Ϊ����������������μ����������������μ������������������ά��������������������ά�����������������ά�����������������ά�����������������ά�����������������ά�����������������ά�����������������ά�����������������ά�����������������ά�����������������ά�����������������ά�����������������ά�����������������ά�����������������ά�����������������ά�����������������ά�������������������ή�����������������ή�����������������ή�����������������ή�����������������ή������������������������μ��������������������������μ���������������Ͻ����������μ���������������ϸ�����������������μ���������������Ϭ���������������μ���������������ϻ�����������������μ���������������Ϫ������������������������μ���������������Ϫ��������������������μ���������������Ϯ������������������μ���������������Ͻ���������������μ���������������ϻ������������������μ���������������ϻ������������������μ���������������ϻ������������������μ���������������ϻ��������������������������μ�����������������μ�����������������μ�����������������μ�������������������������μ��������������������������μ�������������������������μ��������������������������μ��������������������������μ�����������������������������μ������������������Ϊ����������������μ��������������μ�������������������ή������������������������μ����������������������������μ����������������μ���������������Ͻ����������μ���������������ϸ�����������������μ���������������Ϭ���������������μ���������������ϻ���������������μ���������������Ϫ������������������������μ���������������Ϫ��������������������μ���������������Ϯ������������������μ���������������Ͻ���������������μ���������������ϻ������������������μ���������������ϻ������������������μ���������������ϻ������������������μ���������������ϻ��������������������μ������������������������������μ������������������������������μ������������������������������������μ�����������������μ�����������������μ�����������������μ�������������������������μ�������������������������μ�������������������������μ������������������������������μ������������������Ϊ����������������μ��������������μ��������������������ή������������������������μ����������������������������μ����������������μ���������������Ͻ����������μ���������������ϸ�����������������μ���������������Ϭ���������������μ���������������ϻ���������������μ���������������Ϫ������������������������μ���������������Ϫ��������������������μ���������������Ϯ������������������μ���������������Ͻ���������������μ���������������ϻ������������������μ���������������ϻ������������������μ���������������ϻ������������������μ���������������ϻ��������������������μ������������������������������������μ�����������������μ�����������������μ�����������������μ�������������������������μ������������������������������μ������������������Ϊ����������������μ��������������μ��������������������ή������������������������μ����������������������������μ����������������μ���������������Ͻ����������μ���������������ϸ�����������������μ���������������Ϭ���������������μ���������������ϻ���������������μ���������������Ϫ������������������������μ���������������Ϫ��������������������μ���������������Ϯ������������������μ���������������Ͻ���������������μ���������������ϻ������������������μ���������������ϻ������������������μ���������������ϻ������������������μ���������������ϻ��������������������μ������������������������������������μ�����������������μ�����������������μ�����������������μ�������������������������μ������������������������������μ������������������Ϊ����������������μ��������������μ��������������������ή������������������������μ����������������������������μ����������������μ���������������Ͻ����������μ���������������ϸ�����������������μ���������������Ϭ���������������μ���������������ϻ���������������μ���������������Ϫ������������������������μ���������������Ϫ��������������������μ���������������Ϯ������������������μ���������������Ͻ���������������μ���������������ϻ������������������μ���������������ϻ������������������μ���������������ϻ������������������μ���������������ϻ��������������������μ������������������������������������μ�����������������μ�����������������μ�����������������μ�������������������������μ������������������������������������������������ς������Ϙ��ς���Ϙ���Ϥ��Ͻ�����Ϣ��Ϫ�����ϙ������ϼ��������ϫ���ϝ����ώ����������������������

0 comments on commit 8ee1ee2

Please sign in to comment.