ProjectsWhat's NewDownloadsCommunitySupportCompany
Forum Index » S.T.A.L.K.E.R.: Shadow of Chernobyl Forum » Mod discussion
Dual Question: .Xml error & Logic Modding...

« Previous 10 events | 1 2 | All Messages
Posted by/on
Question/AnswerMake Newest Up Sort by Descending
  19:20:54  5 July 2012
profilee-mailreply Message URLTo the Top
insanelazarez
Yeah, Good Luck With That...
(Resident)

 

 
On forum: 01/31/2009
Messages: 1070

---QUOTATION---
Can I assign logics to custom, unique NPCs which I spawned via .script without touching the all.spawn? And if so, how?

Thanks for reading.
---END QUOTATION---



Yes, i assume you have a spawn section... right?


---QUOTATION---


[npc_section_whatever]:stalker
$spawn = "respawn\npc_section_whatever"
character_profile = npc_section_whatever_profile_name
spec_rank = veteran
community = stalker
custom_data = scripts\mod\npc_section_whatever_logic.ltx


---END QUOTATION---



So... assuming you have a spawn section... you just need:

1 - Change the sections to be used with correct names

2 - Create in 'config\scripts\mod\' a file with the 'custom data' line reference... in this case 'npc_section_whatever_logic.ltx'

And this 'npc_section_whatever_logic.ltx' is where you put the logic for the npc.

Have fun.
  20:59:16  5 July 2012
profilee-mailreply Message URLTo the Top
DutyStalker666
Senior Resident
 

 
On forum: 10/25/2011
Messages: 169

---QUOTATION---
Can I assign logics to custom, unique NPCs which I spawned via .script without touching the all.spawn? And if so, how?

Thanks for reading.

Yes, i assume you have a spawn section... right?



[npc_section_whatever]:stalker
$spawn = "respawn\npc_section_whatever"
character_profile = npc_section_whatever_profile_name
spec_rank = veteran
community = stalker
custom_data = scripts\mod\npc_section_whatever_logic.ltx



So... assuming you have a spawn section... you just need:

1 - Change the sections to be used with correct names

2 - Create in 'config\scripts\mod\' a file with the 'custom data' line reference... in this case 'npc_section_whatever_logic.ltx'

And this 'npc_section_whatever_logic.ltx' is where you put the logic for the npc.

Have fun.
---END QUOTATION---



Hello, thanks for explaining how to do this
I'm gonna have so much fun messing around with the logics of the ai.

I edited my spawn_sections.ltx so the custom data reference is:
config/scripts/mod/esc_army_trader_rookie.ltx

In the esc_army_trader_rookie.ltx, I have this:


---QUOTATION---
[logic]
active = walker
on_hit = hit
on_death = death

[walker]

path_walk = esc_wounded_fox_walk
path_look = esc_wounded_fox_look
---END QUOTATION---



This should make my NPC walk to where fox should be.. However, my character wandered around one of the houses in the rookie village and then he started making his way to the military outpost base in cordon...

Also, my character sometimes doesn't spawn. I have the spawn.script in my script folder and it works but I must start a new game and quit the current game once or twice in order for him to spawn. Any idea why?

Cheers
  20:55:59  6 July 2012
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
07/06/2012 20:56:48
Messages: 1902
Where did you spawn him ? It's imporant because if he is too far the engine takes care of the npc until it reaches his waypoint and he can detour a lot.
Also did you add the

 
[smart_terrains]
none = true 



section ? If not he could be captured by a gulag.

Also that logic you've posted misses the hit and death sections.
Most likely you need the add a danger_condition section so the npc ignores the mutants that are close.
  21:42:27  6 July 2012
profilee-mailreply Message URLTo the Top
insanelazarez
Yeah, Good Luck With That...
(Resident)

 

 
On forum: 01/31/2009
Messages: 1070

---QUOTATION---
Where did you spawn him ? It's imporant because if he is too far the engine takes care of the npc until it reaches his waypoint and he can detour a lot.
Also did you add the

[smart_terrains]
none = true


section ? If not he could be captured by a gulag.

Also that logic you've posted misses the hit and death sections.
Most likely you need the add a danger_condition section so the npc ignores the mutants that are close.
---END QUOTATION---



Lijenstina, everything you said is correct... But the 'smart_terrains = true' is not always effective... in special if created by script. I recall several examples of sections created by me to be used in agroprom (killers) and Darkvalley (bandits) and it was bad... it was like for each 10 npcs... 70% left the logic and were assumed by a smart terrain in the momment they spawned. I tested the killer's example a lot... and the 'smart terrains/none = true' was there. Now imagine the same scenario in pripyat with monolith stalkers... aha... good luck with that. I mean, you are spawning him by script and zap... and the guy is already flying... his objective? Well see that rooftop 'right there'? That's his objective. And you are like... 'What the hell is that? Superman?'. And Mister GSC says 'NO, it's the pri_monolith smartie'. Aha.

Btw, in my 'Global Action Mod' (not released yet)... the 'pri_monolith' smart is present ONLY if Charon is NOT DEAD. You kill the bastard, and the smart is gone.
  02:06:15  7 July 2012
profilee-mailreply Message URLTo the Top
DutyStalker666
Senior Resident
 

 
On forum: 10/25/2011
Messages: 169

---QUOTATION---
Where did you spawn him ? It's imporant because if he is too far the engine takes care of the npc until it reaches his waypoint and he can detour a lot.
Also did you add the

 
[smart_terrains]
none = true 



section ? If not he could be captured by a gulag.

Also that logic you've posted misses the hit and death sections.
Most likely you need the add a danger_condition section so the npc ignores the mutants that are close.
---END QUOTATION---



I just put in the smart terrains part... I remember once I traveled for a bit because he didn't spawn outside sid's bunker and I found him as a corpse next to that tunnel with the 19xmm ammo box and the energy drink and campfire

Tested it with smart terrains and he is a part of the rookie village
I think the rookie village is esc_lager?

Here is my logic .ltx:

http://pastebin.com/86L5izY3

It has the no smart terrains and the hit n death parts... I am trying to make him walk where Fox walks (guy you save from the mutant dogs "phew.. we're done with these mutants..."
  16:54:31  7 July 2012
profilee-mailreply Message URLTo the Top
insanelazarez
Yeah, Good Luck With That...
(Resident)

 

 
On forum: 01/31/2009
Messages: 1070
I have a code for you. Read the post carefully.

[link]http://pastebin.com/P5QWG6AB[/link]

Tell me something DutyStalker666, ok?
  19:35:06  7 July 2012
profilee-mailreply Message URLTo the Top
DutyStalker666
Senior Resident
 

 
On forum: 10/25/2011
Messages: 169

---QUOTATION---
I have a code for you. Read the post carefully.

[link]http://pastebin.com/P5QWG6AB[/link]

Tell me something DutyStalker666, ok?
---END QUOTATION---



Thanks a lot for taking time to write this and explaining everything very well I lolled at the wpn_vintorez;LOL.. I can just imagine "Yuri The Drunk Russian" assaulting the Freedom base by himself lol.

I have made the appropriate modifications to the logic. However, When I start a game, I got some kind of crash. The error log was something along the lines off.... "Failed to callback game engine" or something... It was fixed as soon as I un-commented line 20 in _g.script Needles to say, the logic did not work.. Probably because I need to comment line 20. Are you sure its line 20?

Here's the new logic: http://pastebin.com/55D2QAvG
I kept the comments and the names in case I forget how to do something, all I gotta do is look at this tutorial

Here is the new logic:

http://pastebin.com/55D2QAvG
  20:30:03  7 July 2012
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
07/07/2012 20:36:58
Messages: 1902
You have errors in the sections names
The logic fails and the engine picks up the NPC in the gulag.

I'll try to fix them.


[smart_terrains]
none = true

[spawn]
wpn_pkm
ammo_7.62x54r = 300
wpn_vintorez
ammo_9x39_pab9 = 7
medkit = 4
bandage = 12
device_torch
grenade_f1 = 1
guitar_a

[dont_spawn_character_supplies]

[logic]
active = camper@start
meet = meet
combat_ignore = combat_ignore
on_death = death

[death]
on_info = %=play_snd(characters_voice\scenario\military\dolg_attack\base\mil_dolg_down_3)%
 
[combat_ignore]

[camper@start]
wounded = wounded@test
path_walk = esc_stalker_camp_esc_wounded_fox_walk
path_look = esc_stalker_camp_esc_wounded_fox_look
combat_ignore_cond = {=fighting_actor =fighting_dist_ge(25)}
danger = danger_condition
meet = no_meet
on_info = {+escape_fox_heal} remark@if_fox_is_ok
on_info2 = {+esc_dogs_return} remark@if_fox_is_dead

[remark@if_fox_is_ok]
wounded = wounded@test
no_move = true
anim = press
target = actor
snd = story_reac_laughter
combat_ignore_cond = {=fighting_actor =fighting_dist_ge(25)}
danger = danger_condition
meet = no_meet
on_signal = sound_end | kamp@last_code
on_timer = 30000 | kamp@last_code
on_info = {+esc_dogs_return} remark@if_fox_is_dead

[remark@if_fox_is_dead]
wounded = wounded@test
no_move = true
anim = sit_knee
target = 5
snd = val_escort_dead
combat_ignore_cond = {=fighting_actor =fighting_dist_ge(25)}
danger = danger_condition
meet = no_meet
on_signal = sound_end | kamp@last_code
on_timer = 30000 | kamp@last_code

[kamp@last_code]
center_point = esc_stalker_camp_esc_fox_kamp
path_walk = esc_stalker_camp_esc_fox_kamp_task
combat_ignore_cond = {=fighting_actor =fighting_dist_ge(25)}
danger = danger_condition
meet = meet

[danger_condition]
ignore_distance = 25
ignore_types = grenade, hit, corpse, sound
ignore_distance_grenade = 5
ignore_distance_corpse = 1
ignore_distance_hit = 150
ignore_distance_sound = 30
danger_inertion_time_grenade = 2000
danger_inertion_time_corpse = 190
danger_inertion_time_hit = 2000
danger_inertion_time_sound = 1500
danger_inertion_time_ricochet = 1000

[wounded@test]
hp_state     = 30|help_me@help|10|wounded_heavy@help_heavy
hp_state_see = 30|wounded@help_see|10|wounded_heavy@help_heavy
psy_state    = 50|{=best_pistol} psy_armed,psy_pain@wounded_psy|20| {=best_pistol} psy_shoot,psy_pain@ {=best_pistol} wounded_psy_shoot,wounded_psy
hp_victim    = 30|actor|10|nil
hp_cover     = 30|true|10|false
hp_fight     = 30|true|10|false
syndata      = wounded@help

[meet]
use = true
use_wpn = true
meet_talk_enabled = true


 
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-2021 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.