Boktor's Project


(.Chris.) #61

The warning messages suggest there is another .script somewhere that uses the same definitions but they are just warnings and can be ignored for now.

The actual error message could be to do with a missing mapinfo file, and pakmeta.conf file.

First thing you need to get working map script is the pakmeta.conf, I will use wake island as example:

// Map Data

mapMetaData maps/wake {  
	"pretty_name" "Wake Island" 
	"mapinfo" "wake" 
	"dz_deployInfo" "wake" 
	"server_shot_thumb" "levelshots/thumbs/wake.tga" 
	"show_in_browser" "1" 
}

This file is saved in the root/base directory of where your working. As you can see it sets what mapinfo file is used for this map which I’ve named wake, therefore I need to make a mapinfo file called wake.md and place it in /mapinfo note on the second line “_default_mapinfo( “wake” )” matches the mapinfo name from the pakmeta.conf.

#include <mapinfo/mapinfo.include>

mapInfoDef wake {	_default_mapinfo( "wake" )

	data {
		"mapBriefing"			"maps/wake/briefing"
		"mapLocation"			"maps/wake/location"
		"campaignDescription"	"maps/wake/campaign"
		"script_entrypoint"		"wake_MapScript"
		"numObjectives"			"4"
		"mtr_serverShot"		"levelshots/wake"
		"mtr_backdrop"			"levelshots/campaigns/pacific"
		"mapPosition"			"480 220"
		"snd_music"				"sounds/music/load3"
		"strogg_endgame_pause"	"5.0"
		"gdf_endgame_pause"		"5.0"
	}
}

Now this file is important for the mapscript, script_entrypoint tells the game where to look in the mapscript to get things started, you need the following in your mapscript:

mapObject_Base wake_MapScript() {
	return new mapObject_wake;
}

I’ve noticed you already have this in place for your mapscript.

Lastly you need to create a file called map.script and place it in /script which contains the following:

#include "script/maps/wake.script"

This is obviously the place you have saved the redfire.script for you, I assume you already done this otherwise you wouldn’t be getting any error messages as the game wouldn’t load the script in the first place.

So check the pakmeta and mapinfo files, double check for spelling and casing of letters, I notice you use upper case R for Redfire, maybe somewhere you forgot.


(Boktor) #62

Ok, so my SDK save path is C:\ETQW Custom and I’ve got this redfire map set up as a “new mod” so it’s in C:\ETQW Custom\redfire

Inside “C:ETQW Custom\redfire” I have

  1. pakmeta.conf
  2. /mapinfo/redfire.md
  3. /script/maps/redfire.script
  4. /script/map.script

pakmeta.conf

// Map Data

mapMetaData maps/redfire {
	"pretty_name"                        "Array"
	"mapinfo"                            "redfire"
	"dz_deployInfo"                      "redfire"
	"server_shot_thumb"                  "levelshots/thumbs/redfire.tga"
	"show_in_browser"                    "1"
}

/mapinfo/redfire.md

#include <mapinfo/mapinfo.include>

mapInfoDef redfire {              _default_mapinfo( "redfire" )

	data {
		// loading screen
		"mapLocation"			"maps/redfire/location"
		"mapBriefing"			"maps/redfire/briefing"
		"campaignDescription"		"maps/redfire/campaign"
		"mtr_serverShot"		"levelshots/redfire.tga"
	 	"mtr_backdrop"			"levelshots/campaigns/northamerica"
		"mapPosition"			"325 75"
		"snd_music"			"sounds/music/load2"
		
		//
		"strogg_endgame_pause"		"6.0"
		"gdf_endgame_pause"		"5.0"

		//mapscript
		"script_entrypoint"		"redfire_MapScript"
		"numObjectives"			"4"
		"extractMegaBasename" 		"redfire"

	}
}

/script/map.script

#include "script/maps/redfire.script"

And the mapscript which I already posted. For consistency I changed all the “Redfire” to “redfire”

The map still won’t start and It’s still giving the same error, complaining about line 6 in the script.


(Boktor) #63

FIXED!!

Something I didn’t mention. In an old tutorial it says to modify main.script in the SDK base/script folder and add in #include “script/maps/<yourmap>.script”
I took this out and NOW and my map runs with the mapscript working. Now team spawns are working, after I build the bridge the MCP is dropped, I can drive the MCP to deploy it etc.


Although the shield gen wouldn’t come down that is my next problem :smiley:


(Boktor) #64

Mask question:

My MCP route mask doesn’t to do anything. It’s an all white mask but no matter where I drive the MCP I get the “off course warning” and it blows up in 30 seconds. I am using the in-game mask editor (I am certain I am selecting the mcp_route mask) and I can see I am driving in valid spots (big uninterrupted green area) but it does not seem to matter.

However the in-game mask editor works perfectly for deployable spots and I can see the actual changes it makes in the default.tga mask.

BTW I used this tutorial for the in-game mask editor: http://forums.warchest.com/showthread.php/21945-Mask-editor


(Scrupus) #65

For the mcp you also need the waypoints I think - those green arrows showing the way. Do you have those?


(Boktor) #66

Yes, and the deploy spot. Those are all showing up in game.


(Scrupus) #67

Ah good. But then I’m not sure, been years since looked into that stuff. Never tried the mask editor for mcp either, you may try with just a pure white image (but looks like you already did). Check all the other parts, like the territory brushes and stuff.


(Boktor) #68

Back to my original project: “Techbuster”

I need help with the script. GDF needs to defend some stolen Strogg items. Strogg need to destroy these items with their nades and gunfire. Right now I have set up only 2 objectives, but later I hope to have maybe 8.

In-game there’s 2 gameplay/destructible/gdf, set up like this:

I thought to use the final_objective_proxy like in Refinery since I want multiple destructible objectives, but the keypair (scriptobject - destructible_objective_strategic) that enables my objectives to be destroyed by weapons won’t work with the final_objective_proxy . An error prevents the map start

ERROR: script/maps/generic/destructible_objective.script(907): Thread ‘’: destructible_objective_dual_proxy::OnPostMapSpawn target1 not found or is not a destructible objective

I think I might need an extra script for the destructible objectives I am planning, like Chris made Brinstar’s brain objective with “destructible_objective_brinstar.script”. Or maybe an altered script for the final_objective_proxy. Maybe it is possible without any extra scripts?? I am not sure what to do so that’s where I need help,

Here is the current script:

#define OBJECTIVE_TECHBUSTER_DESTROY_TECH	0
#define OBJECTIVE_TECHBUSTER_DESTROY_TECH_B	1

object mapObject_techbuster : mapObject_Default {
	void		InitObjectives();
	void		CompleteObjective( float index, entity p );
	void		StartFirstObjective();
	void		OnTechDestroyed();
	void		OnTechDestroyedB();
	void		OnTimeLimitHit();
	void            CompleteMap();
	void            EndMap();

	handle	GetObjectiveMessage( float index );

	float	mainObjectiveIndex;

	float   techsDestroyed;


	entity	gdfLockerSpawn;
	entity	gdfUpperSpawn;
	entity	stroggBaseSpawn;

	entity  techA;
	entity  techB;
	entity  finalObjectiveProxy;

}

mapObject_Base techbuster_MapScript() {
	return new mapObject_techbuster;
}

void mapObject_techbuster::InitObjectives() {

        sys.print( "*****LOADED TECHBUSTER SCRIPT" );

	gameRules.setWinningTeam( gdfTeam );
	gdfTeam.SetRespawnWait( 20 );
	stroggTeam.SetRespawnWait( 20 );
	CreateRespawnTimeThread( gdfTeam );

        //
        //Spawns
        //
        gdfLockerSpawn            = worldspawn.getEntityKey( "script_gdf_locker_spawn" );
        gdfUpperSpawn             = worldspawn.getEntityKey( "script_gdf_upper_spawn" );
        stroggBaseSpawn         = worldspawn.getEntityKey( "script_strogg_base_spawn" );

        gdfLockerSpawn.setGameTeam( gdfTeam );
        gdfUpperSpawn.setGameTeam( $null_entity );     //or gdfTeam?
        stroggBaseSpawn.setGameTeam( stroggTeam );
        
        //
        //Objectives
        //
        finalObjectiveProxy        = worldspawn.getEntityKey( "script_final_objective_proxy" );
        techA                      = worldspawn.getEntityKey( "script_destroy_tech_A");
        techB                      = worldspawn.getEntityKey( "script_destroy_tech_B");

        techsDestroyed = 0;

	mainObjectiveIndex = OBJECTIVE_TECHBUSTER_DESTROY_TECH;

	thread	StartFirstObjective();

	objManager.setNextObjective( gdfTeam, mainObjectiveIndex );
	objManager.setNextObjective( stroggTeam, mainObjectiveIndex );
}

void mapObject_techbuster::CompleteMap() {
    StopTimedMission();
    gameRules.setWinningTeam( stroggTeam );
    thread EndMap();
}

void mapObject_techbuster::EndMap() {
    sys.wait( 3.f );
    gameRules.endGame();
}

void mapObject_techbuster::StartFirstObjective() {
	sys.wait( 5.f );

	objManager.SetObjectiveEntity( finalObjectiveProxy, mainObjectiveIndex );

	CreateInitialTimedMission( finalObjectiveProxy );

	techA.vCreateMission();
	techB.vCreateMission();
}

void mapObject_techbuster::CompleteObjective( float index, entity p ) {
	if ( index == OBJECTIVE_TECHBUSTER_DESTROY_TECH ) {
	   OnTechDestroyed();
	} else if ( index == OBJECTIVE_TECHBUSTER_DESTROY_TECH_B ) {
           OnTechDestroyedB();
	}
}

handle mapObject_techbuster::GetObjectiveMessage( float index ) {
	if ( index == OBJECTIVE_TECHBUSTER_DESTROY_TECH ) {
                return sys.localizeString( "maps/techbuster/destroyed_tech_a" );
	}
        if( index == OBJECTIVE_TECHBUSTER_DESTROY_TECH_B ) {
                return sys.localizeString( "maps/techbuster/destroyed_tech_a" );
    }
    return g_locStr_BadObjective;
}

void mapObject_techbuster::OnTechDestroyed() {
       techsDestroyed = techsDestroyed + 1;

       techA.vCompleteMission();
       finalObjectiveProxy.vCompleteSubMission( techA );

       if ( techsDestroyed == 2 ) {
            CompleteMap();
}
}

void mapObject_techbuster::OnTechDestroyedB() {
       techsDestroyed = techsDestroyed + 1;
       techB.vCompleteMission();
       finalObjectiveProxy.vCompleteSubMission( techB );

       if ( techsDestroyed == 2 ) {
            CompleteMap();
}
}

void mapObject_techbuster::OnTimeLimitHit() {
	FinishTimedMission();
	objManager.SetObjectiveEntity( $null_entity, -1 );
}

(Boktor) #69

Uhh… Disregard most of the earlier post^^

I made some significant changes to the script and it’s working better. I got rid of the destructible dualproxy like in Refinery. I think this can work without it. I’ll update this post as things develop. :rolleyes:


(Boktor) #70

Techbuster is ready for a rough gameplay test. About time, right??

Are there any guides for making the .pk4? I put one together out of guesswork and loaded it into the retail QW, but I must be missing things. I get some warnings and an error:

WARNING: idCollisionModelManagerLocal::ReadMaterialCacheFromFile Invalid Material ‘textures/common/rendermodel_player_clip_wood’ in ‘maps/techbuster.cmb’

and

ERROR :1idCollisionModelManagerLocal::ParsePolygons_Binary Polygon with no material


(Scrupus) #71

[QUOTE=Boktor;435838]Techbuster is ready for a rough gameplay test. About time, right??
[/QUOTE]

Yay! :smiley:

Are there any guides for making the .pk4? I put one together out of guesswork and loaded it into the retail QW, but I must be missing things. I get some warnings and an error:

WARNING: idCollisionModelManagerLocal::ReadMaterialCacheFromFile Invalid Material ‘textures/common/rendermodel_player_clip_wood’ in ‘maps/techbuster.cmb’

and

ERROR :1idCollisionModelManagerLocal::ParsePolygons_Binary Polygon with no material

I’m not sure if there are any good guides around, but a few things that is important:

  • Make sure you add a proper addons.conf before publishing it. If it’s wrong it can screw up vanilla installation for all who downloads it, so better get that proper. I’ll gladly help you verify the pk4 before publishing a downlod link, and can also offer a pw protected test server just to make sure it runs ok on server side. TAW can also help with this, I think. Note that running it on server can show errors you won’t notice when running locally.

  • About those warnings, note that there are some stuff (textures and models) that are not included in retails (and visa verse). Textures are usually not a big problem, they will show up as black (and might be in invisible places anyway). Models are more important, as they’re more visible and sometimes non-solid as well. You could try to include the missing materials and models in the pk4.

  • Error is critical, but I have no idea what that one mean. Maybe something from from a LOD group or similar. Or related to the missing material warning.

  • Make sure you isolate map files as much as possible from other maps, so they don’t overlap. Especially, the declarations! Put them in a map specific file in the pk4, like this: def/maps/yourmap_paths.def

Plus some other bits, but hard to remember all. Best way is to test the pk4 on server and fix stuff until it’s working okay :slight_smile:

Just PM me if you wanna test on a test server :slight_smile:


(Khamul) #72

Lol i cant wait to play on techbuster!! Just write sth on biatch irc when u will test it :wink:


(Boktor) #73

I think this is the problem. I didn’t include any materials. Is there a fast way to see what I need to include in the pk4? I used a lot of different textures…


(.Chris.) #74

Make sure your text editor is set so it opens .mtr files. Go into the editor and find the texture that is creating problems in the texture menu, right click and select view material file, this will open the .mtr it located in so you know where it is stored and what it is called, then copy paste that into your .pk4. I don’t think you have to match and paths as long as the .mtr is in /materials it will get read.


(Donnovan) #75

Awesome news Boktor! Just dont die right now, you is very near!

In case you dont get Chris tutorial, here some more:

Some of the SDK textures you see in the Media/Textures windows exist only in the SDK, not in the retail game, so you must find the .mtr file were this textures (the ones giving error) are declared and copy this declaration to you .mtr file (techbuster.mtr, my_textures.mtr etc…), located in you techbuster “materials” folder.

For example, this texture “'textures/common/rendermodel_player_clip_wood” does not exist in the retail game. So:

1 - Open SDK
2 - Open your map
3 - Find that texture in the texture tab
4 - Right click in it and select “view material file”
5 - After (4 -), the .mtr file that contain the declaration of the texture will be opened, so you will need to choose a program to open it, this program can be notepad, word, wordpad…
6 - Once file is open, you will find many textures declaration, including the one you want.
7 - Find the one you want, something like that:

material textures/common/rendermodel_player_clip_wood {
[some text here]
}

8 - Copy it and put in your techbuster.mtr file, localized in [MOD FOLDER]/techbuster/materials. The .mtr file can have other name, yes.
9 - You can use the same .mtr file to includ all missing textures you know.
10 - Dont forget to include this file in the new PK4.
11 - Run teh map on retail ETQW, with this new PK4 file, and see if another textures give a error… if yes, include it in your .mtr file like you did right above.

Repeat until you get no more missing texture errors. I believe you should have 3 or 4 missing textures to deal, because most of the textures on the SDK exist in the retail game so will not be a problem.

Other types of declarations can also be missing, like the light_inside declaration, a interior light entity that does not got cliped by portals. You can use then, but must find it in the SDK and include in your PK4 file.


(Scrupus) #76

Yeah as Chris and Don said if you need those textures they have to be included in material files. But I’m wondering if you really need those - maybe you applied them to some surfaces by accident or something? Those clip textures are more for the editor and compiler, not sure if you want them in the final map pk4.

But thanks for the pk4 you sent me - I tested it and got same error as you. Also noticed this - they shouldn’t really be in the final map either I think:

WARNING: Generating implicit material for textures/sfx/flare4
WARNING: Generating implicit material for textures/editor/shadowcaulk
WARNING: Generating implicit material for caulk

I think you can search for brushes containing those material names inside the editor - check if they are valid or just some leftovers or something.

Also got a few notes on the rest of the pk4:

  1. This one don’t belong in the def folder, can probably be removed - it’s also in the material folder already: def/techbuster.mtr

  2. script/maps/
    |-- generic
    | -- [B]destructible_objective_techbuster.script[/B]– techbuster.script

You should probably merge the content of the destructible_objective_techbuster.script into the techbuster.script, for easier campaing/custom server support. I know it’s more logical to keep it separate, but the custom campaign system is a bit borked, and works best with only one script pr. map. Just paste the content into the techbuster.script.

  1. maps/techbuster.cm - this file can be removed from the pk4, as the compiled version is already in the .cmb file - will save a little bit on the file size :slight_smile:

Didn’t notice any other problems for now, but let’s see when you figure out the materials problem :slight_smile:


(Boktor) #77

MASSIVE thanks, guys. I think missing materials and models are solved now. Also, Scrupus I took your advice for moving files in the .pk4 (and the script is also all contained in techbuster.script)

Still getting an error now that prevents the map from starting. Seems the script isn’t being read in the retail game?

Boktor entered the game.
WARNING: Thread 'sdObjectiveManagerLocal': sdObjectiveManagerLocal::Event_CreateMapScript Could Not Find Script Entry Point 'techbuster_MapScript'
--------- Game Map Shutdown ----------
--------------------------------------
client 0 disconnected.
********************
ERROR:  -> ** UNKOWN ** -> ** UNKOWN ** -> ** UNKOWN ** -> ** UNKOWN ** -> **
UNKOWN ** -> ** UNKOWN ** -> ** UNKOWN ** -> ** UNKOWN ** -> ** UNKOWN ** -> *
* UNKOWN ** -> ** UNKOWN ** -> ** UNKOWN ** -> ** UNKOWN ** -> ** UNKOWN ** ->
 ** UNKOWN ** -> ** UNKOWN **
Thread: sdObjectiveManagerLocal
objectiveManager::OnMapStart No Map Script

EDIT: Fixed, need to add “no_compiled_script” “1” to the addon.conf


(Boktor) #78

The good news is: Techbuster runs in the retail game :cool:

Bad news is I get a rainbow map which means my atmosphere/ambient light isn’t showing up. I’ve tried both. I have a second “caulk hull” within the real caulk hull and it has a single outer face textured with outside portal.

Strangely the lighting works in the GDF spawn. It’s a closed room with an ambient light entity and the room is blocked with an ambient portal. Apparently this works, but when I try the same scheme in any other area (which needs multiple portals) it won’t work. Any tips for this? Once I fix this minor problem I’m 100% ready for gameplay testing.


(.Chris.) #79

Find out which ambient light you are using, find it in /atmosphere and include it in your pk4, not all .atm are in the retail game. .atm contain both atmospheres and ambient light details, do a search in files to find which .atm the ambient lights or atmospheres you are using.


(Boktor) #80

Thanks Chris, that did it.

After all this digging in the SDK files to find materials and whatnot I used, I realize that some files are usable in the SDK but I can’t find them in their folders. For example, a func_fx entity of steam shooting out of a pipe is effects/ambient/shootingsteam_medium. It only shows up in the editworld camera, but not in the SDK etqw and I can’t find the .effect file in my file browser. Strange…

Anyway Techbuster is FIIIIINALLY ready