Jump to content

How to hammer and sickle an own scenario?


KoMik

Recommended Posts

OK, this my first topic for questions about the Hammer & Sickle's editor. I have dance around in database's tables and figured out how make an new ScenarioZone for a start and add it to custom campaign. These little things are still a mystery to me:

 

1) Can I make my own Tutorial and Main Menu templates/interfaces? How to link them to my custom game/scenario mod?

2) How does H&S use the ScenarioBlock's table? I noted that all zones are in one Block (ID=3, BlockOrder=4 and ZonesToPass=3) and there are still old (S3's) zones in the AddOn > Main scenario - why so? In other words - If I'm going to make new zones, which block I should put them in or does it even matter?

 

That's all for now ... Thanx.

Link to comment
Share on other sites

Can I make my own Tutorial

You need to replace template with ID = 1395004.

and Main Menu templates/interfaces

MainMenu template ID = 4686

MainMenu camera ID = 5093

I will try to describe more detailed tomorrow.

How does H&S use the ScenarioBlock's table?

H&S dosn't use it. Use functions

forceSubZone(zoneName,deployParam,direction)

forceZone(zoneName,deployParam,direction)

(see to it realization in scripts\s3Sickle.l and scripts of chapters and global)

Link to comment
Share on other sites

Thank you Novik!

 

You need to replace template with ID = 1395004.
First I was wondering how to do a replacing action (never even tried) but I managed to do it this way (please, correct me if I did something alarming :lovetammy:)

 

1) Create an own template in the MapEditor

2) Direct connect to mod's database (I still use that crashing BlueShellDataGay)

3) Open Map's table and replace the orginal template's ID to your custom template's

!! Note---> Custom template's grid should be the same than orginal's - else you may need to change the orginal in MapTemplates table

 

I will try to describe more detailed tomorrow.
In the first post I wrote a bit false question: I don't have a need to edit or change interfaces (texts, buttons, logos etc.) - I just want to use my own 'background' template. BUT if you got something useful knowledge or words of warning then I would be more than interested to know. Thanks again.

 

(see to it realization in scripts\s3Sickle.l and scripts of chapters and global)
Yep, it's like learning a new language - lots of new ways to 'express myself'. Let's see can I teach some new tricks to an old dog :D. Anyway, I think those new functions are well thought and done. Takes time to examine but I'm not in hurry.
Link to comment
Share on other sites

Some tips about modding.

 

Common tips

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.

Disadvantage:

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.

Advantage:

You can do anything with original maps.

Disadvantages:

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 :lovetammy: 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.

Some tips:

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.

 

About tutorial.

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
function OnEnterZone()
-- parameters see below
OnEnterZonePrim( "StartCamp", ZT_FOREST, AT_DUST )
if(zoneEntered>1) then
-- some initializaton for second and more reenter zone
end
end

-- 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
function OnRealExit()
-- some things to finish here before black screen
OnRealExitPrim()
-- some things to finish here after black screen
ExitToGlobal()
end

-- first entering zone
DelayGameStart()
-- 
-- parameters:
-- 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
initEnemyPlayer(1) 
StartGame()
AutoSave()
-- some interactive initialization here

Functions for transfer party between zones are:

1) BeginZone(zonename)

2) forceSubZone(zoneName,deployParam=nil,direction=nil)

3) forceZone(zoneName,deployParam=nil,direction=nil)

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
Link to comment
Share on other sites

Woooh-oh! :D

 

That was damn brilliant description how this game/modification actually works in basic ways. There was many things what I didn't know (and I have been 'SSS-modding' over a year now). I understood all old-and-new stuff what you descripted above - no questions about it.

 

Thank you Novik! Great gift for enthusiastic modders modification you have been made. :lovetammy:

Link to comment
Share on other sites

  • 4 weeks later...

Hey, (this is just a small post for H&S's main scripts to support the 'community' :eh:)

 

I have quite much figured out how to script Hammer & Sickle. What a playground! (and a lab)

 

As many of you may know that H&S doesn't use clues, tasks or goals. Now it's time for quests. Custom campaign's author 'must' set own quests to AutoLoadScript file/s (in the Run > scripts folder) and set an new itemID for the file (database) or just edit orginal .l files: S3Const.l is one file for main quests and from the S3Sickle.l file you can seek threads initVariables(), getVariables() and putVariables(). Thread initVariables() should be set to a some starting zone's script (before any variables are begin to set), getVariables() is for 'The Final Judgements' and putVariables() sets variables for checking.

 

Secondly, if author/s wants to have mod's eye on hired characters (alive or not) then I may recomend to check out Mr Novik's great OnUnitDeathPrim().

 

Tertiary, addZone() thread should be made a custom one with different names or edit the orginal thread. It uses old zone names (as many threads in AutoLoadScripts) ...so watch out duplicated names!

 

That's all for now.

Link to comment
Share on other sites

1) About initVariables/getVariables/putVariables.

This is global variables wrapper. Just for comfort.

initVariables for init global variables (one call at scenareo start).

getVariables maps block of global variables to local zone variables (at start zone), putVariables - commit changes of locals to globals (at finish zone).

If you use standart script decoration (see previous post), getVariables/putVariables is called automatically, you don't need to remember about it.

2) About addZone.

Tertiary, addZone() thread should be made a custom one with different names or edit the orginal thread. It uses old zone names (as many threads in AutoLoadScripts) ...so watch out duplicated names!

Some zones are complex. For example, Zeizenburg contain 3 zones - "City","Sewerage","Railroad".

All zones placed on one chapter.

Any of calls - ScenarioAddVisibleZone("City") or ScenarioAddVisibleZone("Sewerage") or ScenarioAddVisibleZone("Railroad") - is opening this chapter.

addZone simple call ScenarioAddVisibleZone and put global markers - "Player really have access to all of three zones - "City","Sewerage","Railroad". Just for inner usage.

Edited by Novik
Link to comment
Share on other sites

Yep'n'thanks :eh:

 

I didn't mentioned above that there is a possibility to edit AutoLoadScript table item's subdirs, so one possibility is to make copies from orginal .l files and change orginal ALS-IDs to load modders files. This should cause less loading time. Saves also orginals for playing. (I'm on my fifth go)

 

Novik, could you recommed any freeware/software text-editing programs for .l files?

 

Thanks.

Link to comment
Share on other sites

Novik, could you recommed any freeware/software text-editing programs for .l files?

I use standard inner text editor of FAR manager. ( https://farmanager.com/index.php?l=en )

But if you want some special, you may try this -

https://hyperupload.com/download/01d2d38f90...Editor.rar.html

screenshorts:

https://forums.nival.com/rus/attachment.php...72&d=1144341214

https://forums.nival.com/rus/attachment.php...73&d=1144341222

https://forums.nival.com/rus/attachment.php...74&d=1144341229

Author remarks and readme (on russian) here -

https://forums.nival.com/rus/showthread.php?t=32699

I will try to translate shortly.

 

"Functionality:

1) Syntax hightlitning (scheme of it may be corrected by user).

2) Code Insite

3) Autocompete

4) Tooltips for function parameters

5) Search & replace

6) Syntax checking.

 

To install:

Unpack archive to any location.

 

Hotkeys:

1. Ctrl+Space - autocomplete list.

2. Shift+Ctrl+Space - tooltip for function parameters (when cursor located inside brackets)

3. Shift+Ctrl+J - automatic creation code by template.

4. Shift+CTrl+1 ... Shift+Ctrl+9 - create text markers (1-9)

5. Ctrl+1 ... Ctrl+9 - go to trext marker (1-9)

6. Alt+G - go to line with number...

7. Ctrl+R - search & replace

8. F9 - syntax check."

Edited by Novik
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...