Getting the old scavenger hunt working

Hey guys,

Too many people asking on Discord how to get the scavenger hunt working. I’ve made a flash dependency that makes the process very seamless.

This tutorial shows how to get the halloween party 2010 scavenger hunt working for the AS2 client. You can edit the flash files to make any scavenger hunt you choose.

Here is the code for the flash dependency (attached in FLA and SWF format below):

var AUTHOR = "[email protected]";

var INTERFACE = _global.getCurrentInterface();
var SHELL = _global.getCurrentShell();

var PUMPKIN_BASKET_ID = 331;

var showIcons = INTERFACE.showIcons;
INTERFACE.showIcons = function() {
	showIcons();
	var _loc2_ = SHELL.getPath("scavenger_hunt_icon");
	if(INTERFACE.ICONS.scav_mc) {
		INTERFACE.ICONS.scav_mc.removeMovieClip();
	}
	INTERFACE.ICONS.createEmptyMovieClip("scav_mc",1);
	INTERFACE.ICONS.scav_mc.loadMovie(_loc2_);
}

SHELL.dependencyHolder.hunt = Object();
SHELL.dependencyHolder.hunt.findHuntItemById = function(item_id) {
	SHELL.setHuntItemAsFoundById(item_id);
};

var showHuntUI = function() {
	if(SHELL.isItemInMyInventory(PUMPKIN_BASKET_ID)) {
		INTERFACE.showContent("hunt_ui");
	} else {
		INTERFACE.showContent("item_warn");
	}
};

SHELL.setOnHuntSuccessFunction(showHuntUI);
SHELL.setOnHuntFailureFunction(showHuntUI);

Just export that with flash and save it in /play/v2/client/ of your media server, or just download the one from the attachments.

Add a new entry in depdencies.json for scavenger_hunt.swf (see Arthur’s ooolllllddddd post if you don’t know much about how dependencies in the Club Penguin client work). The dependencies.json is found inside /play/v2/client and should look like this after you’re done:

... code above ommitted
	join: [
		{
			id: 'engine',
			title: 'Engine'
		},
		{
			id: 'interface',
			title: 'Interface'
		},
		{
			id: 'scavenger_hunt',
			title: 'Interface'
		},
... code below ommitted

Notice the new entry below interface. Save dependencies.json.

Go and edit your global_crumbs.swf located in /play/v2/content/global/crumbs (either with JPEX or decompiled FLA in flash) and add two new path entries. Find this line:

var global_path = new Object();

And anywhere underneath that, add the following entries:

global_path.scavenger_hunt_icon = "scavenger_hunt/scavenger_hunt_icon.swf";
global_path.hunt_ui = "scavenger_hunt/hunt_ui.swf";
global_path.item_warn = "scavenger_hunt/item_warning.swf";

Finally place the three files in the attachment (scavenger_hunt.zip) scavenger_hunt_icon.swf, scavenger_hunt/hunt_ui.swf and scavenger_hunt/item_warn.swf inside the /play/v2/content/global/scavenger_hunt directory of your media server.

Basic setup is done!

Other notes:

  • Client configuration for the hunt items are located inside /play/v2/content/local/{{language}}/crumbs/local_crumbs.swf and look like this:
    var hunt_crumbs = new Array();
    hunt_crumbs[0] = {name:"cave",is_found:false,is_required:true};
    hunt_crumbs[1] = {name:"cove",is_found:false,is_required:true};
    hunt_crumbs[2] = {name:"dock",is_found:false,is_required:true};
    hunt_crumbs[3] = {name:"forts",is_found:false,is_required:true};
    hunt_crumbs[4] = {name:"berg",is_found:false,is_required:true};
    hunt_crumbs[5] = {name:"plaza",is_found:false,is_required:true};
    hunt_crumbs[6] = {name:"beach",is_found:false,is_required:true};
    hunt_crumbs[7] = {name:"forest",is_found:false,is_required:true};
    
    The room names really mean nothing, the client ignores them… Changing this shouldn’t really be necessary unless you ever change the number of items the player needs to find.
  • If you’re making new rooms for this hunt system, or you’re editing rooms that don’t work with this hunt system, the item onrelease event in flash must call the following function:
    _global.getCurrentShell().dependencyHolder.hunt.findHuntItemById(HUNT_ITEM_ID_HERE);
    where HUNT_ITEM_ID_HERE matches an item ID in the hunt_crumbs located inside local_crumbs.swf (shown above).
  • That’s it for now i think.

Attachments

scavenger_hunt.zip (44.5 KB)

Enjoy!

1 Like