CASCExtractor icon indicating copy to clipboard operation
CASCExtractor copied to clipboard

Does not work with SC2Data

Open Ralle opened this issue 9 years ago • 9 comments

I did the following:

CASCExtractor -o out "/usr/share/sc2/SC2Data/" "Assets/Buildings/Terran/Barracks/Barracks.m3"

Which gave me this output:

Opening '/usr/share/sc2/SC2Data'...
CASCExtractor: /compile/CascLib/src/CascBuildCfg.cpp:493: int GetGameType(TCascStorage*, LPBYTE, LPBYTE): Assertion `false' failed.
Aborted

Then I tried manually merging Zezula's CascLib into your CascLib and it would only ever give this output:

Opening '/usr/share/sc2/SC2Data'...
Failed to open the storage '/usr/share/sc2/SC2Data'

Please help me out. I need it for Hive Workshop :).

PS: In case you didn't know. Starcraft 2 is free-to-play, so you can easily get data to test with.

Ralle avatar Aug 13 '16 07:08 Ralle

Hi @Hube2 and thank you for your report. Interesting statement, however, when I set my CPT to be 'public' => false it does not show up in any way on the frontend. Even after setting has_archive. Can you share the code that you're using to generate your CPT?

Djennez avatar Nov 05 '19 08:11 Djennez

here is the php, i got it from CPTUI. I would have given you the JSON export but couldn't figure out how to get just the one post type and there's several on the site I'm building. It could also have something to do with the publicly_queryable argument. I know it took some playing to get the archive to show and not the singles.

function cptui_register_my_cpts_package() {

	/**
	 * Post Type: Packages.
	 */

	$labels = array(
		'name' => 'Packages',
		'singular_name' => 'Package',
		'menu_name' => 'Packages',
		'all_items' => 'All Packages',
		'add_new' => 'Add New',
		'add_new_item' => 'Add New Package',
		'edit_item' => 'Edit Package',
		'new_item' => 'New Package',
		'view_item' => 'View Package',
		'view_items' => 'View Packages',
		'search_items' => 'Search Packages',
		'not_found' => 'No Packages Found',
		'not_found_in_trash' => 'No Packages Found in Trash',
		'parent_item_colon' => 'Parant Package',
		'archives' => 'Package Archive',
		'insert_into_item' => 'Insert into Package',
		'uploaded_to_this_item' => 'Uploaded to this Package',
		'filter_items_list' => 'Filter Package List',
		'items_list_navigation' => 'Package List Navigations',
		'items_list' => 'Package List',
		'attributes' => 'Package Attributes',
		'name_admin_bar' => 'Package',
		'parent_item_colon' => 'Parant Package',
	);

	$args = array(
		'label' => 'Packages',
		'labels' => $labels,
		'description' => '',
		'public' => false,
		'publicly_queryable' => true,
		'show_ui' => true,
		'delete_with_user' => false,
		'show_in_rest' => false,
		'rest_base' => '',
		'rest_controller_class' => 'WP_REST_Posts_Controller',
		'has_archive' => true,
		'show_in_menu' => true,
		'show_in_nav_menus' => false,
		'exclude_from_search' => true,
		'capability_type' => 'post',
		'map_meta_cap' => true,
		'hierarchical' => false,
		'rewrite' => array('slug' => 'packages', 'with_front' => false),
		'query_var' => true,
		'menu_position' => 62,
		'menu_icon' => 'dashicons-tickets-alt',
		'supports' => array('editor', 'thumbnail', 'excerpt', 'custom-fields', 'revisions', 'author', 'page-attributes')
	);

	register_post_type('package', $args);
}

add_action('init', 'cptui_register_my_cpts_package');

Hube2 avatar Nov 05 '19 12:11 Hube2

Ah yes, this seems to be the winning combination:

		'has_archive' => true,
		'public' => false,
		'publicly_queryable' => true,

Not sure if it's something that will get implemented. Since it's kind of counter-intuitive I'm not going to label it as a bug, but rather as a feature request.

Djennez avatar Nov 05 '19 13:11 Djennez

Yeah, it's a little out of the box and I figure it to be an edge case. I doubt a lot of people even know this can be done or would find a use for it. In my particular case, the client has a 3rd party site that these packages are purchased through so while they are listed on the site they all link out to the 3rd party site. Doing this removes the need to remove the singles from the site map and or 301 redirecting them all. But I suppose that the archive page is not being put into the sitemap for the same reason, however, that's not as much of an issue.

In the mean time I've implemented ACF options pages for this with fields for meta title and description and I'm using the available filters to inject these into the archive pages.

Thanks for any consideration on making this change.

~JH

Hube2 avatar Nov 05 '19 14:11 Hube2

I've found opposite case that CPT is listed in "Content Types", but shouldn't be. After merging #8446, I think that's possible to replace get_post_types with method get_accessible_post_types which should be little changed:

$args = array(
	'public'             => true,
	'publicly_queryable' => true,
);

$post_types = get_post_types( $args, 'names', 'or' );   
$post_types = array_filter( $post_types, 'is_post_type_viewable' );

I think that will be correct solution.

stodorovic avatar Nov 15 '19 07:11 stodorovic

We are also experiencing this issue. We have a custom post type with public false so that permalinks are not created for the post pages with the CPT. However we still have an archive page for this post type because it is a list of awards and we display all of the awards using the archive.

mattkeys avatar Jan 19 '21 21:01 mattkeys

Please allow all CPT to show in Yoast SEO settings, including non-public CPT. This is needed for rest API, and who doesn't need can easily disable showing Yoast in Search appearance CPT settings.

gradosevic avatar May 28 '21 12:05 gradosevic

In our case, the sponsored option is missing from link editor on private CPTs. Is there an easy way to enable it on private CPTs?

Link editor popup for public CPTs: image

Link editor popup for private CPTs: image

rkbhochalya avatar May 08 '24 14:05 rkbhochalya