ProjectsWhat's NewDownloadsCommunitySupportCompany
Forum Index » S.T.A.L.K.E.R.: Shadow of Chernobyl Forum » Mod discussion
Smart terrain tutorial

« Previous 10 events | 1 2 3 4 5 | Next 10 events »| All Messages
Posted by/on
Question/AnswerMake Newest Up Sort by Descending
  13:30:15  6 October 2010
profilee-mailreply Message URLTo the Top
Robberbaron
Bangalore
(Resident)

 

 
On forum: 08/06/2009
Messages: 614
http://stalkerin.gameru.net/modules.php?name=Downloads&d_op=getit&lid=376
  11:27:27  7 October 2010
profilee-mailreply Message URLTo the Top
atonium2027
(Senior)
 
On forum: 06/01/2009
 

Message edited by:
atonium2027
10/07/2010 11:38:18
Messages: 74
So, i got this crash log:
LUA error: ...w of chernobyl\gamedata\scripts\smart_terrain.script:752: C stack overflow

Now i really dont know how to continue
I created all necessary files and made the gulags, i made for every mutant one waypoint... Could andybody check the script pls?

Btw: All smarties i creates in kordon work fine...

My gulag script

---QUOTATION---

local t = {}
function load_job( sj, gname, type, squad, groups )
if type == "marsh_boars1" then
t = { section = "logic@marsh_boars1_1",
idle = 0,
prior = 5, state = {0},
in_rest = "", out_rest = ""
}
table.insert(sj, t)
t = { section = "logic@marsh_boars1_2",
idle = 0,
prior = 5, state = {0},
in_rest = "", out_rest = ""
}
table.insert(sj, t)
t = { section = "logic@marsh_boars1_3",
idle = 0,
prior = 5, state = {0},
in_rest = "", out_rest = ""
}
table.insert(sj, t)
t = { section = "logic@marsh_boars1_4",
idle = 0,
prior = 5, state = {0},
in_rest = "", out_rest = ""
}
table.insert(sj, t)
end

if type == "marsh_dogs1" then
t = { section = "logic@marsh_dogs1_1",
idle = 0,
prior = 5, state = {0},
in_rest = "", out_rest = ""
}
table.insert(sj, t)
t = { section = "logic@marsh_dogs1_2",
idle = 0,
prior = 5, state = {0},
in_rest = "", out_rest = ""
}
table.insert(sj, t)
t = { section = "logic@marsh_dogs1_3",
idle = 0,
prior = 5, state = {0},
in_rest = "", out_rest = ""
}
table.insert(sj, t)
t = { section = "logic@marsh_dogs1_4",
idle = 0,
prior = 5, state = {0},
in_rest = "", out_rest = ""
}
table.insert(sj, t)
t = { section = "logic@marsh_dogs1_5",
idle = 0,
prior = 5, state = {0},
in_rest = "", out_rest = ""
}
table.insert(sj, t)
t = { section = "logic@marsh_dogs1_6",
idle = 0,
prior = 5, state = {0},
in_rest = "", out_rest = ""
}
table.insert(sj, t)
end

if type == "marsh_rats1" then
t = { section = "logic@marsh_rats1_1",
idle = 0,
prior = 5, state = {0},
in_rest = "", out_rest = ""
}
table.insert(sj, t)
t = { section = "logic@marsh_rats1_2",
idle = 0,
prior = 5, state = {0},
in_rest = "", out_rest = ""
}
table.insert(sj, t)
t = { section = "logic@marsh_rats1_3",
idle = 0,
prior = 5, state = {0},
in_rest = "", out_rest = ""
}
table.insert(sj, t)
t = { section = "logic@marsh_rats1_4",
idle = 0,
prior = 5, state = {0},
in_rest = "", out_rest = ""
}
table.insert(sj, t)
t = { section = "logic@marsh_rats1_5",
idle = 0,
prior = 5, state = {0},
in_rest = "", out_rest = ""
}
table.insert(sj, t)
t = { section = "logic@marsh_rats1_6",
idle = 0,
prior = 5, state = {0},
in_rest = "", out_rest = ""
}
table.insert(sj, t)
t = { section = "logic@marsh_rats1_7",
idle = 0,
prior = 5, state = {0},
in_rest = "", out_rest = ""
}
table.insert(sj, t)
end

if type == "marsh_flesh1" then
t = { section = "logic@marsh_flesh1_1",
idle = 0,
prior = 5, state = {0},
in_rest = "", out_rest = ""
}
table.insert(sj, t)
t = { section = "logic@marsh_flesh1_2",
idle = 0,
prior = 5, state = {0},
in_rest = "", out_rest = ""
}
table.insert(sj, t)
t = { section = "logic@marsh_flesh1_3",
idle = 0,
prior = 5, state = {0},
in_rest = "", out_rest = ""
}
table.insert(sj, t)
t = { section = "logic@marsh_flesh1_4",
idle = 0,
prior = 5, state = {0},
in_rest = "", out_rest = ""
}
table.insert(sj, t)
end
end

function load_states( gname, type )
if type == "marsh_boars1" then
return function(gulag)
return 0
end
end

if type == "marsh_dogs1" then
return function(gulag)
return 0
end
end

if type == "marsh_rats1" then
return function(gulag)
return 0
end
end
if type == "marsh_flesh1" then
return function(gulag)
return 0
end
end
end

--------------------------------------------------------------------------
-- Dynamic ltx
--------------------------------------------------------------------------
function load_ltx(gname, type)
return nil
end

function checkStalker(npc_community, gulag_type, npc_rank, se_obj)
end

function checkMonster(npc_community, gulag_type)
if gulag_type == "marsh_boars1" then
return npc_community == "boar" or
npc_community == "flesh" or
npc_community == "dog"
end

if gulag_type == "marsh_dogs1" then
return npc_community == "dog" or
npc_community == "flesh" or
npc_community == "boar"
end

if gulag_type == "marsh_rats1" then
return npc_community == "tushkano" or
npc_community == "flesh" or
npc_community == "dog"
end
if gulag_type == "marsh_flesh1" then
return npc_community == "flesh" or
npc_community == "tushkano" or
npc_community == "dog"
end
return false
end

---END QUOTATION---



my gulag ltx

---QUOTATION---

;---------------------------------------------
[logic@marsh_rats1_1]
active = mob_home@marsh_rats1_1

[mob_home@marsh_rats1_1]
path_home = path1
home_min_radius = 1
home_max_radius = 4

[logic@marsh_rats1_2]
active = mob_home@marsh_rats1_2

[mob_home@marsh_rats1_2]
path_home = path2
home_min_radius = 1
home_max_radius = 4

[logic@marsh_rats1_3]
active = mob_home@marsh_rats1_3

[mob_home@marsh_rats1_3]
path_home = path3
home_min_radius = 1
home_max_radius = 4

[logic@marsh_rats1_4]
active = mob_home@marsh_rats1_4

[mob_home@marsh_rats1_4]
path_home = path4
home_min_radius = 1
home_max_radius = 4

[logic@marsh_rats1_5]
active = mob_home@marsh_rats1_5

[mob_home@marsh_rats1_5]
path_home = path5
home_min_radius = 1
home_max_radius = 4

[logic@marsh_rats1_6]
active = mob_home@marsh_rats1_6

[mob_home@marsh_rats1_6]
path_home = path6
home_min_radius = 1
home_max_radius = 4

[logic@marsh_rats1_7]
active = mob_home@marsh_rats1_7

[mob_home@marsh_rats1_7]
path_home = path7
home_min_radius = 1
home_max_radius = 4

;---------------------------------------------
[logic@marsh_boars1_1]
active = mob_home@marsh_boars1_1

[mob_home@marsh_boars1_1]
path_home = path1
home_min_radius = 2
home_max_radius = 6

[logic@marsh_boars1_2]
active = mob_home@marsh_boars1_2

[mob_home@marsh_boars1_2]
path_home = path2
home_min_radius = 2
home_max_radius = 6

[logic@marsh_boars1_3]
active = mob_home@marsh_boars1_3

[mob_home@marsh_boars1_3]
path_home = path3
home_min_radius = 2
home_max_radius = 6

[logic@marsh_boars1_4]
active = mob_home@marsh_boars1_4

[mob_home@marsh_boars1_4]
path_home = path4
home_min_radius = 2
home_max_radius = 6

;---------------------------------------------
[logic@marsh_dogs1_1]
active = mob_home@marsh_dogs1_1

[mob_home@marsh_dogs1_1]
path_home = path1
home_min_radius = 3
home_max_radius = 10

[logic@marsh_dogs1_2]
active = mob_home@marsh_dogs1_2

[mob_home@marsh_dogs1_2]
path_home = path2
home_min_radius = 3
home_max_radius = 10

[logic@marsh_dogs1_3]
active = mob_home@marsh_dogs1_3

[mob_home@marsh_dogs1_3]
path_home = path3
home_min_radius = 3
home_max_radius = 10

[logic@marsh_dogs1_4]
active = mob_home@marsh_dogs1_4

[mob_home@marsh_dogs1_4]
path_home = path4
home_min_radius = 3
home_max_radius = 10

[logic@marsh_dogs1_5]
active = mob_home@marsh_dogs1_5

[mob_home@marsh_dogs1_5]
path_home = path5
home_min_radius = 3
home_max_radius = 10

[logic@marsh_dogs1_6]
active = mob_home@marsh_dogs1_6

[mob_home@marsh_dogs1_6]
path_home = path6
home_min_radius = 3
home_max_radius = 10

;---------------------------------------------
[logic@marsh_flesh1_1]
active = mob_home@marsh_flesh1_1

[mob_home@marsh_flesh1_1]
path_home = path1
home_min_radius = 3
home_max_radius = 8

[logic@marsh_flesh1_2]
active = mob_home@marsh_flesh1_2

[mob_home@marsh_flesh1_2]
path_home = path2
home_min_radius = 3
home_max_radius = 8

[logic@marsh_flesh1_3]
active = mob_home@marsh_flesh1_3

[mob_home@marsh_flesh1_3]
path_home = path3
home_min_radius = 3
home_max_radius = 8

[logic@marsh_flesh1_4]
active = mob_home@marsh_flesh1_4

[mob_home@marsh_flesh1_4]
path_home = path4
home_min_radius = 3
home_max_radius = 8

---END QUOTATION---

  20:28:48  18 January 2011
profilee-mailreply Message URLTo the Top
crucifist
(Senior)
 
On forum: 12/14/2009
Messages: 105
Mmmh, I have a question: I havre created a smart terrain:


[9087]
; cse_abstract properties
section_name = smart_terrain
name = smart_generator_snork
position = 16.214975357056,25.985639572144,-131.96838378906
direction = 0.43683072924614,-0.102052226662636,0.237491175532341

; cse_alife_object properties
game_vertex_id = 3072
distance = 36.3999977111816
level_vertex_id = 332383
object_flags = 0xffffffbe
custom_data = <<END
[smart_terrain]
type = smart_generator_snork
capacity = 3
squad = 8
groups = 5

END

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

; cse_alife_space_restrictor properties
restrictor_type = 0

; se_smart_terrain properties



I can see it in game using the tool from dez0wave. The problem is that its state is on "not working".

I have also created snorks to spawn in (with their points in waypoint.ltx).

What is wrong?
  19:14:11  22 January 2011
profilee-mailreply Message URLTo the Top
Vintar
a bit of this and a lot of that
(Resident)

 

 
On forum: 08/08/2008
Messages: 6349
Have you added to gulag.script or gulag.ltx and added smart terrain name to mutants logic?
  19:34:22  22 January 2011
profilee-mailreply Message URLTo the Top
crucifist
(Senior)
 
On forum: 12/14/2009
 

Message edited by:
crucifist
01/22/2011 19:36:26
Messages: 105

---QUOTATION---
Have you added to gulag.script or gulag.ltx and added smart terrain name to mutants logic?
---END QUOTATION---



Mmmh, yep I have added to gulag.script and gulag.ltx. I'm not sure for smart terrain name in mutants logic. I don't have my computer for the moment.

In fact I forgot to tell something: I add smart terrain in Generator (from the OSLR wich I try to modify). In the all.spawn there are no smart terrain.

I think my problem comes from the call of the gulag script. In fact it isn't called at all.

I have done several tests with NPC, and in the log file I can see that they spawn because of the destruction of the object when I close the game.

I tried, just to see, to add my gulag script in gulag_escape.script, but it doesn't work.

I actually try to understant how new_gulag.script is called in NS to do the same. But I ask myself if I have to modify the file level.spawn. If I have to, I don't know how to proceed. I just know that I need the SDK, but I haven't find a lot of information about it.

From memory, gulag_****.script is called by only two others scripts. I can't remember wich ones.

I use agent_ransack to search in the gamedata directory, I don't know if it's a good way to proceed.

Sorry for my bad english, I know it's hard to read it ...
  19:42:29  22 January 2011
profilee-mailreply Message URLTo the Top
Vintar
a bit of this and a lot of that
(Resident)

 

 
On forum: 08/08/2008
Messages: 6349
Xr_gulag is one.
  19:51:50  22 January 2011
profilee-mailreply Message URLTo the Top
crucifist
(Senior)
 
On forum: 12/14/2009
 

Message edited by:
crucifist
01/22/2011 19:58:39
Messages: 105
Do you think to those lines:


level_groups = {l01_escape = 1, l02_garbage = 2, l03_agroprom = 3, l03u_agr_underground = 4,
                l04_darkvalley = 5, l04u_labx18 = 6, l05_bar = 7, l06_rostok = 8,
                l07_military = 9, l08_yantar = 10, l08u_brainlab = 11, l10_radar = 12,
                l10u_bunker = 13, l11_pripyat = 14, l12_stancia = 15, l12u_sarcofag = 16, 
                l12u_control_monolith = 17, l12_stancia_2 = 18, l09_deadcity = 19, 
				l10u_secret_lab = 20, l13_generators = 21, l13u_warlab = 22}



As you can see, Generators is in.

EDIT: I'm not on my computer, so I don't have my modified files.
  10:44:58  24 January 2011
profilee-mailreply Message URLTo the Top
crucifist
(Senior)
 
On forum: 12/14/2009
 

Message edited by:
crucifist
01/24/2011 12:38:56
Messages: 105
Here's my scripts and config files:

(I test with a monolith)
alife_l13_generators.ltx


[9087]
; cse_abstract properties
section_name = smart_terrain
name = smart_generators_monolith
position = 16.214975357056,25.985639572144,-131.96838378906
direction = 0.43683072924614,-0.102052226662636,0.237491175532341

; cse_alife_object properties
game_vertex_id = 3072
distance = 10.3999977111816
level_vertex_id = 332383
object_flags = 0xffffffbe
offline = false
custom_data = <<END
[smart_terrain]
type = smart_generators_monolith
capacity = 1
;squad = 8
;groups = 5

END

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

; cse_alife_space_restrictor properties
restrictor_type = 0

; se_smart_terrain properties

[9088]
; cse_abstract properties
section_name = stalker
name = gen_monolit_stalker_0
position = 15.214975357056,25.985639572144,-131.96838378906
direction = 0,0,0

; cse_alife_trader_abstract properties
money = 5000
character_profile = sim_monolith_master

; cse_alife_object properties
game_vertex_id = 3073
distance = 5
level_vertex_id = 332383
object_flags = 0xfffffffb
custom_data = <<END
[smart_terrains]
smart_generators_monolith = true


END
; cse_visual properties
visual_name = actors\monolit\stalker_mo_exo

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

upd:health = 1
upd:timestamp = 0
upd:creature_flags = 0
upd:position = 173.932769775391,30.8514213562012,-478.011291503906
upd:o_model = 0
upd:o_torso = 0,0,0
upd:g_team = 0
upd:g_squad = 0
upd:g_group = 1

; 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_alife_human_abstract properties
predicate5 = 2,2,2,1,0
predicate4 = 1,2,1,2

; cse_ph_skeleton properties

upd:start_dialog = 

; se_stalker properties



way_l13_generators.ltx


[path_monolith0]
points = p0
p0:name = wp00|sig=path_end
p0:position = 16.214975357056,25.985639572144,-131.96838378906
p0:game_vertex_id = 3076 
p0:level_vertex_id = 332383 




config/misc/gulag_generators:


[logic@smart_generators_monolith0_walker]
active = walker@smart_generators_monolith0
 
[walker@smart_generators_monolith0]
path_walk         = path_monolith0

[path_monolith0]

points = p0
p0:name = wp00|sig=path_end
p0: position = 6.214975357056,25.985639572144,-131.96838378906
on_signal = path_end | nil



scripts/gulag_generators (quite simple, but it's a test):


local t = {}

function load_job(sj, gname, type, squad, groups)
if type == "smart_generators_monolith0_walker" then

get_console():execute("starting")

	t = {}
	t.section = "logic@smart_generators_monolith0"
	t.idle = 0
	;-- no idea but i guess it's optional
	t.timeout = 0
	;-- priority
	t.prior = 100
	t.state = {0, 1, 2}
	t.squad = squad
	t.group = groups[1]
	t.position_threshold = 100
	t.online = true
	t.in_rest = ""
	t.out_rest = ""
	table.insert(sj, t)
	
 get_console():execute("end_of_function")

function load_ltx(gname, type)
		get_console():execute("loading_ltx_generator")
	return nil
end


function load_states(gname, type)
	get_console():execute("loading_state_generators")
	if type == "smart_generators_monolith0_walker" then
	get_console():execute("loading_functioon_load_jobs")
		return function(gulag)
			if not db.actor then
				return gulag.state
			end
			if level.get_time_hours() >= 5 and level.get_time_hours() <= 22 then
				return 0  -- switch all mutants/npc to daily job
			else
				return 1  -- switch all mutants/npc to nightly job
			end
		end
	end
	
function checkStalker(npc_community, gulag_type, npc_rank, se_obj)
	get_console():execute("check_stalker")
	if gulag_type == "smart_generators_monolith" then
	return npc_community == "monolith"
end
 
end





config/smart_terrain_presets.ltx:

[l13_generators]
monolith	= novice, experienced, veteran, master



config/misc/general_lager:


[l13_generators]
monolith	= novice, experienced, veteran, master



In the log, I can see:


sv reject. id_parent [17856][stalker:gen_monolit_stalker_0] id_entity [17957][bolt:bolt] [23886]
sv reject. id_parent [17856][stalker:gen_monolit_stalker_0] id_entity [17863][wpn_walther:wpn_walther17863] [23886]
sv reject. id_parent [17856][stalker:gen_monolit_stalker_0] id_entity [17862][wpn_g36:wpn_g3617862] [23886]
sv reject. id_parent [17856][stalker:gen_monolit_stalker_0] id_entity [17861][kolbasa:kolbasa17861] [23886]
sv reject. id_parent [17856][stalker:gen_monolit_stalker_0] id_entity [17860][bandage:bandage17860] [23886]
sv reject. id_parent [17856][stalker:gen_monolit_stalker_0] id_entity [17859][ammo_9x19_fmj:ammo_9x19_fmj17859] [23886]
sv reject. id_parent [17856][stalker:gen_monolit_stalker_0] id_entity [17858][ammo_5.56x45_ap:ammo_5.56x45_ap17858] [23886]
sv reject. id_parent [17856][stalker:gen_monolit_stalker_0] id_entity [17857][device_pda:device_pda17857] [23886]



My xr_gulag is like the one I have posted.
  14:29:18  24 January 2011
profilee-mailreply Message URLTo the Top
Vintar
a bit of this and a lot of that
(Resident)

 

 
On forum: 08/08/2008
Messages: 6349
Two problems I noticed straight away :

1) there are two "end" statements missing in your load_job function.

2) in your gulag.ltx file, there is no need for the section :
[path_monolith0]

points = p0
p0:name = wp00|sig=path_end
p0: position = 6.214975357056,25.985639572144,-131.96838378906
on_signal = path_end | nil



Just add the line "on_signal = path_end | nil" to the [walker@smart_generators_monolith0] section under "path_walk" line.

and the statment on_signal = path_end| nil does nothing anyway and is probably not needed as when the NPC reaches the end of the path, he will just stand there anyhow.
  14:58:32  24 January 2011
profilee-mailreply Message URLTo the Top
crucifist
(Senior)
 
On forum: 12/14/2009
 

Message edited by:
crucifist
01/24/2011 15:06:00
Messages: 105
Thanks, once again you solve my problem. I should build a statue of you and pray it everyday :-\
 
Each word should be at least 3 characters long.
Search:    
Search conditions:    - spaces as AND    - spaces as OR   
 
Forum Index » S.T.A.L.K.E.R.: Shadow of Chernobyl Forum » Mod discussion
 

All short dates are in Month-Day-Year format.


 

Copyright © 1995-2020 GSC Game World. All rights reserved.
This site is best viewed in Internet Explorer 4.xx and up and Javascript enabled. Webmaster.
Opera Software products are not supported.
If any problem concerning the site functioning under Opera Software appears apply
to Opera Software technical support service.