Faction Adding, Removing, Editing and Such

Need help testing contributed art or code or having trouble getting your newest additions into game compatible format? Confused by changes to data formats? Reading through source and wondering what the developers were thinking when they wrote something? Need "how-to" style guidance for messing with VS internals? This is probably the right forum.
Post Reply
Hawthorn-Slappy
Explorer
Explorer
Posts: 9
Joined: Wed Nov 28, 2007 4:32 am

Faction Adding, Removing, Editing and Such

Post by Hawthorn-Slappy »

Greetness, I'm doing a bit of a mod for Vega Strike and there is one thing that has me completely stumped, editing factions. For my mod I'm only using five. I've edited both the factions.xml and faction_ships.py as well as the milky_way.xml to reflect my factions, but the game crashes on load. It FAILS to crash if I only put in one of the edited files at a time though. Most odd. If anyone has any suggestions I'm all ears, can't seem to fine this particular issue anywhere in the forum.
loki1950
The Shepherd
Posts: 5841
Joined: Fri May 13, 2005 8:37 pm
Location: Ottawa
Contact:

Post by loki1950 »

welcome Hawthorn-Slappy this should really be in Contributor Help and Internal How-Tos could you post stdout.txt and sdterr.txt if you are using Windows our your console output if you are using a *nix flavor that should give us an idea of why it coughs on your edits.happy hacking 8)

Enjoy the Choice :)
my box::HP Envy i5-6400 @2Q70GHzx4 8 Gb ram/1 Tb(Win10 64)/3 Tb Mint 19.2/GTX745 4Gb acer S243HL K222HQL
Q8200/Asus P5QDLX/8 Gb ram/WD 2Tb 2-500 G HD/GF GT640 2Gb Mint 17.3 64 bit Win 10 32 bit acer and Lenovo ideapad 320-15ARB Win 10/Mint 19.2
Hawthorn-Slappy
Explorer
Explorer
Posts: 9
Joined: Wed Nov 28, 2007 4:32 am

stderr & stdout

Post by Hawthorn-Slappy »

stderr

Code: Select all

GOT SUBDIR ARG = 
Found data in ..
Using C:\Users\Toadpipe\Desktop\VS\MyStrike-0-50\data as data directory
USING HOMEDIR : C:\Users\Toadpipe\Desktop\VS\MyStrike-0-50\data/.vegastrike As the home directory 
CONFIGFILE - No config found in home : C:\Users\Toadpipe\Desktop\VS\MyStrike-0-50\data/.vegastrike/vegastrike.config
CONFIGFILE - No home config file found, using datadir config file : C:\Users\Toadpipe\Desktop\VS\MyStrike-0-50\data/vegastrike.config
MISSION_NAME is empty using : main_menu.mission
'import site' failed; use -v for traceback
running import sys
print sys.path
sys.path = [r"C:\Users\Toadpipe\Desktop\VS\MyStrike-0-50\data\modules\builtin",r"C:\Users\Toadpipe\Desktop\VS\MyStrike-0-50\data\modules",r"C:\Users\Toadpipe\Desktop\VS\MyStrike-0-50\data\bases"]
testing VS randomrunning import sys
print sys.path
OpenGL Extensions supported: GL_ARB_color_buffer_float GL_ARB_depth_texture GL_ARB_draw_buffers GL_ARB_fragment_program GL_ARB_fragment_program_shadow GL_ARB_fragment_shader GL_ARB_half_float_pixel GL_ARB_imaging GL_ARB_multisample GL_ARB_multitexture GL_ARB_occlusion_query GL_ARB_pixel_buffer_object GL_ARB_point_parameters GL_ARB_point_sprite GL_ARB_shadow GL_ARB_shader_objects GL_ARB_shading_language_100 GL_ARB_texture_border_clamp GL_ARB_texture_compression GL_ARB_texture_cube_map GL_ARB_texture_env_add GL_ARB_texture_env_combine GL_ARB_texture_env_dot3 GL_ARB_texture_float GL_ARB_texture_mirrored_repeat GL_ARB_texture_non_power_of_two GL_ARB_texture_rectangle GL_ARB_transpose_matrix GL_ARB_vertex_buffer_object GL_ARB_vertex_program GL_ARB_vertex_shader GL_ARB_window_pos GL_ATI_draw_buffers GL_ATI_texture_float GL_ATI_texture_mirror_once GL_S3_s3tc GL_EXT_texture_env_add GL_EXT_abgr GL_EXT_bgra GL_EXT_blend_color GL_EXT_blend_equation_separate GL_EXT_blend_func_separate GL_EXT_blend_minmax GL_EXT_blend_subtract GL_EXT_compiled_vertex_array GL_EXT_Cg_shader GL_EXT_depth_bounds_test GL_EXT_draw_range_elements GL_EXT_fog_coord GL_EXT_framebuffer_object GL_EXT_gpu_program_parameters GL_EXT_multi_draw_arrays GL_EXT_packed_depth_stencil GL_EXT_packed_pixels GL_EXT_pixel_buffer_object GL_EXT_point_parameters GL_EXT_rescale_normal GL_EXT_secondary_color GL_EXT_separate_specular_color GL_EXT_shadow_funcs GL_EXT_stencil_two_side GL_EXT_stencil_wrap GL_EXT_texture3D GL_EXT_texture_compression_s3tc GL_EXT_texture_cube_map GL_EXT_texture_edge_clamp GL_EXT_texture_env_combine GL_EXT_texture_env_dot3 GL_EXT_texture_filter_anisotropic GL_EXT_texture_lod GL_EXT_texture_lod_bias GL_EXT_texture_mirror_clamp GL_EXT_texture_object GL_EXT_texture_sRGB GL_EXT_timer_query GL_EXT_vertex_array GL_HP_occlusion_test GL_IBM_rasterpos_clip GL_IBM_texture_mirrored_repeat GL_KTX_buffer_region GL_NV_blend_square GL_NV_copy_depth_to_color GL_NV_depth_clamp GL_NV_fence GL_NV_float_buffer GL_NV_fog_distance GL_NV_fragment_program GL_NV_fragment_program_option GL_NV_fragment_program2 GL_NV_half_float GL_NV_light_max_exponent GL_NV_multisample_filter_hint GL_NV_occlusion_query GL_NV_packed_depth_stencil GL_NV_pixel_data_range GL_NV_point_sprite GL_NV_primitive_restart GL_NV_register_combiners GL_NV_register_combiners2 GL_NV_texgen_reflection GL_NV_texture_compression_vtc GL_NV_texture_env_combine4 GL_NV_texture_expand_normal GL_NV_texture_rectangle GL_NV_texture_shader GL_NV_texture_shader2 GL_NV_texture_shader3 GL_NV_vertex_array_range GL_NV_vertex_array_range2 GL_NV_vertex_program GL_NV_vertex_program1_1 GL_NV_vertex_program2 GL_NV_vertex_program2_option GL_NV_vertex_program3 GL_NVX_conditional_render GL_NVX_instanced_arrays GL_SGIS_generate_mipmap GL_SGIS_texture_lod GL_SGIX_depth_texture GL_SGIX_shadow GL_SUN_slice_accum GL_WIN_swap_hint WGL_EXT_swap_control 
OpenGL::GL_EXT_compiled_vertex_array unsupported
OpenGL::Accurate Fog Distance supported
OpenGL::Generic Texture Compression supported
OpenGL::S3TC Texture Compression supported
OpenGL::Multitexture supported (4 units)
OpenGL::TextureCubeMapExt supported
OpenGL::S3TC Texture Clamp-to-Edge supported
OpenGL::S3TC Texture Clamp-to-Border supported
OpenGL::EXTColorTable unsupported
stdout

Code: Select all

Windows version 6 0
Vega Strike  
See http://www.gnu.org/copyleft/gpl.html for license details.

Using .vegastrike as the home directory
Found MODDIR = C:\Users\Toadpipe\Desktop\VS\MyStrike-0-50\data/mods
DATADIR - No datadir specified in config file, using ; C:\Users\Toadpipe\Desktop\VS\MyStrike-0-50\data
SIMULATION_ATOM: 0.05
['C:\\Users\\Toadpipe\\Desktop\\VS\\MyStrike-0-50\\data\\bin\\python25.zip', '.\\DLLs', '.\\lib', '.\\lib\\plat-win', '.\\lib\\lib-tk', 'C:\\Users\\Toadpipe\\Desktop\\VS\\MyStrike-0-50\\data\\bin']
['C:\\Users\\Toadpipe\\Desktop\\VS\\MyStrike-0-50\\data\\modules\\builtin', 'C:\\Users\\Toadpipe\\Desktop\\VS\\MyStrike-0-50\\data\\modules', 'C:\\Users\\Toadpipe\\Desktop\\VS\\MyStrike-0-50\\data\\bases']
Setting Screen to w 1024 h 768 and pitch of 4096 and 32 bpp 4 bytes per pix mode
0 joysticks were found.

The names of the joysticks are:
FactionXML:LoadXML factions.xml
And there we have it, seems there is a problem with factions.xml. All seems well to me though. Just in case here it is:

Code: Select all

<Factions>
	<Faction name="neutral" citizen="false" logoRGB="logos/confedPri.png" logoSec="logos/confedSec.png"/>
	<Faction name="chosen" citizen="false" logoRGB="logos/confedPri.png" secLogoRGB="logos/confedSec.png" contraband="contraband" sparkred="0" sparkgreen="0" sparkblue="1">
		<stats name="privateer" relation=".2"/>
		<stats name="chosen" relation="1"/>
		<stats name="spark" relation="-1"/>
		<stats name="derge" relation=".2"/>
		<stats name="teamster" relation="1"/>
		<stats name="luddite" relation="-1"/>
		<Explosion name="explosion_orange.ani"/>
<!--		<CommAnimation>  
			<MoodAnimation name="explosion_orange.ani" sex="0"/>  
		</CommAnimation>  -->
	</Faction>
	<Faction name="spark" citizen="false" logoRGB="logos/confedPri.png" secLogoRGB="logos/confedSec.png" contraband="contraband" sparkred="0" sparkgreen="0" sparkblue="1">
		<stats name="privateer" relation=".2"/>
		<stats name="chosen" relation="-1"/>
		<stats name="spark" relation="1"/>
		<stats name="derge" relation=".2"/>
		<stats name="teamster" relation="-1"/>
		<stats name="luddite" relation="-1"/>
		<Explosion name="explosion_orange.ani"/>
<!--		<CommAnimation>  
			<MoodAnimation name="explosion_orange.ani" sex="0"/>  
		</CommAnimation>  -->
	</Faction>
	<Faction name="derge" citizen="false" logoRGB="logos/confedPri.png" secLogoRGB="logos/confedSec.png" contraband="contraband" sparkred="0" sparkgreen="0" sparkblue="1">
		<stats name="privateer" relation="-.2"/>
		<stats name="chosen" relation="-1"/>
		<stats name="spark" relation="1"/>
		<stats name="derge" relation="1"/>
		<stats name="teamster" relation="-.1"/>
		<stats name="luddite" relation="-1"/>
		<Explosion name="explosion_orange.ani"/>
<!--		<CommAnimation>  
			<MoodAnimation name="explosion_orange.ani" sex="0"/>  
		</CommAnimation>  -->
	</Faction>
	<Faction name="teamster" citizen="false" logoRGB="logos/confedPri.png" secLogoRGB="logos/confedSec.png" contraband="contraband" sparkred="0" sparkgreen="0" sparkblue="1">
		<stats name="privateer" relation=".2"/>
		<stats name="chosen" relation="1"/>
		<stats name="spark" relation="-1"/>
		<stats name="derge" relation="-.2"/>
		<stats name="teamster" relation="1"/>
		<stats name="luddite" relation="-1"/>
		<Explosion name="explosion_orange.ani"/>
<!--		<CommAnimation>  
			<MoodAnimation name="explosion_orange.ani" sex="0"/>  
		</CommAnimation>  -->
	</Faction>
	<Faction name="luddite" citizen="false" logoRGB="logos/confedPri.png" secLogoRGB="logos/confedSec.png" contraband="contraband" sparkred="0" sparkgreen="0" sparkblue="1">
		<stats name="privateer" relation="-1"/>
		<stats name="chosen" relation="-1"/>
		<stats name="spark" relation="-1"/>
		<stats name="derge" relation="-1"/>
		<stats name="teamster" relation="-1"/>
		<stats name="luddite" relation="1"/>
		<Explosion name="explosion_orange.ani"/>
<!--		<CommAnimation>  
			<MoodAnimation name="explosion_orange.ani" sex="0"/>  
		</CommAnimation>  -->
	</Faction>
	<Faction name="upgrades" citizen="false" logoRGB="logos/confedPri.png" logoSec="logos/confedSec.png"/>
	<Faction name="planets" citizen="false" logoRGB="logos/confedPri.png" logoSec="logos/confedSec.png"/>
</Factions>
[/quote]
loki1950
The Shepherd
Posts: 5841
Joined: Fri May 13, 2005 8:37 pm
Location: Ottawa
Contact:

Post by loki1950 »

Ok then have you modified the main_menu.mission file as factions are referenced in it as well so there may be a mismatch.

Enjoy the Choice :)
my box::HP Envy i5-6400 @2Q70GHzx4 8 Gb ram/1 Tb(Win10 64)/3 Tb Mint 19.2/GTX745 4Gb acer S243HL K222HQL
Q8200/Asus P5QDLX/8 Gb ram/WD 2Tb 2-500 G HD/GF GT640 2Gb Mint 17.3 64 bit Win 10 32 bit acer and Lenovo ideapad 320-15ARB Win 10/Mint 19.2
Hawthorn-Slappy
Explorer
Explorer
Posts: 9
Joined: Wed Nov 28, 2007 4:32 am

Post by Hawthorn-Slappy »

Okies, we have some odd behavior going on here. Firstly though, in my "test" directory everything in the mission dir is gone but the main_menu.mission. I did look at it after you mentioned it but the only faction named in it is "privateer" which as far as I can tell is an "undefined" faction that seems to exist as only the player. Was I mistaken in guessing that?

So, on to the odd stuff. Do to some off the sizes of the error files I'll link to them instead of copying them into this post.

First, I restored everything to VS defaults. Then I replaced ./universe/milk_way.xml with http://lordmandrake.com/milky_way.xml, deleted the generated stuff in the sectors folder from previous runs and ran the program. No trouble at all except there were no bases generated.

So, all seeming to go well I then replaced the ./modules/faction_ships.py with
http://lordmandrake.com/faction_ships.py, once again deleted the generated systems and ran the program. Now there are bases, but they have no faction name and the randomly created ships are all black. No ship, no faction. This was what stdout had to say about it http://lordmandrake.com/stdout.txt.

So I got brave at this point, deleted the dynamic systems, and then deleted the /modules/faction_ships.pyc. Ran it again, got to the menu screen and selected campaign. Shortly there after program cacked with stderr having this to say http://lordmandrake.com/stderr1.txt.

Replacing the factions.xml with my version http://lordmandrake.com/factions.xml causes the program to freeze completely when stdout gets to the line "FactionXML:LoadXML factions.xml" with stderr showing nothing at all and a need to manually kill the program.

Still at a total loss.
loki1950
The Shepherd
Posts: 5841
Joined: Fri May 13, 2005 8:37 pm
Location: Ottawa
Contact:

Post by loki1950 »

This is quickly going over my competence level :? so we need some more eyes on the subject the go to guy for the python functions ATM is ase123 he may be by later.

Enjoy the Choice :)
my box::HP Envy i5-6400 @2Q70GHzx4 8 Gb ram/1 Tb(Win10 64)/3 Tb Mint 19.2/GTX745 4Gb acer S243HL K222HQL
Q8200/Asus P5QDLX/8 Gb ram/WD 2Tb 2-500 G HD/GF GT640 2Gb Mint 17.3 64 bit Win 10 32 bit acer and Lenovo ideapad 320-15ARB Win 10/Mint 19.2
Hawthorn-Slappy
Explorer
Explorer
Posts: 9
Joined: Wed Nov 28, 2007 4:32 am

Post by Hawthorn-Slappy »

Right, figured out a bit more and most importantly got it all to work. the faction "privateer" does need to be marked up in the faction.xml after all. The big reason for the blow ups I found was that I had no "citizen" factions and things were looking for them. SO, had to remove that stuff from both the faction_ships.py and the generate_dyn_universe.py.

Now the the trick is to get the random ships the game generates to actually be ships, currently it seems to be trying to load ships a through r, as in a.template m.blank and so forth.

http://lordmandrake.com/stderr-11-28-07--1.txt
http://lordmandrake.com/stdout-11-28-07--1.txt

If anyone out there wants to help take a crack at all this feel free.
Dilloh
Elite Hunter
Elite Hunter
Posts: 1149
Joined: Mon Aug 14, 2006 3:56 pm
Location: Black Forest, Germany

Post by Dilloh »

Check out faction_ships.py, there is a block called "flightgroups". This block holds all ship information you need to have in terms of AI spawns.
Hawthorn-Slappy
Explorer
Explorer
Posts: 9
Joined: Wed Nov 28, 2007 4:32 am

Post by Hawthorn-Slappy »

Fraid' I don't quite follow what you mean. There are two things in the faction_ships.py that contain the word flightgroup:

max_flightgroups={"Alpha/Chose":1}
min_flightgroups={"Alpha/Chose":1}

This is how it looks in my edited faction_ships.py http://lordmandrake.com/faction_ships.py. This seems to be specific to a given system? Not sure what it does actually.

I've defined all the fighters, bombers and capitols but for some reason it still loads, or rather fails to load, random letters as units which results in having quite a few non-existent units on the scope when in game. They can be targeted but not shot and such because they are simply not there.
Dilloh
Elite Hunter
Elite Hunter
Posts: 1149
Joined: Mon Aug 14, 2006 3:56 pm
Location: Black Forest, Germany

Post by Dilloh »

Sorry, I meant "fighters":

Code: Select all

fighters = (("stiletto","ferret","ferret","gladius","sabre","broadsword",), #confed
            ("sartha","sartha","sartha","dralthi","dralthi","grikath","gothri",), #kilrathi
            ("steltek_fighter",), #nephilim
            ("tarsus","tarsus","tarsusMk2","tarsusMk2","galaxyhk","galaxy","orion","orionMk2",), #merchant
            ("talon","talon","krant","sparrowhawk"), #retro
            ("talon","talon","talon","talon","talon","sparrowhawk"), #pirates
            ("demon","demon","fireblade","orionMk2b","orionMk2h","centurion","galaxygs"), #hunter
            ("talon","talon","sparrowhawk","scimitar","gladius","hornet","hornet","kukhri","raptor",), #militia
            ("salthi","salthi.particle"), #unknown
                        ("tarsus","gladius","talon","talon","talon","drayman",),#landreich
                        ("tarsus","gladius","talon","talon","talon","drayman",),#border_worlds
                        ("stiletto",), #firekkan
                        ("stiletto",), #AWACS
Note that the more often you write e.g. "Talon", the more often it is likely to appear.

Also be aware that the game is character sensitive, so tAlOn and TaLoN are NOT the same...
Hawthorn-Slappy
Explorer
Explorer
Posts: 9
Joined: Wed Nov 28, 2007 4:32 am

Post by Hawthorn-Slappy »

Yep, got that bit. I only gave each group one fighter though. Still it does the A L R D.blank thing. If you'd like do double check what I've done, my faction_ships.py is linked to in my previous post. Curious if fightersPerFG is what determines how many different fighters it's loading. Perhaps?
Dilloh
Elite Hunter
Elite Hunter
Posts: 1149
Joined: Mon Aug 14, 2006 3:56 pm
Location: Black Forest, Germany

Post by Dilloh »

Most errors seem to be of the same type:

Code: Select all

File "C:\Users\Toadpipe\Desktop\VS\MyStrike-0-50\data\modules\faction_ships.py", line 223, in GetStats
    debug.error( 'cannot find '+name)
followed by a message like "cannot find a".

Frankly, I do not know what a is, or r, or whatever coming out here.

Ace can surely help you better here.
Hawthorn-Slappy
Explorer
Explorer
Posts: 9
Joined: Wed Nov 28, 2007 4:32 am

Post by Hawthorn-Slappy »

Frankly, I do not know what a is, or r, or whatever coming out here.
You said it, that's the part that had me baffled too. However I think I figured it out. Section that looks like

Code: Select all

fightersPerFG=  {"chosen":10
                ,"spark":10
                ,"derge":10
                ,"teamster":10
                ,"luddite":10
                }
seems to be telling the script how many fighters to expect to find. I only had one fighter listed for each group. I doubled the number of fighters in the list and changed

Code: Select all

"chosen":10
to

Code: Select all

"chosen":2
Flew around all over the place and took as many missions as possible. Didn't encounter any load failed units and the errors are gone, so, mystery solved I think.

Thanks everyone for the mental floss.
Dilloh
Elite Hunter
Elite Hunter
Posts: 1149
Joined: Mon Aug 14, 2006 3:56 pm
Location: Black Forest, Germany

Post by Dilloh »

So you probably put in too many fighters per flightgroup that the game could handle... and therefor it refused loading all the ships. Probably.
jackS
Minister of Information
Minister of Information
Posts: 1895
Joined: Fri Jan 31, 2003 9:40 pm
Location: The land of tenure (and diaper changes)

Post by jackS »

I suspect it was the doubling of the fighters in the list -- python needs singletons formatted as lists to be lists, otherwise, it considers them lists of characters. The engine can handle large numbers of ships/fg.
Post Reply