Level Changers

From Mod Wiki

(Difference between revisions)
Jump to: navigation, search

Soduka (Talk | contribs)
(New page: Level Changers Tutorial by dezodor First you need a tool called ACDC from Bardak. There are several versions, the original acdc.pl version or the acdc.exe version. You may find them in t...)
Next diff →

Revision as of 06:16, 29 July 2008

Level Changers Tutorial by dezodor


First you need a tool called ACDC from Bardak. There are several versions, the original acdc.pl version or the acdc.exe version. You may find them in the Tools List. This tool is required to unpack the all.spawn where you will find the level changers, and also add some.

Second you should make a folder somewhere on your HDD and put the acdc.pl or .exe version there and an all.spawn file, then command line:

acdc.pl -d all.spawn

In just a minute or less, and you will see a lot of ltx files in that folder.

alife_lxx_levelname.ltx (ca. 18 files) and way_lxx_levelname for the same levels, and a section.bin and all.ltx. You should not touch that bin file, only the ltx files. For the level changers easy version you only need to edit the alife_lxx_levelname.ltx files.

Since we know that the last level in the all.spawn is the l10u_bunker, we need to edit that ltx file. So open the alife_l10u_bunker.ltx with Notepad++ tool. If you open them with simple windows notepad or word-pad, you may damage the files.

Check an example. Now I will paste the Pripyat to Stancia level changer here, since its real easy to make a Stancia to Pripyat one:

[6901]
; cse_abstract properties
section_name = level_changer
name = exit_to_stancia_01 (you see this in xrspawner too)
position = 30.9278087615967,-0.681343078613281,456.90966796875
 
(Position is important since you need to know where to place that level changer, so you should collect coordinates in game with rs_stats 1, or ZRP tools where you will see the level vertex and game vertex ids too)
 
direction = 3.66738345292106e-006,-2.78026516739582e-013,7.5810604016624e-008
 
; cse_alife_object properties
game_vertex_id = 2158
distance = 16.1000003814697
level_vertex_id = 141177
object_flags = 0xffffff3e
custom_data = <<END
 
[pt_move_if_reject] (you see this in xrspawner too)
path = pri_path_if_reject
END
story_id = 832 (story id is needed, but its easy to add, will explain it later)
 
; cse_shape properties
shapes = shape0
shape0:type = box
shape0:axis_x = 164.583786010742,0,0
shape0:axis_y = 0,20,0
shape0:axis_z = 0,0,50
shape0:offset = 0,0,0
 
; cse_alife_space_restrictor properties
restrictor_type = 3
 
; cse_alife_level_changer properties
dest_game_vertex_id = 2401 (the destination’s game vx id is needed)
dest_level_vertex_id = 404957 (destination’s level vx id is needed)
dest_position = 919.089599609375,0.000268459320068359,-292.599273681641 
dest_direction = -2.02234588186911e-007,-1.08743614427812e-015,-5.37710276304892e-009
dest_level_name = L12_Stancia (destinationlevel name is needed of course)
dest_graph_point = start_actor_01
silent_mode = 1 (you may add 0 or remove this line, and the game will ask if you want to enter the next area, otherwise it will teleport you as soon as you reach that point)


So now you see this level changer. It will look like:

[8641] (The last note is 8640 in the all.spawn at alife_l10u_bunker.ltx so that's why you need to add the new stuffs to that ltx file, and after compiling, the game will use it well)
; cse_abstract properties
section_name = level_changer
name = exit_to_pripyat_03 (added a custom name, defined at the game_story_ids.ltx and level_tasks.script) (of course you can add this to lua_help.script but theres no point)
position = 918.27001953125,0.920000016689301,-400.839996337891 (collected a new position at stancia1 level for the level changer)
direction = 0,0,0 (i dont need this on a simple plain field)
 
; cse_alife_object properties
game_vertex_id = 2401 (this is the starting id from stancia1 level, its easy to pick these id’s with zrp tools or barin’s priboi story tools)
cse_alife_object__unk1_f32 = 30.7999992370605
level_vertex_id = 404957 (this is the starting id from stancia1 level, its easy to pick these id’s with zrp tools or barin’s priboi story tools)
 
object_flags = 0xffffff3e
custom_data = <<END
[pt_move_if_reject]
 
path = st1_way_if_reject_to_pri
END
story_id = 119812 (needs a custom, not used story id, you may write big numbers too)
 
; cse_shape properties
shapes = shape0
shape0:type = sphere
shape0:offset = 0,0,0
shape0:radius = 3.36159992218018 (you can set the radius if you want to)
 
 
; cse_alife_space_restrictor properties
restrictor_type = 3
 
; cse_alife_level_changer properties
dest_game_vertex_id = 2158 (these id’s can be collected either with zrp or barin’s tools)
dest_level_vertex_id = 141177 (these id’s can be collected either with zrp or barin’s tools)
dest_position = 69.4100036621094,3.09999990463257,422.070007324219 (i think i dont need to explain this)
dest_direction = 0,0,0
dest_level_name = L11_Pripyat (where would you like to go…)
dest_graph_point = start_actor_02
silent_mode = 1 (as i mentioned before, either you remove this line, or change it to 0)


Now you have the new [8641] level changer in your alife_l10u_bunker.ltx file. You will need a level changer at least from stancia2 to stancia1 (and that will be 8642 and so on…) or the longer way during the sarcofag, to make the game real open ended as in free play story mod.

As I mentioned before there are some more files you need to edit to make these level changers work. First of all: they need a story id!

So open the game_story_ids.ltx file, and add new IDs for your new level changers. You should add not used numbers as id-s otherwise the game will crash with this log „story id is already in the alife story registry” or something like that.

After you added new story id-s for all of your new level changers, you should add the new story id-s to the alife_l10u_bunker.ltx to your level changers, as you see in the example. Now you can recompile your all.spawn.

acdc.pl -c all.ltx [-o all.spawn]

Now you will get a all.spawn_new or something like that, so move it to your gamedata\spawns folder and rename it to all.spawn. Then you also need to add the level changer circles to your PDA map, since you wont see them. So open the level_tasks.script, and add each of the new level changers to the file. You will see how they work, since you will find the other lc-s there, but here is an example from free play story mod (stancia-pripyat levelchanger):


-- aes
local obj = sim:story_object(119812) (this is the story ID)
if obj then
level.map_add_object_spot(obj.id, "level_changer", "to_pripyat" )
end

Now if you start a new game, you will see these blue circles on the map, and also if you reach them, they will drop you to the next map, or that map you added to them.


In some cases, if you don't know or you are too lazy to get the level vx and game vx id-s, you may use the destination level’s game and level vx ids as the starting game vx and level vx id at an other level like in the case of pripyat-stancia or stancia-pripyat level changer. Since you arrive to the same spot, or almost the same, but haven't tested if it works in every situation.

Personal tools