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

1 2 3 4 5 | Next 10 events »| All Messages
Posted by/on
Question/AnswerMake Oldest Up Sort by Ascending
  00:27:25  4 April 2013
profilee-mailreply Message URLTo the Top
insanelazarez
Yeah, Good Luck With That...
(Resident)

 

 
On forum: 01/31/2009
Messages: 1070

---QUOTATION---
And another thing, i'm sick when i have to fill so many tables, so i usually use this function:


function fill_tbl(section, idle, prior, states, squad, group, in_rest, out_rest, online, gulag_name)
local tbl = {}

tbl.section = "logic@" .. gulag_name .. "_" .. section
tbl.idle = idle
tbl.prior = prior
tbl.state = {}

for index = 1, #states do
table.insert(tbl.state, states[index])
end

tbl.squad = squad
tbl.group = group
tbl.in_rest = in_rest
tbl.out_rest = out_rest
tbl.online = online
return tbl
end
---END QUOTATION---




Ok, this seems cool... wait, but this specific code is added where? This one confuses me. Please Master Barin, show me your magic...

Thank you in advance.
  12:35:58  26 January 2011
profilee-mailreply Message URLTo the Top
crucifist
(Senior)
 
On forum: 12/14/2009
Messages: 105

---QUOTATION---
In load states you never wrote " return 0" instead you wrote just "return" this will cause problems.
As for the confusing concatenation stuff, let me try explain more.
If your smart terrain is called "test_terrain" then in your way_***.ltx (and SDK for that matter) you will enter your path names which must start with your smart terrain name eg: "test_terrain_bandit_one"
however, in the gulag_***.ltx when you write : "path_walk =" here you will simply write the path name without the smart terrain name ie: "bandit_one"
---END QUOTATION---



The problem was the name of the path ... Once again, thanks everyone.
My NPC isn't spawned but the smart terrain is working!
  08:49:39  26 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
In load states you never wrote " return 0" instead you wrote just "return" this will cause problems.
As for the confusing concatenation stuff, let me try explain more.
If your smart terrain is called "test_terrain" then in your way_***.ltx (and SDK for that matter) you will enter your path names which must start with your smart terrain name eg: "test_terrain_bandit_one"
however, in the gulag_***.ltx when you write : "path_walk =" here you will simply write the path name without the smart terrain name ie: "bandit_one"
  20:27:22  25 January 2011
profilee-mailreply Message URLTo the Top
crucifist
(Senior)
 
On forum: 12/14/2009
 

Message edited by:
crucifist
01/25/2011 20:47:35
Messages: 105

---QUOTATION---
"C STACK OVERFLOW"
gives you the hint that some condition or check is repeatedly called so your memory gets overflowed.

I would try the gulag with simpliest logic and conditions first to check if the static stuff is working correctly (smart, waypoints, file assignements, ...).
If this is working try to get all jobs for state 1 running flawlessly.
If that is working try to implement the second state.
---END QUOTATION---



The last functiont executed is checkStalker(). In fact checkStalker and checkMonster are called many times.

I'm going to simplify my scripts and logics.
  20:13:54  25 January 2011
profilee-mailreply Message URLTo the Top
gannebamm
has abondened XRay and uses Unity3D now
(Resident)

 

 
On forum: 05/02/2007
Messages: 1077
"C STACK OVERFLOW"
gives you the hint that some condition or check is repeatedly called so your memory gets overflowed.

I would try the gulag with simpliest logic and conditions first to check if the static stuff is working correctly (smart, waypoints, file assignements, ...).
If this is working try to get all jobs for state 1 running flawlessly.
If that is working try to implement the second state.
  19:45:02  25 January 2011
profilee-mailreply Message URLTo the Top
crucifist
(Senior)
 
On forum: 12/14/2009
 

Message edited by:
crucifist
01/25/2011 19:56:26
Messages: 105
(let me know if I disturb the forum "upping" this topic)

More and more problems ....


Well, know my function load_job() is correctly executed, like load_ltx(), checkStalker(), checkMonster().

But, the function load_state isn't executed at all. Here it is:


function load_states(gname, type)
	get_console():execute("load_state_starting")
	if type == "smart_generators_monolith" then
		get_console():execute("load_state_condition")
		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
				get_console():execute("state_0")
				return 
			else
				get_console():execute("state_1")
				return 1 		
			end	
		end
	end	
end



I have checked the script with luachecker, nothing seems wrong about the syntax.

to Lijenstina :I haven't changed my logic becauce I didn't understand what you mean by :


"If you are making a gulag then in the walk and look path sections of the all.spawn need to be called with a name of the gulag first on which the name in the ltx is concatenated later."



You mean that the name of the gulag is concatenated wtih the logic?

I have changed my waypoint.ltx as you mentionned.

The problem could come from my logic I guess?

I have to add that the game craches during the blowout (I suppose it's due to a changement of state related to the blowout). The error is:


FATAL ERROR
 
[error]Expression    : fatal error
[error]Function      : CScriptEngine::lua_error
[error]File          : E:\stalker\sources\trunk\xr_3da\xrGame\script_engine.cpp
[error]Line          : 73
[error]Description   : <no expression>
[error]Arguments     : LUA error: ...hadow of chernobyl\gamedata\scripts\state_mgr.script:145: C stack overflow
 

stack trace:

Scheduler tried to update object gen_monolit_stalker_0000
 
FATAL ERROR
 
[error]Expression    : fatal error
[error]Function      : CScriptEngine::lua_error
[error]File          : E:\stalker\sources\trunk\xr_3da\xrGame\script_engine.cpp
[error]Line          : 73
[error]Description   : <no expression>
[error]Arguments     : LUA error: ...ow of chernobyl\gamedata\scripts\xr_motivator.script:221: C stack overflow
 

stack trace:

Scheduler tried to update object gen_monolit_stalker_0001
 
FATAL ERROR
 
[error]Expression    : fatal error
[error]Function      : CScriptEngine::lua_error
[error]File          : E:\stalker\sources\trunk\xr_3da\xrGame\script_engine.cpp
[error]Line          : 73
[error]Description   : <no expression>
[error]Arguments     : LUA error: ...ow of chernobyl\gamedata\scripts\bind_stalker.script:237: C stack overflow
 

stack trace:



If you need to see the others scripts, let me know I will update my post.

Once again, let me know if you think that I "spam" the forum, and I won't do it anymore.

EDIT: without smart terrain, blowouts work fine.
EDIT2: Vintar, the SDK generates "dirty code"?
  15:35:28  24 January 2011
profilee-mailreply Message URLTo the Top
crucifist
(Senior)
 
On forum: 12/14/2009
 

Message edited by:
crucifist
01/24/2011 16:06:48
Messages: 105
@Lijenstinaj: In fact I have already read the logic tutorial. I have done some tests without gulags. But when I mix gulags/logic/spawn I'm quickly lost.

I'm going to correct my errors following your concils
  15:27:57  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

---QUOTATION---
Should be :
way_l13_generators.ltx

[smart_generators_monolith_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 


---END QUOTATION---


Nice catch, I missed that.


---QUOTATION---
The part in the ltx .
on_signal = path_end | nil will release the npc from the current logic.
---END QUOTATION---


We learn something new each day
  15:16:17  24 January 2011
profilee-mailreply Message URLTo the Top
Lijenstina
Doom metal in the shade of the flying radiators
(Resident)

 

 
On forum: 07/23/2005
 

Message edited by:
Lijenstina
01/24/2011 15:20:54
Messages: 1902
First of all read this :

http://sdk.stalker-game.com/en/index.php?title=Logic

If you are making a gulag then in the walk and look path sections of the all.spawn need to be called with a name of the gulag first on which the name in the ltx is concatenated later.

http://sdk.stalker-game.com/en/index.php?title=Logic#Gulags

Here settings correspond to regular stalker custom data, with the following difference:
  paths should be specified without a prefix. 
THat is, if the zone was called gar_maniac, a path on the level might be called 
gar_maniac_walk1, 
but gamedata\config\misc\gulag_<level name>.ltx should be specified as simply walk1.



Should be :
way_l13_generators.ltx

[smart_generators_monolith_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 



Also before making a logic that will be used in a gulag take a look on the logic tutorial on the wiki and by examining gulag.ltx-ses from vanilla. That part was wrong too like Vintar has already pointed it out.

The part in the ltx .
on_signal = path_end | nil will release the npc from the current logic.
  15:04:19  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

---QUOTATION---
Thanks, once again you solve my problem. I should build a statue of you and pray it every day :-\
---END QUOTATION---



No problem, it is what we are all here for

I have recently discovered that it is so much easier done via SDK, but I`m sure Barin wouldnt agree there
 
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.