Thursday 12 May 2016

Session three: Basics of creating basic spawns

Now, where were we... oh, alright.

Trying to figure out our way around this Rubik cube of an editor.

I guess I shouldn't complain. TecnoBacon put together Stalkersoup without having this.

I find myself having a really hard time focusing, but on to the task at hand.

The task being, getting started with putting together our first on-demand artifact spawning point.

RTFM here in case you find yourself lost in my craze.

Sooooo... Open editor, done. Load the map I want to edit, done.

First things first. With first here being, spot selection.

So... let's see how far can I push this thing without forcing it to crash.

No such luck.
For further info: this is the underpass next to the abandoned rail car right after you leave the rookie village at the Cordon.

One thing I liked about Shadow of Chernobyl is how you could get artifacts randomly out of any anomaly out there. I aim to replicate that, even if it's a pain in the rear.

So, with the spot selected, on to the next step. Add the anomaly spot.

Quoted verbatim for clarity <turns off craze for a minute>:

"The 'anomaly_spot' is a 'space_restrictor' in the Spawn Element section which will create references for all what follows."
"It determines the spot itself, its type and what the player will see in the PDA."

<turns craze back on> Oh, great. I had hoped to skip the whole PDA part. I'm going to end up with a lot of white zones on top of each other.

"But this 'space_restrictor' needs to be attached to a shape, so let's create this shape first."

Well, create a shape, huh? How hard it can be?

<refers to previous post>

<checks 2C's tutorial>

Okay, got this. First, you need to turn on the 'Shape' perspective.

Just like this. See?
Next, tap on the 'Sphere' thingy on the lower right panel.

Ain't many 'Sphere' things to go around.

Next, tap on the 'Add' button on the edition bar. Yeah, the one from the previous post. Go and check. I'll wait.

Why a teapot, I wonder?
(Is it a teapot, to begin with?)

And, finally, place it!

HOORAY!
Well, not so fast. We just placed a shape. Now, on to put that space restrictor thingy on place.

<refers to 2C's tutorial>

Ohhh-kay... now we have to switch to the Spawn Element perspective.

Now you see me...

Same logic, I guess... I mean, pick something from the list, then tap 'Add', and then create item, yes?

My amazing powers of observation did it again.
Teapot magic!
Now, this thing must have a relevant name here and some properties 'in the custom data'. Where is this custom data we have to take care of?

I guess I don't get any points for subtlety.

I call it Vera.
Also, click OK if you don't want the editor to have an episode of amnesia.
Like a certain stalker.
Okay, according to this guide, we're about... no, not a chance we're even halfway there. Hold your horses.

Now we're supposed to attach this thing to a shape... Didn't we just make one?

Now, I guess you click here to start attaching...

And then on the shape... and you get... this. Yay, I guess?
Now, regrettably, I have to call it quits for a while. Duty calls. The joys of being a wage slave.

<Day passes>

Man, I'm tired. Krav Maga is exhausting. I should be getting a shower right now but this unfinished thing really nags at me.

So here I go.

<Turns on Music Bee, loads Dopilsya by Sektor Gaza>

Now, where were we... <checks 2C.Liryc's tutorial>... Oh yeah, now we should be adding anomalies to our anomalous field. I mean, that's where artifacts spawn. Right?

I would like to see if the anomalies nearby could somehow be attached to our new field.

First, I suppose I need to see what kind of stuff I'm working with...

"Spoon... uh... 'Spawn' Element fings, boss."
<Now isn't this one hell of a coincidence. The Random Number God has seen fit to take me straight into the Brain Scorcher bunker by playing MoozE's Tunnels. *looks around nervously for bloodsuckers*>

So, Spawn Element perspective is on. I'm supposed to find the anomaly objects here... but where?

"Stupid *nngh* ring... Fellowship my ass... Ahh, there it is"
Now, notice that list.

  • Some are listed with the 'field' prefix (e.g. 'field_acidic_strong,' 'field_psychic_weak'); I suppose these are the 'auras' causing damage whenever you enter some anomalous fields (the Circus and the Iron Forest in Zaton come to mind). I'm not planning to turn CoC into Misery (however awesome that would be, it's beyond my skills yet) so I skip those.
  • Another common prefix is 'mine'. As in, landmines. You get close, they trigger. Painful. Rings a bell, right? This is what I'm after.
So, a serving of chicken pie later, it's teapot time: what to add?

I'm feeling merciful.

Nah. Just kidding.

2C goes on to say anomalies can be set to turn on and off at random, or to do so at particular times. I guess that's how you make the infamous Electro-plagued tunnel from Shadow of Chernobyl. I'm not going to delve into that now... or yes, maybe I will. Just with one.

Not only this anomaly is borked, it's borked in an unpredictable way.
I guess.
Going back to that particular step, I notice 2C says the 'Shift time' parameter is important if you want to build sequential or random fields, but does not elaborate any further on this.

Now, on to step 4: adding way points. What for? Well, the little treasures every stalker is after don't move randomly inside the anomaly, there is a pattern to it.

So, in order to create the way points, we have to (drumroll) switch to the Way Point perspective.

Like this, I suppose.

So now all sorts of little green markers and lines between them pop up. One of those lines goes right through one of the anomalies I just placed... so I'll move the anomaly. Just in case.

Better safe than sorry. Right?
With that (potential) kink ironed out, on to our next step. We have to... um... <checks 2C's guide>... switch to something called 'Way Mode'.

Not getting points for attention to detail, either.
Next, create a node... oh, so it's teapot time. That's lack of habit for you.

And, since we're at it, we should give it a proper name. One with the same base name than the anomaly spot, 2C says. You usually add a suffix in the likes of "af_way" to recognize it easily.

Note to self: shorter names next time.
Okay, now we're supposed to switch to Point Mode.

The only such thing I could find, so I suppose this is it.

While you're on Point Mode, any successive way points you create will be linked.

Oh, when you want to close the 'loop', so to speak, make sure you're in Select mode (remember? That command in the editing toolbar I discussed on the previous session... go take a look, I'll wait), then hold CTRL to select the two points you want to link up, and click on 'Create 1-Link'.

Just so.
So, we're done with this!

I think I overdid it a little...

Okay, what's next? <checks 2C's tutorial>

Oh yeah, the whole point of this entire exercise: adding the place where the artifacts themselves will be spawned. At last.

<The Random Number God is at it again: now listening to Jesse Allen's Lo Fi Epic. Gods, if only I could visit Omega sometime. Or not. The place is the Mass Effect version of Nar Shaddaa.>

It's a good idea to place the anomal_zone (that's the name of the thingy we're creating now) slightly above ground to avoid the artifact spawning under the terrain. I hate when that happens... *groans*

But... where is it?

"Ahh, there it is"

Wait, I see a pattern here...
My powers of observation never cease to amaze me: an object's name -and the folder where you'll find it- will be listed together next to the 'Profile (spawn section)' label.

Now it's so obvious I want to kick myself, but good thing I found out.

Now, we must tell the game where to look for the LTX file governing this anomalous field.

<scribbles down file name on a piece of paper>
Now, to create it. This is fairly standard stuff, so I'm quoting it almost verbatim:

  • In the SDK folder, go to gamedata\configs\scripts\edited_map_name\anomaly.
  • Create here a new LTX file with the same name as in your anomal_zone Custom data.
    • You can use an existing one to modify it to your needs but don't forget to save it with its new name and in the proper folder,
Since I'm a greedy bastard, this anomaly won't spawn anything right from the start... though, come to think of it, if I go ahead with this I won't know if all of this worked properly. So let's have it spawn something.

And done. Behold my works, ye mighty, and despair:


[anomal_zone]

field_name = esc_tuto_anom_misaligned_scav_vera

layers_count = 1

respawn_tries = 4

max_artefacts = 1

applying_force_xz = 200

start_artefact = af_medusa

artefacts = af_medusa, af_cristall_flower, af_night_star, af_vyvert, af_gravi, af_gold_fish

coeff = 3, 3, 2, 2, 1, 1

artefact_ways = esc_tuto_anom_misaligned_scav_vera_af_way


Alright... so, next step would be to make this place visible in the PDA... wait, so you can make the place but it's not compulsory to show it? Yay!

Oh well, for the sake of completeness, here we go. I can undo it later.
  1. Go to gamedata\scripts\ and open pda.script.
  2. Add the anomaly_spot to the PDA by adding such kind of line in the local_primary_objects_tbl section (around line 213)
  3. Then, give it a name by adding a new string in the st_land_names.xml (in configs\text\eng)
Now it's (drumroll) compiling time!

Back in the Level Editor, go to Compile, and click Make Game (AND ONLY THAT!)

Here goes nothing...
Now, let's leave the Level Editor and go to the folder where it's in.

Look for a file called '3_xrAI_allspawn.bat'.

Run it.

Cross your fingers.

Oh, and don't rush things. It takes a while.

11b grats
Only 3:34? My poor rig needed twice that time...
So what is the end product of this little magic dance?

A .spawn file. In case it has a weird name of sorts, remember to rename it to 'all.spawn'.

Next step is to grab this file from the level editor's gamedata\spawns folder and paste it elsewhere.

On CoC's gaming\testing folder.

(Where is this folder to begin with?!)

Okay, I can't find it... so I go and unpack everything to try and match the file structure. 

This is supposed to go into the gamedata\spawns folder. I place it there.

I run the game.

Start a new game...

...and it crashes.

Fuming with anger, I remove the all.spawn file I just made from the spawns directory.

Start it again...

...and it runs.

Just great.

Predictably, I went almost mad with rage.

After I managed to cool down a bit, I went back to the Epicstalker forums, where I had posted a request for help, and I was surprised to notice that I had gotten some answers.

One of them posted by none other than the author of the tutorial I'm using as guidance.

So I seized the opportunity and reached out to him for help.

It turned out to be I was missing a last step.

I need to copy the relevant LTX files to the matching directory on the CoC installation directory.

Since I was editing the Cordon, then the right directory would be: gamedata\configs\scripts\escape\anomaly\ .

So I grab the LTX file I made and pasted it there...

Gave it another try...

And it works!

JOY!

Next objective: I want to bring in the artifacts from Lost Alpha or Stalkersoup.

A HUGE THANK YOU to 2C.LiryC for both creating this tutorial and for providing support.

1 comment:

  1. I'm glad you did this, I too like to mess around with "the basics", since my early days in SoC. I stumbled upon this because I find myself curious in digging further into the great Zone, and making more of my own custom changes. I may or may not get around to this headache, but Im glad this is here to come back to when I do get around to starting. So thank you for keeping tabs on your work progress (I keep buckets of footnotes).

    ReplyDelete