example of adding NPCs & mutants to all.spawn

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

example of adding NPCs & mutants to all.spawn

Postby ket on 16 Sep 2008 18:12

Could somebody give me an example of how to do this? I think its the only way to fix the C stack overflows. Seems like the game just doesn't like spawning stuff via script in the quantity I need.
User avatar
ket
Senior Resident
 
Posts: 1262
Joined: 14 Sep 2008 11:57
Location: The solar system

Postby EggChen on 17 Sep 2008 00:03

I'm not sure about the best example, but a few pointers I have learnt (mostly from mistakes..). I am presuming your editing all.spawn via acdc as I have never used xrspawner, I cannot help you there, sorry.

One off spawn

- Copy a spawn item for a mutant elsewhere
- Paste it over the top of an existing mutant, crow, or inanimate object
- Change the section name, position, visual, etc.
- Add a spawn condition or smart terrain to use, again copy another example....

This is an example in Cordon, note this section used to be a crow in vanilla :)
Notes are in bold...

[336]
; cse_abstract properties
section_name = zombie_weak section in creature file
name = esc_zombie_0000 can be anything, but must be unique in all.spawn
position = -19.6100006103516,2.47000002861023,58.9099998474121 I used debug option in ZRP to collect locations
direction = 0,0,0 I usually use 0s but you can get direction using ZRP

; cse_alife_object properties
game_vertex_id = 88 ZRP debug
distance = 5 A guess, not sure what it does
level_vertex_id = 257582 ZRP debug
object_flags = 0xffffffbf Again a guess, but I copied the value for another mutant
custom_data = <<END
[logic]
cfg = scripts\zombie_rise.ltx Optional logic
[smart_terrains]
none = true
END

; cse_visual properties
visual_name = monsters\zombi\zombi_trup_1 The mesh

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

upd:health = 1
upd:timestamp = 0
upd:creature_flags = 0
upd:position = -19.6100006103516,2.47000002861023,58.9099998474121 Copy values from earlier
upd:o_model = 0
upd:o_torso = 0.000566895643714815,-0.0149095123633742,0
upd:g_team = 0
upd:g_squad = 0
upd:g_group = 0

; 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_ph_skeleton properties

; cse_alife_monster_base properties

; se_monster properties

Everything else I just left as is, works a charm.

As for respawns, I have copied a spawn section, and again pasted it over something I don't need like a box or something. Everything else is pretty similar, just change the name, location, spawn sections, etc.
User avatar
EggChen
Moderator
 
Posts: 1016
Joined: 13 Sep 2008 00:44
Location: Birmingham, UK

Postby DC- on 17 Sep 2008 00:19

Hm, you don't have to replace things, you can just add them at the bottom as long as you assign a new section ID to it (the number in [] at the top of the section).

I also recommend copying and pasting things of the same type that you want to create.
If you want to add a flesh for example, just search for "flesh", then copy and paste the section. Also saves work, you just have to change the coordinates, game/level vertex id's, smart terrain and spawn condition if necessary.
You can also add character_profiles and game logic.

The most tiresome part is collecting coordinates ingame.
It's almost like you can show me a place in cordon and I tell you what game vertex id it has. :D
Last edited by DC- on 17 Sep 2008 00:19, edited 1 time in total.
Come over here, let's have a little chat...
User avatar
DC-
Senior Resident
 
Posts: 40
Joined: 15 Sep 2008 21:00
Location: Bonn, Germany

Postby fatrap on 17 Sep 2008 00:19

The way that EggChen pointed out is by far the easiest way.... to add brand new sections you have to renumber tons of stuff. Boxes and crows are not missed....
User avatar
fatrap
Senior Resident
 
Posts: 203
Joined: 13 Sep 2008 21:20
Location: Fayetteville, Arkansas, USA

Postby EggChen on 17 Sep 2008 00:35

DC-- - Thanks, I never new that, but then again you taught me a few things about all.spawn before!!

Fatrap - Yep, I find that the safest way for us all.spawn hackers (I'm counting me and you in that, not DC-- :lol: )

For example I have done conditional spawns, NPC's switching smart terrains after info portions, even added a couple of sound sources to the game, all from looking how these things have been done elsewhere.

Another neat little trick, copy over the section for a dead mutant or Stalker (just not one with a story ID). Search for "health = 0" and you will find plenty.

Why have those dead dogs at the entrance to the Bar every time you go there?
User avatar
EggChen
Moderator
 
Posts: 1016
Joined: 13 Sep 2008 00:44
Location: Birmingham, UK

Postby DC- on 17 Sep 2008 00:52

You both have been replacing stuff every time you've added something new to your all.spawn? :o
Come over here, let's have a little chat...
User avatar
DC-
Senior Resident
 
Posts: 40
Joined: 15 Sep 2008 21:00
Location: Bonn, Germany

Postby EggChen on 17 Sep 2008 01:01

Yep, I never missed any crows :lol:

I found the dead body trick neat as well, it always bugged me that those corpses would always be there, kind of an immersion breaker. So this kind of served a dual purpose.

Anyway, I understand that I can add a new section as long as the number is higher than the last section... [8329] in vanilla? I may try that when the skies are too empty :D
User avatar
EggChen
Moderator
 
Posts: 1016
Joined: 13 Sep 2008 00:44
Location: Birmingham, UK

Postby DC- on 17 Sep 2008 01:25

No, it just has to be different from any other section id inside the same file.
For example there is a an aliVe section in the alife_l01_escape.ltx with id 896. This is also the first vanilla id in the alife_l02_garbage.ltx file.

So just go to the bottom of the file and start adding your stuff, always increasing the id by 1. :)
Come over here, let's have a little chat...
User avatar
DC-
Senior Resident
 
Posts: 40
Joined: 15 Sep 2008 21:00
Location: Bonn, Germany

Postby NatVac on 17 Sep 2008 07:43

To extend what DC- said: You can also use any unique alphanumeric text for the label if you are using ACDC. It will automatically adjust the numbering scheme, although this means you won't be able to track anything you insert at the end of any all.spawn .ltx file (except what you put at the end of alife_l10u_bunker.ltx) if you compile, then decompile the all.spawn.

What you can do is make special named changes anywhere you want in a base set of files, and always build your all.spawn from that set of files.

A specific example: If you insert an item numbered [8641] or named [Mutant_1] after [869] in alife_l01_escape.ltx, it will become [870] after you compile/decompile. The first item in alife_l02_garbage.ltx will then be [871].

[This_is_a_valid_section_entry_name]

See the diffs\All_Spawn_10004_bfa_to_ZRP_105.diff file in the ZRP 1.05 distribution for an example of this.

P.S. This is not the only way to fix C stack overflows.
NatVac
Resident
 
Posts: 152
Joined: 16 Sep 2008 00:13
Location: Texas

Postby ket on 17 Sep 2008 14:31

Thanks natvac, informative as always 8) thanks to the rest of you too :D I just decided to fix the C stack overflows this way because I gave up trying to find what was causing it in state_mgr, or as I suspect it could be linked, xr_motivator.

One thing though, I dont want mutants or NPCs I'm adding to have specific AI paths, I like them to just make their own way around. You really can have some terrifying encounters this way! I've known whats been coming but still had the crap scared out of me because before I reached a certain point, naturally that mutant had been doing its own wandering about and it had decided to take up a position behind a tree.. so I go haplessly by and suddenly RAWR!! out pops a bloodsucker and I was like $%&%&*$%!!!! :P

Anyway back to my point lol, could I add the mutants and NPCs to all.spawn, do all the stuff needed but leave out AI paths?

Oh and I am indeed using ACDC, never trust xr spawner to do more than the most basic of tasks, it makes mistakes.. many mistakes :P
User avatar
ket
Senior Resident
 
Posts: 1262
Joined: 14 Sep 2008 11:57
Location: The solar system

Postby DC- on 17 Sep 2008 14:44

If by "AI paths" you mean giving them specific waypoints then sure.
Just give them the general_lager (for NPCs) or general_lair (mutants) smart terrain and it'll be pretty unpredictable where they go.

They'll sometimes even switch levels to get to a new terrain.
Come over here, let's have a little chat...
User avatar
DC-
Senior Resident
 
Posts: 40
Joined: 15 Sep 2008 21:00
Location: Bonn, Germany

Postby ket on 17 Sep 2008 15:06

Thats awesome cheers DC 8) I've seen it happen a crapload since freeing NPCs and mutants so they can wander where they want, but I never tire of seeing how cool it looks when mercs bust their way through at the level changer in Cordon for example, it just rocks.
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 DC- on 17 Sep 2008 16:54

I hear you. :)
That's pretty much what my aliVe mod is all about. It's mostly messing with smart terrains and NPCs'/ creatures' smart terrain assignments.
Come over here, let's have a little chat...
User avatar
DC-
Senior Resident
 
Posts: 40
Joined: 15 Sep 2008 21:00
Location: Bonn, Germany

Postby EggChen on 17 Sep 2008 20:44

Another thing I have done ket.

I made quite a few smart terrains accept more than one community. So for example the small Stalker camp under the first bridge in Cordon can be taken by Bandits too. I have noticed much more wandering by Stalkers, then fighting when they get there, and some times its nice to find a camp is not the same old group of people your used to.

One thing, don't do it with smart_terrains associated with tasks.

Also, its not exactly faction wars as such, for example if only one smart terrain spot is free, only one bandit may head that way and get slaughtered, but sometimes he doesn't. He kills the two guys there, then later one of his buddies joins him :wink:

It can make things a bit less predictable.

Edit DC- & Natvac thanks for the clarification guys. For the most part I have not needed to add new sections as I keep things simple and don't want millions of smart terrains or mutants, if anything I am thinning out populations a bit. However, I now understand how to do it when I need to. One question, what if I want to just remove something? If I delete the whole section including the [number], will acdc renumber things then to fill the gap?
User avatar
EggChen
Moderator
 
Posts: 1016
Joined: 13 Sep 2008 00:44
Location: Birmingham, UK

Postby NatVac on 17 Sep 2008 21:19

EggChen wrote:Edit DC- & Natvac thanks for the clarification guys. For the most part I have not needed to add new sections as I keep things simple and don't want millions of smart terrains or mutants, if anything I am thinning out populations a bit. However, I now understand how to do it when I need to. One question, what if I want to just remove something? If I delete the whole section including the [number], will acdc renumber things then to fill the gap?

It should.

Of course, care is needed. For instance, deleting a smart terrain and not changing the references to it might prove a bit troublesome.
NatVac
Resident
 
Posts: 152
Joined: 16 Sep 2008 00:13
Location: Texas

Postby EggChen on 17 Sep 2008 21:31

NatVac wrote:Of course, care is needed. For instance, deleting a smart terrain and not changing the references to it might prove a bit troublesome.


Thanks :D

I am thinking more about some of the dead Mutants and Stalkers spawned at game start that never seem to dissapear, for the most part I have been bringing them back to life and having them spawn later in the game on a certain inforportion, but it would be damn easier to just kill them properly :wink:

I also may thin out some starting populations for areas, so that the start is a little less busy in some levels.
User avatar
EggChen
Moderator
 
Posts: 1016
Joined: 13 Sep 2008 00:44
Location: Birmingham, UK

Postby ket on 18 Sep 2008 17:32

Could anyone tell me why ACDC won't compile the new all.spawn? I only edited one ltx file to test things.
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 DC- on 18 Sep 2008 18:02

No error message?
Come over here, let's have a little chat...
User avatar
DC-
Senior Resident
 
Posts: 40
Joined: 15 Sep 2008 21:00
Location: Bonn, Germany

Postby ket on 18 Sep 2008 19:02

Nope, nothing. Window opens then closes. I use shortcuts for compiling and decompiling. I've deleted the shortcuts and remade them, makes no difference.
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

Next

Return to Modding Techniques

Who is online

Users browsing this forum: No registered users and 29 guests