example of adding NPCs & mutants to all.spawn

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

Postby ket on 15 Nov 2008 04:15

Everything is going well so far, just need a little something clarified. Doing respawns I want to use a condition so the respawns will always happen, with the actor in the level or out. Heres the code I' using atm;

[2209]
; cse_abstract properties
section_name = respawn
name = cat_weak_respawn_1
position = -166.40,-2.62,-77.06
direction = 0,0,0

; cse_alife_object properties
game_vertex_id = 73
distance = 150
level_vertex_id = 168210
object_flags = 0xffffffbf
custom_data = <<END

[respawn]
cond = {+esc_boar_dogs_restrictor}
respawn_section = cat_weak
max_spawn = 6
idle_spawn = medium
[smart_terrains]
none = true
END


Is that condition ok to use? Maybe I need somebody to give a explanation of how conditions work :scratch: Oh and how can I make a smart terrain so certain NPCs go gather around a campfire?
Mobo: MSI X570 Tomahawk
CPU: R7 3700X @ 4.4GHz 1.3v
RAM: 2x16GB Klevv BoltX 3600MHz 16-20-20-35
GPU: Powercolor 6800XT Red Devil
Sound: Asus Xonar DX 7.1 PCI-E, Realtek ALC1200
HDD: 250GB & 500GB nVME 3.0 M.2 drives, 2TB Seagate Barracuda, Sata3 64MB Cache, 250GB Hynix SL301
Opticals: DVD-RW, Blu-Ray
PSU: eVGA 1000w G2 Supernova
Case: NZXT Phantom 530

STALKER: Singularity (SIN) homepage
User avatar
ket
Senior Resident
 
Posts: 1262
Joined: 14 Sep 2008 11:57
Location: The solar system

Postby EggChen on 15 Nov 2008 14:03

The conditions don't work like that ket sorry.

Basically you will see many of the conditions are things like yan_kill_brain_done, or bar_radar_deactivate.... they are designed to change spawns and smart terrains after storyline events.

That info-portion you have I think it means that you have enteered a certain area in Cordon, but when you leave that area, I'm not sure you "lose" that inforportion. So the condition will always be true, and the spawns will happen wherever you are.

Also, the condition only applies when the se_respawn.script tries to perform that respawn, so at whatever interval you have defined as seldom, medium, often.

My understanding is it would go in this order.... in very very horrible Eggscript.

- Does actor have required infoportion, no, then skip this respawn.
- If yes, has minimum time passed? (last spawn plus seldom, etc)
- What is the chance and max number of spawns....
- For each number up to max, do math.random against chance.

If you wanted something to happen only when your on a level, you could use a simple spawn script.... or.....

Create some inforportions, "actor_on_escape", etc, etc.

Then use a simple script to add and remove these inforportion according to which level you are on, you could add this to the level begin function in escape tasks, like you probably had your spawn script.....

Edit: Never messed with smart terrains other than changing communities and capacities, etc. I know the smart_terrain article on the WIKI has some stuff that may be useful.... also check out the logic article, you will need to look at the "camper" scheme for the activity around campfires.
User avatar
EggChen
Moderator
 
Posts: 1016
Joined: 13 Sep 2008 00:44
Location: Birmingham, UK

Postby ket on 15 Nov 2008 15:07

Damn.. what if I was to simplify things and do something like cond = 70, 70 being a 70% chance for a respawn to happen on level entry.
Mobo: MSI X570 Tomahawk
CPU: R7 3700X @ 4.4GHz 1.3v
RAM: 2x16GB Klevv BoltX 3600MHz 16-20-20-35
GPU: Powercolor 6800XT Red Devil
Sound: Asus Xonar DX 7.1 PCI-E, Realtek ALC1200
HDD: 250GB & 500GB nVME 3.0 M.2 drives, 2TB Seagate Barracuda, Sata3 64MB Cache, 250GB Hynix SL301
Opticals: DVD-RW, Blu-Ray
PSU: eVGA 1000w G2 Supernova
Case: NZXT Phantom 530

STALKER: Singularity (SIN) homepage
User avatar
ket
Senior Resident
 
Posts: 1262
Joined: 14 Sep 2008 11:57
Location: The solar system

Postby EggChen on 15 Nov 2008 16:01

Nope, its not level entry..... its whenever the se_respawn script determines that the minimum time has passed....

Forget all about level entry unless your scripting spawns!!

The exception is (if you want to use all.spawn), you would have to create info-portions for being on a particular level, and a script to add/remove them accordingly.
User avatar
EggChen
Moderator
 
Posts: 1016
Joined: 13 Sep 2008 00:44
Location: Birmingham, UK

Postby ket on 15 Nov 2008 16:17

Well in se_respawn I have respawns set to 180, maybe I'll continue to use space restrictor conditions for now and see how things pan out when playtesting.
Mobo: MSI X570 Tomahawk
CPU: R7 3700X @ 4.4GHz 1.3v
RAM: 2x16GB Klevv BoltX 3600MHz 16-20-20-35
GPU: Powercolor 6800XT Red Devil
Sound: Asus Xonar DX 7.1 PCI-E, Realtek ALC1200
HDD: 250GB & 500GB nVME 3.0 M.2 drives, 2TB Seagate Barracuda, Sata3 64MB Cache, 250GB Hynix SL301
Opticals: DVD-RW, Blu-Ray
PSU: eVGA 1000w G2 Supernova
Case: NZXT Phantom 530

STALKER: Singularity (SIN) homepage
User avatar
ket
Senior Resident
 
Posts: 1262
Joined: 14 Sep 2008 11:57
Location: The solar system

Postby Victim on 23 Nov 2008 10:22

EggChen wrote:For example I have done...NPC's switching smart terrains after info portions...


Hi EggChen, I've been wondering if you were referring to SoC or CS when you said that? If you were referring to CS, would you mind explaining how you made this happen. I can do it in SoC but I've found that CS inserts a lot of external variables which have prevented me from being able to have a unique NPC move to a smart terrain on another level via info portion instruction (i.e. as Wolf does in SoC from esc_lager-mil_lager). CS doesn't seem to want to let me to insert a waypoint path to achieve this either - I do not know why. I've tried using paths (wp00-wpxx), path smart combinations (wp01-existing level smart-new level smart) as well as unique smarts (spawn on smart-new level smart) but the only way I've been able to move a unique NPC to another level in CS is by deleting (killing on timer after actor has left level) the initial NPC and then spawning a replicate on the new level (before actor gets through level changer) - it's very cumbersome and although it does work fine, I imagine that a fair amount of extra work could be avoided if I could simply make a unique NPC switch levels at will. If you know a way that this can be done, I'd be very grateful for any help you can offer.
Victim
Senior Resident
 
Posts: 19
Joined: 22 Nov 2008 11:57

Postby EggChen on 23 Nov 2008 13:44

Hey Victim,

Sorry I cannot help you buddy!!

I have not touched Clear Sky, apart from ripping a couple of textures and a 5 minute play of the game before I gave up.

Couple of thoughts:

- Does any NPC do this in CS? Just wondering if it is disabled for some reason.
- How about creating a "mirror" of the NPC? Like Kruglov in SHOC.... take the first one offline, and spawn the second at the new location.
User avatar
EggChen
Moderator
 
Posts: 1016
Joined: 13 Sep 2008 00:44
Location: Birmingham, UK

Postby Victim on 24 Nov 2008 05:07

EggChen wrote: - Does any NPC do this in CS? Just wondering if it is disabled for some reason.


There don't appear to be any unique NPCs that walk between levels in CS - and the ones that do are all spawned - i.e. a copy of the Clear Sky Commander is spawned on the final level when Scar arrives there.

EggChen wrote: - How about creating a "mirror" of the NPC? Like Kruglov in SHOC.... take the first one offline, and spawn the second at the new location.


Yes, this is currently the only way I've been able to do this in CS - though as I mentioned, it's quite clumsy and it involves a fair amount of extra work. I wanted to create a pursuit scene that moves a unique NPC across 5 levels but after creating the 3rd copy of the NPC, I figured that it was time to ask the real brains of the STALKER community for some advice.
Think I'll just create the show-down on the 3rd level instead. :iconbiggrin:

Thanks for your reply EggChen. :thumbup:
Victim
Senior Resident
 
Posts: 19
Joined: 22 Nov 2008 11:57

Postby EggChen on 24 Nov 2008 22:18

Victim wrote:I figured that it was time to ask the real brains of the STALKER community for some advice.


So were they busy?? O:)

No worries buddy, sorry I could not help more, I have not been impressed with Clear Sky, and so have not touched it modding wise.

However, I now have a new rig capable of playing it in all its glory, so will be trying again, will be sure to check out Redux.
User avatar
EggChen
Moderator
 
Posts: 1016
Joined: 13 Sep 2008 00:44
Location: Birmingham, UK

Postby Victim on 25 Nov 2008 10:09

EggChen wrote:...will be sure to check out Redux.


Nooo, don't do that! If you're thinking about playing Clear Sky with a mod I'd recommend the Basix mod or the Faction Commander mod instead - they both seem to be more 'complete' whereas Redux was just my attempt at alleviating the horribleness that was vanilla Clear Sky - because, like yourself, I was also very disappointed with the game...I played for about 15 minutes before I found myself hacking into it to dismember the item drops - I'd found myself with about 200 9x18 FMJ rounds and figured that if that was a result of 15 minutes, there was no way in hell that the game was going to provide a challenge, let alone any sort of resource management requirement. I'll give you a yell whenever I feel that it's worthy of being played by another modder...that could be a while though. :D

EggChen wrote:The exception is (if you want to use all.spawn), you would have to create info-portions for being on a particular level, and a script to add/remove them accordingly.


You could also try using the following functions in a logic script:
{=actor_in_zone(your_space_restrictor_name)}
{=actor_out_zone(your_space_restrictor_name)}


It removes the need for any info portions and it works as an effective on/off switch - you can use the "in_zone" to spawn and once the actor is in "out_zone" the spawns will switch off. Could pay to add an "on_game_timer" function as well - just in case anyone was to run back and forth over the restrictor a couple of times which could create a large number of unwanted spawns.
Victim
Senior Resident
 
Posts: 19
Joined: 22 Nov 2008 11:57

Postby EggChen on 25 Nov 2008 20:46

Well Redux is more of the style I had hoped for from Clear Sky.... at the very least I will have a look at the files!!

At this moment though I am busy trying out games on my new GTX280, so Stalker has not had much of a look in yet!! I will give CS a go on full graphics though!! I'll be playing a vanilla playthrough as much as it pains me, that way I'll know what needs fixing, and if its worth the hassle!!
User avatar
EggChen
Moderator
 
Posts: 1016
Joined: 13 Sep 2008 00:44
Location: Birmingham, UK

Postby Victim on 26 Nov 2008 05:36

Despite the fact that I think that the game itself is inferior in many ways to SoC - I do actually think that it'd be well worth seeing the established SoC modders switching over - if only for the fact that CS has introduced "smart_cover" - I haven't quite got it figured out yet, suffice to say that it does vastly improve the combat AI...or at least the potential is there. Then of course you've got the very high likelihood than everything that GSC has either disabled or removed could be added in again.

Apologies for taking this thread off topic.

Umm...here's some useless on topic jargon that everyone likely already knows:

Code: Select all
[yan_walker_zombie_cut6_way_9a_walk]
points = p0,p1
p0:name = name00
p0:position = 28.2933578491211,0.0541299991309643,-60.3340301513672
p0:game_vertex_id = 1246
p0:level_vertex_id = 72950
p0:links = p1(1)

p1:name = name01
p1:flags = 0x1
p1:position = 30.1505451202393,0.0539500005543232,-52.6864929199219
p1:game_vertex_id = 1246
p1:level_vertex_id = 73969
p1:links = p0(1)


NB: This is not a good example of the following text - the path above is simply a two point loop (p0 to p1 - p1 to p0).

Hmm, I guess that if there's one thing I've learned about using waypoints it's that you can actually have too many as well as too few. I believe that the engine actually reads the destination and sets it as the priority target - so having too few points can result in an NPC moving towards that destination quite some way before they'll very abruptly change direction to move to the next waypoint on the path. Hope that makes some sense. On the flipside, although having many points will likely have the NPC adhering very well the to path, if the movement state is set to anything but 'walk' you will also be witness to very abrupt changes in the AI movement speed - i.e. if the NPC is aiming at point 3 with the |a=run command, it will still enter a 'walk' state as it crosses point 3, even if point 4 is also set as |a=run. So to summarize: In order to achieve a degree of believability, choosing the right positions as well as the right number of points in a path can be quite important.

There we go - back on topic. :)
Victim
Senior Resident
 
Posts: 19
Joined: 22 Nov 2008 11:57

Postby ket on 27 Nov 2008 16:39

We don't mod CS, for as you rightly said, CS is inferior in many ways to SoC, with much more stuff in CS being hard-coded into DLL files :toimonster:

On the plus side, whatever GSC has added to CS, 99%+ of it can be added to SoC with enough ingenuity :mozilla_tongue:
Mobo: MSI X570 Tomahawk
CPU: R7 3700X @ 4.4GHz 1.3v
RAM: 2x16GB Klevv BoltX 3600MHz 16-20-20-35
GPU: Powercolor 6800XT Red Devil
Sound: Asus Xonar DX 7.1 PCI-E, Realtek ALC1200
HDD: 250GB & 500GB nVME 3.0 M.2 drives, 2TB Seagate Barracuda, Sata3 64MB Cache, 250GB Hynix SL301
Opticals: DVD-RW, Blu-Ray
PSU: eVGA 1000w G2 Supernova
Case: NZXT Phantom 530

STALKER: Singularity (SIN) homepage
User avatar
ket
Senior Resident
 
Posts: 1262
Joined: 14 Sep 2008 11:57
Location: The solar system

Previous

Return to Modding Techniques

Who is online

Users browsing this forum: No registered users and 18 guests