Some tips about modding.
You can make your mod in two common ways.
1) Standard. Design\"Build" button\Pack subdirectories+sickle.db+s3description.txt\upload. Players need to use "custom game" menu to attach your mod before start new game etc.
You *can't* delete something from original maps. Only change or add. (Ofcourse, you can try delete stuff in editor and in editor all will be OK, but in game "removed" stuff will be present).
If you really want to delete something, you need do it at runtime, from script. (ObjectRemove, UnitRemove etc.) Bad point - you can't use this method for construction parts.
2) Make your mod "as new game", with full replace of original files. To do this you need to write small bat file in mod directory:
..\Tools\DataImport.exe -dbserver localhost -database HSGAMEMOD_%1 sickle.db
and run it with parameter Your_Mod_Name instead pressing "Build" button. (may be some dll will be missed - copy it from Run to tools folder)
Next step - copy sickle.db to Run game folder and copy all subdirecories from mod directory to Run\res.
O-la! Now you have youself game.
You can do anything with original maps.
1) To uninstall your mod players need to reinstall full game.
2) Size of your mod is bigger.
About mainmenu template.
Under word 'replace' above i mean editing existing template
Ofcourse, you can replace it as you write above, but you will have problems with removing old stuff... If you use "standard" modding way ofcourse.
1) You can to write ExecCommand("template YourTemplateID") at start of mainmenu template script. And work with own template. Don't forget move contents of old script to your template! BTW i think, you can decrease size of original old template for increase loading of it speed.
2) You can't use units on this template. Constructions and objects only.
After player pressed button "tutorial" game start template with ID=1395004 and unit with ID=730. You need to edit this template (see tips above).
1) If your tutorial contain 2 or more templates, for transfer player between its you must use command
ExecCommand("template NextTemplateID PersID1 PersID2... PersIDN")
You can't use functions like BeginZone or forceSubZone - game hasn't scenario at this point.
2) All tutorial templates are *not* reenterable.
About scenario functions.
Most of all zones in game are reenterable. Common script "sceleton" for new zone is:
-- zone entering
-- parameters see below
OnEnterZonePrim( "StartCamp", ZT_FOREST, AT_DUST )
-- some initializaton for second and more reenter zone
-- zone leaved. (Player press button "Leave") Default realization already
-- present in scripts\s3Sickle.l,
-- if you don't need to do something on finish - remove this hook
-- some things to finish here before black screen
-- some things to finish here after black screen
-- first entering zone
-- zonename - for check time for transfer to it, see scripts\s3Sickle.l\skipTravelTime function
-- for detail
-- zone type - (ZT_FOREST,ZT_CITY,ZT_CAVE) for correct light switch and
-- correct hide processing (at caves hide enabled at day)
-- zone subtype (default AT_NORMAL, but may be AT_DUST, AT_SPECIAL,
-- AT_SPECIAL1 or AT_SPECIAL2 for light switch and some dust effects
startStandardZone( "StartCamp", ZT_FOREST, AT_DUST )
-- some noninteractive initialization here for example enemies level init
-- some interactive initialization here
Functions for transfer party between zones are:
First function worked good, but has one bad point. It *doesn't* save state of current zone before leaving. If you leave reenterable zone you must use forceSubZone. Really it does'nt start any zone, it simple set some global variables and call ExitToChapter (or ExitToGlobal for forceZone). Zone state is saved after these calls. Chapter (or global) script see to these variables and call BeginZone for start new zone.
If you use forceSubZone player see chapter map for short time (in game chapter map setted to PWL of zone, really player don't use chapter's), if you use forceZone - player see global map.
This way is some ugly, but i already write and debug it before i give access to engine...
Edited by Novik, 03 April 2006 - 09:35 AM.