Arrrgh...

Users who are viewing this thread

Fujiwara

Sergeant at Arms
If this has been covered in a previous topic, I apologize, but searching didn't give me the answer I seek...

So, I go into edit mode and make a nice terrain, copy down the numbers, and go into the Mod Tools, set up a dummy scene with the terrain code, link it to a dummy menu, and link that to a dummy town. I start up, walk over to the town, and poof! there's my nice terrain, all ready for the developer to come in and cut down all the trees :lol: :roll:

I put in the buildings, entry points, passages, made it real nice. I save it as scn_village.sco. I rename it as scn_settsu_village_center.sco. I then make a new town, with new scene data as follows:

("settsu_village_center",0,"scn_settsu_village_center","bo_scn_settsu_village_center",...)

linked to this new scene, and a new menu, blah blah blah. Everything compiled nice. I start up, ride over to Settsu Village, enter, and crash and burn. I got the error "bo_scn_settsu_village_center" not found. In my naive mind, I figured the scene editor would include the bo_scn_settsu_village_center when I saved. Obviously not. Then I got to thinking, duh, if it were that easy, we wouldn't be having all these threads on collision meshes, etc. So, I use the bo_sargoth_square mesh, just to test, and got this error:

no interior mesh

Where have I gone so horribly wrong?
 
This is in the beginning of module_scenes.py.

Code:
#  Each scene record contains the following fields:
#  1) Scene id {string}: used for referencing scenes in other files. The prefix scn_ is automatically added before each scene-id.
#  2) Scene flags {int}. See header_scenes.py for a list of available flags
#  3) Mesh name {string}: This is used for indoor scenes only. Use the keyword "none" for outdoor scenes.
#  4) Body name {string}: This is used for indoor scenes only. Use the keyword "none" for outdoor scenes.

3. Mesh name: This is the 3D object that describes how your scene looks like. Here you have put scn_settsu_village_center which is a mesh which does not exist (hence ERROR). You can create this mesh and include it in your module, though. It is the same procedure as for creating new items etc.

4. Body name: This is the collision mesh.

If you need a simple, (BIG) empty scene, download these (read the WHOLE thread on how to use them):

http://forums.taleworlds.com/viewtopic.php?t=7011
 
I think also there might be a conflict between trying to use a generated terrain (with a seed) which is an "Outdoor" scene, and using the city definition you did with the settsu_village_center (which is an "Indoor" scene).

As Fisheye said, use the big flat terrain he created as your base for your city, not generated terrain and I think you will have better luck.

DE
 
svaucher said:
Fujiwara said:
Where have I gone so horribly wrong?

I might be totally off, but have you loaded the resources (in Modules/Native/module_info.txt)?

sv

Every time I tried to do this, I got a nasty error saying that the files didn't exist. I got fed up and deleted the lines in the file.
 
Fujiwara said:
Every time I tried to do this, I got a nasty error saying that the files didn't exist. I got fed up and deleted the lines in the file.

That would probably explain it. I followed fisheyes' tut, and he specifies where to stick your meshes and how to import them. Note that there are different ways of loading resources. They can be global or mod specific resources.

sv
 
fisheye said:
3. Mesh name: This is the 3D object that describes how your scene looks like. Here you have put scn_settsu_village_center which is a mesh which does not exist (hence ERROR). You can create this mesh and include it in your module, though. It is the same procedure as for creating new items etc.

That's what I figured. So how do I access the scene that I made. Is that only useful (now) for outdoor scenes? If it is that's fine...I can use it to test my in-town fighting routines.
 
Fujiwara said:
That's what I figured. So how do I access the scene that I made. Is that only useful (now) for outdoor scenes? If it is that's fine...I can use it to test my in-town fighting routines.
If this is an outdoor scene made with only the in-game scene editor, why are you trying to use meshes for it? You don't need them at all. Just make the first part of your scene entry (the part that you quoted) into: ("settsu_village_center",sf_generate,"none", "none",...)

Then it should work.

Periodontally,
Winter
 
Winter said:
If this is an outdoor scene made with only the in-game scene editor, why are you trying to use meshes for it? You don't need them at all. Just make the first part of your scene entry (the part that you quoted) into: ("settsu_village_center",sf_generate,"none", "none",...)

Then it should work.

Periodontally,
Winter

It's a scene I started with the terrain generator, then added buildings, a la the Four Ways Inn. I want the same scene (scn_settsu_village) to be in that location every time the player visits. I also want to be able to use the scene for in-town fighting, like the Arena. But THAT is an indoor scene, and thus requires a mesh.

Question: when you generate a terrain then modify it (add buildings, entry points, etc) with the in-game editor, what exactly happens when you hit Save. I know an .sco file is generated and given the name of the scene that used the previously generated terrain code. What is the .sco file? What is contained therein? How is it used in the game?
 
The SCO file stores all the data for the scene about what objects are placed and where you've placed them. This includes entry points and everything else you do in the in-game edit mode.
The terrain itself is of course not stored, other than it's seed you specified in module_scenes.py. You could change the terrain seed, and your objects placed would remain in exactly the same place which would lead to items floating in the air and buried below the ground from the different terrain.

EDIT: and the original arena uses a static mesh and no terrain, but that's no big deal. An arena battle scene can use generated terrain or not, and can use a static mesh or not, as you wish. For example, in my Arena Expansion mod, the 4 team arena and jousting arena use generated terrain and do not use a static mesh.
 
Fujiwara said:
It's a scene I started with the terrain generator, then added buildings, a la the Four Ways Inn. I want the same scene (scn_settsu_village) to be in that location every time the player visits.
That will happen if you do it the way I suggested. sf_generate doesn't give you random terrain unless you use sf_randomize with it. On its own, it will simply specify an outdoor scene, exactly like the Four Ways Inn.

I also want to be able to use the scene for in-town fighting, like the Arena. But THAT is an indoor scene, and thus requires a mesh.
Misconception. The arena map uses a mesh, yes, but that mesh is just a map -- you can substitute your own outdoor scene without any trouble. All of the arena's vital code is determined by the mission template.

Simply make a duplicate scene in your scenes file (scn_settsu_village_2) and make a duplicate of your scene objects file, renaming it accordingly. Have your new mission put the player and all combatants into the duplicate scene. Put all the entry points in the right places, and you'll be able to use it just like the arena.

Question: when you generate a terrain then modify it (add buildings, entry points, etc) with the in-game editor, what exactly happens when you hit Save. I know an .sco file is generated and given the name of the scene that used the previously generated terrain code. What is the .sco file? What is contained therein? How is it used in the game?
As Janus said, your SCO file contains all the things you placed in that scene by way of the in-game editor.

Anacoluthically,
Winter
 
Janus: You said the terrain seed is stored in the .sco file, along with everything I added in the editor. I guess my disconnect is where I put that .sco file into the scenes.py to get a useable scene. Ex:

Code:
("village",sf_generate,"none","none",(x1,y1),(x2,y2),"[i]terrain_code[/i]",[],[]),

will only generate a terrain that is (x2-x1) by (y2-y1) in size based on the code. Where does the .sco file come into this? If I set up a menu option:

Code:
("enter_village",[],"Enter Settsu Village.",[(set_jump_mission,"mtf_town_default"),(jump_to_scene,"scn_village"),(change_screen_mission,0)]),

I'll end up in a nice, green, fairly flat plain with some trees...kind of like around the Texas Hill Country...with no buildings. What am I missing? Or...is it, by specifying "scn_village" in the menu option, it calls scn_village.sco, which put all the bells and whistles on top of the generated scene specified by the scenes.py file?

Confusion is setting in...this is why I'm a chemical engineer, not a hacker.
 
Fujiwara said:
Or...is it, by specifying "scn_village" in the menu option, it calls scn_village.sco, which put all the bells and whistles on top of the generated scene specified by the scenes.py file?
Yep, that is exactly what it does.

Thrasonically,
Winter
 
No, the terrain seed isn't stored in the SCO file, reread what I posted:
Janus said:
The terrain itself is of course not stored, other than it's seed you specified in module_scenes.py.
I was indicating the seed was used only in module_scenes.py. Maybe wasn't completely clear there.

The SCO filename simply matches the name of the scene, that's where it comes in. The game looks for the SCO file based on the scene's name. Basically just like your last guess. :smile:
 
Thanks for all the help ya'll :smile: I figured it out:

Code:
("village",sf_generate,"none","none",(x1,y1),(x2,y2),"[i]terrain code[/i]",[],[]),

is what does it. The SCO stores all the doodads and puts it on top of the generated terrain. It would be nice if, instead of this, the act of saving created the necessary meshes instead, to speed up loading time. There's a lag of a few seconds when you click the menu option to enter a town and the town actually appearing, but maybe that's a lot to ask.

Next question: How do I get the passages to work? Example:

Code:
("village",sf_generate,"none","none",(x1,y1),(x2,y2),"[i]terrain code[/i]",["village_idiot"],[]),
("village_idiot",sf_indoors,"small_tavern","bo_small_tavern",(x1,y1),(x2,y2),"0",["village"],[]),

If I have a passage with ID 0 in "village", then put in the string "village_idiot" in the proper place, it should lead to "village_idiot". Well, it doesn't seem to be working. I get a pop-up that says "Passage" and "Go" when I'm near it. If I "go", I get automagically transported back to entry point 0 in "village". The notes at the top of module_scenes.py says this has been deprecated, but gives no clues on how it works now. Help?!?
 
Fujiwara said:
[...] It would be nice if, instead of this, the act of saving created the necessary meshes instead, to speed up loading time. There's a lag of a few seconds when you click the menu option to enter a town and the town actually appearing, but maybe that's a lot to ask.

This delay to generate the same ground mesh each time you enter the town is the exact reason why I pestered Fisheye until he figured out collision meshes and how we can create one for a large floor space - to use instead of generated terrain.

Here is the thread:
http://forums.taleworlds.com/viewtopic.php?t=7011

use the one of the two meshes he created, along with the collision definition "bo_big_floor" and you have lots of space for your town - and no delay when you enter.

Hope that helps.

DE
 
And I probably will use it eventually. But right now, we don't have any proper buildings, so I'm not going to waste time building something big that won't get used. I just wanted to learn how it worked so that when the time come I can bang it out easily.
 
Back
Top Bottom