Editing all.spawn

From Mod Wiki

(Difference between revisions)
Jump to: navigation, search
Revision as of 07:40, 11 July 2008 (edit)
Don Reba (Talk | contribs)
(fixed the acdc anchor link)
← Previous diff
Revision as of 09:07, 11 July 2008 (edit) (undo)
Atrocious (Talk | contribs)
(Setting up all.spawn workspace - +perl note)
Next diff →
Line 12: Line 12:
# Create another <tt>.txt</tt> file, open it, copy this string into it '''perl acdc.pl -c all.ltx -o new.spawn''' then save and close it # Create another <tt>.txt</tt> file, open it, copy this string into it '''perl acdc.pl -c all.ltx -o new.spawn''' then save and close it
# Rename the <tt>.txt</tt> to <tt>compile.bat</tt> # Rename the <tt>.txt</tt> to <tt>compile.bat</tt>
 +# Install [http://www.activestate.com/Products/activeperl/index.mhtml active perl], if you use the <tt>.pl</tt> version of acdc and don't yet have perl.
Now you're ready to go. Now you're ready to go.

Revision as of 09:07, 11 July 2008

all.spawn is a rather big file in the S.T.A.L.K.E.R. gamedata\spawns directory. It contains information about NPCs, monsters, objects, basically anything that is not static level geometry in STALKER. The files is loaded once at game start and it's information is stored in the save-game. That means: Editing the all.spawn requires to start a new game afterwards!

Contents


Setting up all.spawn workspace

Before you can start, you need to download a little tool - acdc.pl created by bardak - that opens the all.spawn for you. Follow these steps after you have downloaded the file:

  1. Open the downloaded archive and extract the content
  2. Rename the .pl file to acdc.pl, if it's not already the case
  3. Copy the all.spawn from gamedata\spawns into the folder with the acdc.pl
  4. Create a .txt file, open it, copy this string into it perl acdc.pl -d all.spawn then save and close it
  5. Rename the .txt to decompile.bat
  6. Create another .txt file, open it, copy this string into it perl acdc.pl -c all.ltx -o new.spawn then save and close it
  7. Rename the .txt to compile.bat
  8. Install active perl, if you use the .pl version of acdc and don't yet have perl.

Now you're ready to go.

Editing all.spawn

This section could use more info on the structure of all.spawn. If you can provide information, feel free to contribute! Atrocious

After you have set up everything, double-click the decompile.bat and wait for the process to finish. It should take some seconds. If the window is instantly closing, you have an error. Read the troubleshooting section then.

After the files have been extracted, you can edit them like any other .ltx file. They entries have numbers in brackets [ ] as section identifiers. Those identifiers must be unique over all .ltx files.

When you are finished, double-click compile.bat and wait until the new.spawn is finished. Copy the new.spawn into your STALKER gamedata\spawns directory, make a backup of the existing spawn file and rename the new.spawn to all.spawn.

Troubleshooting

If the decompiling breaks, it is most probably because your acdc.pl does not work with the all.spawn you use. Use the correct version for your STALKER patch version and use a suitable version if you try to decompile mods. If you can't get the correct version for the mod or version, you have to create it by yourself, like written below.

Important: Before you even start working on a spawn file from another mod, ask the creators of the mod if you are allowed to alter their work. At least do it if you plan to release your changes as new mod. That should go without saying!

How to alter the acdc.pl:

  • Open a dos box (cmd.exe) and make your way through the directories into the recently created all.spawn workspace
  • Once you are there, type decompile and hit enter
  • It will again attempt to decompile but it will fail. Now you should have an error message like:
unknown tushkano_strong at acdc.pl line 2256.

Your acdc.pl doesn't know tushkano_strong. Time to change that:

  • Right-click on acdc.pl and chose edit.
  • Scroll down until you find lines like these:
stalker => 'se_stalker',
stalker_monolith => 'se_stalker',
stalker_zombied => 'se_stalker',
stalker_trader => 'se_stalker',
stalker_sakharov => 'se_stalker',
m_barman => 'se_stalker',
m_osoznanie => 'se_stalker',

They are under section_to_class. Now you can add new items that have been added to the all.spawn in the same manner. Just make sure to point the new items to the right classes. The above example is for NPCs, but there are also examples for monsters and different items. The section from the error message is a new monster, so we have to add it as such:

tushkano_strong => 'se_monster',

Then save and close acdc.pl and try to decompile again. If it fails again (almost certain), check for the next unknown item and add it like the first.

Personal tools