ProjectsWhat's NewDownloadsCommunitySupportCompany
Forum Index » S.T.A.L.K.E.R.: Shadow of Chernobyl Forum » Mod discussion
Assigning a Smart Terrain to a NPC spawned by script

« Previous 10 events | 1 2 3 4 5 | All Messages
Posted by/on
Question/AnswerMake Newest Up Sort by Descending
  21:51:41  21 April 2014
profilee-mailreply Message URLTo the Top
Vintar
a bit of this and a lot of that
(Resident)

 

 
On forum: 08/08/2008
Messages: 6349
Try using two infos as in my example. Possible there may be some issue with just using one and disabling it or something, not really sure, all I know is that I created similar to my example and it works.
  22:19:38  21 April 2014
profilee-mailreply Message URLTo the Top
SacriPan
Senior Resident
 

 
On forum: 09/20/2009
Messages: 319
Ok I'll try that.

Any clue about for the sleeper not sleeping (but snoring...)?
  10:40:28  22 April 2014
profilee-mailreply Message URLTo the Top
SacriPan
Senior Resident
 

 
On forum: 09/20/2009
 

Message edited by:
SacriPan
04/22/2014 17:45:19
Messages: 319

---QUOTATION---
I have a problem with 1 NPC's Logic.

He's supposed to go to sleep at night.

The thing is, he goes to the coordinates, but adopts a "camp" attitude, though, he snores...
Any clue on this strange behavior?
---END QUOTATION---



I got this working. The NPC sleeps and snores

There is a "wakeable" tag in the Logic that needs to be set to false. I had set it to true, thinking is was necessary so the player can wake up the sleeping NPC and talk to him, but no, it seems that even with "wakeable = false", the player can wake him up and talk to him, and setting it to false allow him to adopt the sleeping animation.
  11:42:16  22 April 2014
profilee-mailreply Message URLTo the Top
Vintar
a bit of this and a lot of that
(Resident)

 

 
On forum: 08/08/2008
Messages: 6349
Yes its one of those quirky stalker things
  14:18:43  28 July 2014
profilee-mailreply Message URLTo the Top
SacriPan
Senior Resident
 

 
On forum: 09/20/2009
 

Message edited by:
SacriPan
07/28/2014 22:11:45
Messages: 319
Hi guys,

I got a strange bug that I can't get rid of.

I set up my kamps (defined by script, no ST here) where NPC are supposed to occupy a job, then move to an other camp after a while.

It's working great but whenever I save (fast save or manual save), the next time a NPC has to change camp (I set him offline and give him a new logic containing his new job at an other camp), he just won't move... He goes offline as he's supposed to, but is doesn't seem to assimilate the new logic and stays at the same camp. I have a (working) debug function showing me the camp that he is assigned to and considering my script, his moves from camp to camp makes perfect sense (3 camps only for testing).
There is no typo in the logic config file.

If I don't save the game, the script is running FINE and all NPC change job/camp whenever they have too.

Do you know anything about such behavior?

I can't possibly make a MOD that requires the player not to save



EDIT:
I erased the save/load functions in my script to see if they messed up the script itself and I did a new test... same problem.
  21:21:43  28 July 2014
profilee-mailreply Message URLTo the Top
Vintar
a bit of this and a lot of that
(Resident)

 

 
On forum: 08/08/2008
Messages: 6349
Possibly the NPC logic is reset on save/load and so they go back to their first logic section. We found this problem a few times in LA. The only answer was to have the first scheme used in logic to be [remark] and then when their logic is reset, they wont try and use the same old path because a path is not needed in remark scheme. Hard to explain in writing
  22:09:15  28 July 2014
profilee-mailreply Message URLTo the Top
SacriPan
Senior Resident
 

 
On forum: 09/20/2009
 

Message edited by:
SacriPan
07/28/2014 22:34:11
Messages: 319
I don't quite understand the use of the [remark] section but I have to point out that I don't load the game.

I just start a new game and then save. I don't reload.
It's the action of saving that breaks their logic.

Also note that NPC don't wander around after that. They continue to use their previous logic (camp/job).

I'm gonna loot for this [remark] section in the vanilla files in case I can get something out of it.


EDIT:

Did you meant that upon save/reload, a NPC would "choose" the first section in its logic file?
Because in my case, I got a job per script, it looks like this:

[smart_terrains]
none = true

[logic]
active = kamp@job_day
meet = meet@pan

[meet@pan]
use = true
use_wpn = true
meet_talk_enabled = true
meet_state = ward
use_medkit = true

;-- DAY & NIGHT
[kamp@job_day]
path_walk = <path_camp_name>_task
center_point = kamp_01
radius = 2
def_state_moving = patrol


As you can see there is only one thing for the NPC to do. In ythis exmplae, he sits at a kampfire.
Is this config file well written?
  22:18:00  11 August 2014
profilee-mailreply Message URLTo the Top
SacriPan
Senior Resident
 

 
On forum: 09/20/2009
 

Message edited by:
SacriPan
08/11/2014 22:21:28
Messages: 319
Mutant Logic & packet_utils

Hi,

I got a little problem with my mutant Logic.

What I do in the script is:
sObj = alife():create(p_profile, f_pos, f_level_id, f_game_id)

f_object_data = packet_utils.get_object_data(sObj )
f_object_data.custom_data = "[logic]\n cfg = scripts\\my_config.ltx"
packet_utils.set_object_data(sObj , f_object_data)

where "p_profile" is a valid section:
[pan_dog_weak]:dog_weak
$spawn = "respawn\pan_dog_weak"

the Logic seems OK too:
[smart_terrains]
 none = true

[logic]
 active = mob_home

[mob_home]
 path_home = lair_02
 home_min_radius = 1
 home_max_radius = 5

"lair_02" is a valid point defined in all.spawn.

Note that if I defined the logic directly in the "pan_dog_weak" section, it works, but I can't use it like this, because my mutant are supposed to change camp ver time in a random way (done in my script)


I did this for my NPC and it works fine but mutants seems to not like this...
I'm lost here. I thought it would be quite easy now that I did it for my NPC but I'm stuck again ;-(


Any clues on what's wrong here? Could it be related to packet_utils?
  21:52:08  12 August 2014
profilee-mailreply Message URLTo the Top
SacriPan
Senior Resident
 

 
On forum: 09/20/2009
Messages: 319
Hmmm...

Seems that I need to assign the logic to the mutant while it's offline, and then wait for an update and switch it back online so it can go to his camp.

Very strange, since I can assign a logic to a freshly spawned NPC without having to use this trick.
  14:56:57  14 August 2014
profilee-mailreply Message URLTo the Top
SacriPan
Senior Resident
 

 
On forum: 09/20/2009
Messages: 319
Don't mind the 2 posts above.

After further testing, I got it working as it should.

I think I had a global variable somehere in an unsused function of my script that was messing with the needed variables.
After removing all the portions of unused code, I did a quick test and it worked!

Thanks for those who cared
 
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.