scripting and all.spawn

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

scripting and all.spawn

Postby ket on 12 Oct 2010 14:01

Couple questions, I'll start with the scripting. If I wanted to make it so certain mutants only spawned at night would this script code work;

function chktime( clktime )
local level = level.name()
if clktime == true then
if level == "l01_escape" then
<spawn code here>
return true
end
end
return true
end


My other question is about spawns and respawns in all.spawn. If I was to set up spawns and respawns as follows, would it work? For example, I want to spawn 3 zombies, I put in the spawn code for a zombie, then use respawn code to spawn 3 zombies.

[873]
; cse_abstract properties
section_name = zombie_normal
name = esc_zombie
position = -166.77, -18.39, -128.83
direction = 0,0,0

; cse_alife_object properties
game_vertex_id = 138
distance = 5
level_vertex_id = 524001
object_flags = 0xffffffbf
custom_data = <<END
[smart_terrains]
esc_small_home3 = false
END

; cse_visual properties
visual_name = monsters\zombi\zombi_1

; cse_alife_creature_abstract properties
g_team = 0
g_squad = 1
g_group = 22
health = 1
dynamic_out_restrictions =
dynamic_in_restrictions =

upd:health = 1
upd:timestamp = 0
upd:creature_flags = 0
upd:position = -166.77, -18.39, -128.83
upd:o_model = 0
upd:o_torso = 0,0,0
upd:g_team = 0
upd:g_squad = 1
upd:g_group = 22

; cse_alife_monster_abstract properties

upd:next_game_vertex_id = 65535
upd:prev_game_vertex_id = 65535
upd:distance_from_point = 0
upd:distance_to_point = 0

; cse_ph_skeleton properties

; cse_alife_monster_base properties

; se_monster properties

[874]
; cse_abstract properties
section_name = respawn
name = esc_zombie
position = -166.77, -18.39, -128.83
direction = 0,0,0

; cse_alife_object properties
game_vertex_id = 167
distance = 4.90000009536743
level_vertex_id = 109559
object_flags = 0xffffff3e
custom_data = <<END
[respawn]
respawn_section = zombie_normal,3
;max_count = 8
;min_count = 3
max_spawn = 3
idle_spawn = medium
;conditions = {+agroprom_military_case_done} 80, 0
END

; cse_shape properties
shapes = shape0
shape0:type = sphere
shape0:offset = 0,0,0
shape0:radius = 1

; cse_alife_space_restrictor properties
restrictor_type = 0

; se_respawn properties


Just want to check before I go doing this for all the extra mutants I'm adding :p
Mobo: Asrock Z77 Extreme6
CPU: Intel i5 3570k @ 4.5GHz 1.18v (actual)
RAM: 2x4GB G.Skill Ripjaws @ 2133MHz 10-11-10-25 1T
GPU: VTX3D HD7970 3GB @ 1125MHz / 6600MHz
Sound: Asus Xonar DX 7.1 PCI-E
HDD: 2TB Seagate Barracuda, Sata3 64MB Cache
Opticals: 2x Sony Optiarc DVD-RW
PSU: Corsair 850w HX
Case: Zalman Z11

TK - Singularity homepage
User avatar
ket
Senior Resident
 
Posts: 1259
Joined: 14 Sep 2008 11:57
Location: The solar system

Re: scripting and all.spawn

Postby Nightwatch on 12 Oct 2010 18:24

Hmm, I see someone is planning some mischief there, to scare the ...ehm.. out of the players, hah? B-)

1- Well, through my mobile phone's screen and over the second pint of lager in a pub, evidently established in 1649, that sounds fine enough. However, later in the evening, I'll have another look.

Where do you plan to implement this script?


2- In my opinion, all.spawn in STALKER was a bad idea, not friendly and making changes on it very impractical (e.g. you can't do it on the fly) and also response rather tricky sometimes. Therefore, in my approach, I tend to respawn things seperately, though your approach should work in theory, though I haven't tried it like this: <<respawn_section = zombie_normal,3>> like ordering 3 after the initial respawn.
As another way, you may also try ordering as in this example:

I remember it, it was somewhere in pripyat.ltx (all.spawn)

respawn_section = m_controller_normal,m_controller_normal_fat,m_controller_old,m_controller_old_fat

(using zombie types instead, of course.)

However, all should work.
(From the practicality point of view, it's better to test all new all.spawn things in escape as you can see and change things before playing halfway into the game.)
NEWSA.SIMBION_TWEAK 3.0
Mod Website= Features, Video, Tips & Download Link: NEWSA.SIMBION_Tweak

Watch the Trailer: http://www.youtube.com/watch?v=1Ajw_f8K ... re=channel
Please Do Not download and install any files from links other than those on the Mod's Website
User avatar
Nightwatch
Site Admin
 
Posts: 2615
Joined: 13 Apr 2007 05:42
Location: London, United Kingdom

Re: scripting and all.spawn

Postby ket on 12 Oct 2010 19:09

Indeed there will be a lot of holy crap moments, probably followed by players hitting pause to go take a whizz :p I've done most of the spawn code in Cordon so I will test it in a bit along with the script stuff. The script I plan to put that code in is escape_tasks. Using the clktime function stuff should only spawn at night as defined in the mutant files, but thats only theory. If you know a better way I can implement it I'm all for it :D and 1649... would that be a cronenburg?
Mobo: Asrock Z77 Extreme6
CPU: Intel i5 3570k @ 4.5GHz 1.18v (actual)
RAM: 2x4GB G.Skill Ripjaws @ 2133MHz 10-11-10-25 1T
GPU: VTX3D HD7970 3GB @ 1125MHz / 6600MHz
Sound: Asus Xonar DX 7.1 PCI-E
HDD: 2TB Seagate Barracuda, Sata3 64MB Cache
Opticals: 2x Sony Optiarc DVD-RW
PSU: Corsair 850w HX
Case: Zalman Z11

TK - Singularity homepage
User avatar
ket
Senior Resident
 
Posts: 1259
Joined: 14 Sep 2008 11:57
Location: The solar system

Re: scripting and all.spawn

Postby VINTAR on 07 Dec 2010 07:21

Just to revive an old queston,

you can add to custom_data like this :

[spawner]
cond = {!is_day} --check it is not day
check_distance = true --check if actor is nearby
min_distance = 100 --distance player must be from the spawn point

EDIT: for scripting, just add a condition :

if not is_day() then
--spawn_my_mutants
Core2Quad Q8300 2.5 @ 3.6ghz
Cooler Master Hyper TX 2 CPU cooler
Gigabyte EP45 UD3R mobo
Nvidia GTS450
2 GIGS Transcend DDR2 800 pc6400 @ 960
Thermaltake Tough Power 650w PSU
Samsung Syncmaster P2350
-----------------------------------
Apartheid veteran
User avatar
VINTAR
Senior Resident
 
Posts: 441
Joined: 18 Sep 2008 15:07
Location: Durban, South Africa

Re: scripting and all.spawn

Postby ket on 14 May 2011 12:06

Thanks Vintar thats some real useful info :D Hopefully I can use it to spawn the Paltergeists at night. Spent quite a while rebuilding the necessary files to make them in-game friendy some time ago. Crazy how all the coolest mutants never even got used or only used once or twice in the entire game :-Q
Mobo: Asrock Z77 Extreme6
CPU: Intel i5 3570k @ 4.5GHz 1.18v (actual)
RAM: 2x4GB G.Skill Ripjaws @ 2133MHz 10-11-10-25 1T
GPU: VTX3D HD7970 3GB @ 1125MHz / 6600MHz
Sound: Asus Xonar DX 7.1 PCI-E
HDD: 2TB Seagate Barracuda, Sata3 64MB Cache
Opticals: 2x Sony Optiarc DVD-RW
PSU: Corsair 850w HX
Case: Zalman Z11

TK - Singularity homepage
User avatar
ket
Senior Resident
 
Posts: 1259
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 1 guest

cron