How To: Add your own level changers

Discussions on Modding of S.T.A.L.K.E.R. SoC & Clear Sky

How To: Add your own level changers

Postby ket on 15 Mar 2010 17:20

Ok, this is a WIP so some things may be added. I'll assume you're already familiar with how to use ActivePerl, ACDC and how to compile and decompile all.spawn. This guide is purely for those who want a simple and easy to understand way on how to make a level changer.

1. Decompile all.spawn

2. Get the co-ordinates for the new level changer position. To get the co-ordinates open Stalkers console and type rs_stats on. If the positioning of a level changer you want to place is beyond where you want to go, eg; you want to move a level changer further back, then use rs_stats followed by demo_record 1. This will allow you to "fly" to your destination and get the co-ordinates.

3. Obtain destination game and level vertex IDs of where you want your new level changer to take you. Best way to get these IDs is to open a alife level file that contains a existing level changer of where you want the new level changer to take you to. For example you want to make a level changer in Cordon that will take you to the Darkvalley. So to get the game and level vertex IDs for the Darkvalley simply open alife_l02_garbage and search level_changer until you find the one that takes you to the Darkvalley. The exact info you would need to copy is;

dest_game_vertex_id = 813
dest_level_vertex_id = 1321

Now you have this info you can start to build your new level changer. For the purposes of this guide we will stick with the example of wanting to make a level changer in Cordon to take you to the Darkvalley.

Lets say you have taken base code from a existing level changer in Cordon, it will look something like this;

[285]
; cse_abstract properties
section_name = level_changer
name = exit_to_garbage_01
position = 29.34641456604,16.5561962127686,686.241638183594
direction = 0,0,0

; cse_alife_object properties
game_vertex_id = 1
distance = 7
level_vertex_id = 309788
object_flags = 0xffffff3e
custom_data = <<END
[pt_move_if_reject]
path = esc_way_if_reject
END
story_id = 91

; cse_shape properties
shapes = shape0
shape0:type = box
shape0:axis_x = 2.22939944267273,0,0
shape0:axis_y = 0,4.83859968185425,0
shape0:axis_z = 0,0,2.22939944267273
shape0:offset = 0,0,0

; cse_alife_space_restrictor properties
restrictor_type = 3

; cse_alife_level_changer properties
dest_game_vertex_id = 253
dest_level_vertex_id = 209876
dest_position = 36.4117431640625,0.481237411499023,-305.824523925781
dest_direction = 0.0111562451347709,-0.000250374461757019,0.0224392339587212
dest_level_name = L02_Garbage
dest_graph_point = start_actor_01


First off, start by replacing [285] with a number that isn't in the alife file, for example [870]. Next, change the name, which for this example you would need to change it to exit_to_darkvalley_01. Now you will need to enter the co-ordinates for the level changer, to do this enter them in the position paramater. As we want this level changer to to take us to Darkvalley it makes sence for the co-ordinates to be from the very back of the tunnel where you find the special bandit suit, so the co-ordinates would be 371.14,16.64,-42.80. Now you will need to change story_id, but I will come back to this in a bit.

Moving on, you now need to enter the dest_game_vertex_id, which for going to the Darkvalley is 813, dest_level_vertex_id, which for the darkvalley is 1321, dest_position which for this example would be -46.18,2.67,-577.50, and lastly dest_level_name, which for the example would be L04_darkvalley.

Now you have entered all those details you're code now looks like this;

[872]
; cse_abstract properties
section_name = level_changer
name = exit_to_darkvalley_01
position = 371.14,16.64,-42.80
direction = 0,0,0

; cse_alife_object properties
game_vertex_id = 1
distance = 7
level_vertex_id = 309788
object_flags = 0xffffff3e
custom_data = <<END
[pt_move_if_reject]
path = esc_way_if_reject
END
story_id = 91

; cse_shape properties
shapes = shape0
shape0:type = box
shape0:axis_x = 2.22939944267273,0,0
shape0:axis_y = 0,4.83859968185425,0
shape0:axis_z = 0,0,2.22939944267273
shape0:offset = 0,0,0

; cse_alife_space_restrictor properties
restrictor_type = 3

; cse_alife_level_changer properties
dest_game_vertex_id = 813
dest_level_vertex_id = 1321
dest_position = -46.18,2.67,-577.50
dest_direction = 0.0111562451347709,-0.000250374461757019,0.0224392339587212
dest_level_name = L04_darkvalley
dest_graph_point = start_actor_01


4. Now lets tackle that story ID. You need to add a ID that does not exist basically. To do this find and open game_story_ids.ltx. Scroll to the very bottom of the file and comment out a small heading, so do this: ;New level changers. Under this heading add 5481 = "esc_exit_to_darkvalley_01". Now save the changes to this file and exit. Go back to your level changer code and for story_id change it to 5481.

The completed code will now look like this;

[872]
; cse_abstract properties
section_name = level_changer
name = exit_to_darkvalley_01
position = 371.14,16.64,-42.80
direction = 0,0,0

; cse_alife_object properties
game_vertex_id = 1
distance = 7
level_vertex_id = 309788
object_flags = 0xffffff3e
custom_data = <<END
[pt_move_if_reject]
path = esc_way_if_reject
END
story_id = 5481

; cse_shape properties
shapes = shape0
shape0:type = box
shape0:axis_x = 2.22939944267273,0,0
shape0:axis_y = 0,4.83859968185425,0
shape0:axis_z = 0,0,2.22939944267273
shape0:offset = 0,0,0

; cse_alife_space_restrictor properties
restrictor_type = 3

; cse_alife_level_changer properties
dest_game_vertex_id = 813
dest_level_vertex_id = 1321
dest_position = -46.18,2.67,-577.50
dest_direction = 0.0111562451347709,-0.000250374461757019,0.0224392339587212
dest_level_name = L04_darkvalley
dest_graph_point = start_actor_01


Thats it, you just completed the code for the new level changer! But you're not quite done yet.. Now you need to recompile all.spawn, and open up level_tasks.script in order to add the level changer circles to your PDA map, otherwise you won't see them.

To add your new level changer to your PDA map you will need to add a little script code, which for once with stalker, is nice and easy. Under local jump_level_by_name you will want to add your new level changer description, which for this example would be l01_escape = "l04_darkvalley",. Now under function add_lchanger_location for this guides example you would add:
local obj = sim:story_object(5481)
if obj then
level.map_add_object_spot(obj.id, "level_changer", "to_darkvalley")
end


Save and exit. Thats it! You're all done.
Mobo: MSI X570 Tomahawk
CPU: R7 3700X @ 4.4GHz 1.3v
RAM: 2x16GB Klevv BoltX 3600MHz 16-20-20-35
GPU: Powercolor 6800XT Red Devil
Sound: Asus Xonar DX 7.1 PCI-E, Realtek ALC1200
HDD: 250GB & 500GB nVME 3.0 M.2 drives, 2TB Seagate Barracuda, Sata3 64MB Cache, 250GB Hynix SL301
Opticals: DVD-RW, Blu-Ray
PSU: eVGA 1000w G2 Supernova
Case: NZXT Phantom 530

STALKER: Singularity (SIN) homepage
User avatar
ket
Senior Resident
 
Posts: 1262
Joined: 14 Sep 2008 11:57
Location: The solar system

Re: How To: Add your own level changers

Postby Balious on 16 Mar 2010 11:46

Nice work ket. If I ever try and get back to modding I give it a try myself to see if it will work.
Will greatly help those that want to make level changers.
User avatar
Balious
Senior Resident
 
Posts: 894
Joined: 14 Sep 2008 19:41
Location: England, Birmingham

Re: How To: Add your own level changers

Postby ket on 16 Mar 2010 15:09

For some time I was on burnout, but now I'm back and really shaking SoC up! I'll never forget how upset and disappointed I was in the vanilla SoC after hearing so much and being its biggest fan, only for everything that had been shown to not be in the retail game, that was a real kick in the balls. Its because of this I will keep going, and eventually one day you can expect to see a SoC with all of the levels from CS and COP, not onlt that, but the experience portrayed in all those in-house demos will be there.
Mobo: MSI X570 Tomahawk
CPU: R7 3700X @ 4.4GHz 1.3v
RAM: 2x16GB Klevv BoltX 3600MHz 16-20-20-35
GPU: Powercolor 6800XT Red Devil
Sound: Asus Xonar DX 7.1 PCI-E, Realtek ALC1200
HDD: 250GB & 500GB nVME 3.0 M.2 drives, 2TB Seagate Barracuda, Sata3 64MB Cache, 250GB Hynix SL301
Opticals: DVD-RW, Blu-Ray
PSU: eVGA 1000w G2 Supernova
Case: NZXT Phantom 530

STALKER: Singularity (SIN) homepage
User avatar
ket
Senior Resident
 
Posts: 1262
Joined: 14 Sep 2008 11:57
Location: The solar system


Return to Modding Techniques

Who is online

Users browsing this forum: No registered users and 27 guests