returnable objectives, entities and script need help please


(blushing_bride) #1

Right ive been trying to work this out all day looking at varoius examples and threads, unfortunantly i think this has left me even more confused (im one of those people who is unable to understand scripting sorry). What i want in my map is a set of returnable objectives like in the map Radar (radar script is no help as it has all that other stuff in it). Anyway i used the sample map in the LDR (which never seemed to work right anyway) as a base to start from. These are my entities

THE PICK UP POINT

team_CTF_redflag
count 2
scriptname radarbox
message Radar Parts

trigger_objective_info
targetname radarbox1_trigger
script name radarbox1_trigger
shortname Radar Box
track Radar Box
spawnflags 19

misc_commandmap_marker
scriptname radarbox1_cmarker
targetname radarbox1_cmarker

THE DROP OFF POINT
misc_gamemodel
model …/…/portable_radar_box.md3
targetname radarbox1
scriptname radarbox1

misc_gamemodel
model …/…/portable_radar_box_tr.md3
targetname radarbox1trans
scriptname radarbox1trans

misc_gamemodel
model …/…/portable_radar_box.md3
targetname radarbox2
scriptname radarbox2

misc_gamemodel
model …/…/portable_radar_box_tr.md3
targetname radarbox2trans
scriptname radarbox2trans

trigger_flagonly_multiple (this also has an origin brush to go with it)
spawnflags 1
targetname exitpoint2
scriptname exitpoint2

THE SCRIPT

game_manager
{
	spawn
	{

// Game rules
		wm_axis_respawntime	20
		wm_allied_respawntime	15
		wm_number_of_objectives 1
		wm_set_round_timelimit	20

// Stopwatch mode defending team (0=Axis, 1=Allies)
		wm_set_defending_team	0

		// Winner on expiration of round timer (0=Axis, 1=Allies)
		wm_setwinner	0
		
wait 150

		setautospawn "Old City"			1
		setautospawn "Old City"			0




			}	
} 



// ============================================================================
// Visual Clues for drop off points
// ============================================================================
radarbox1
{
	spawn
	{
		wait 50
		accum 1 set 0			// once only trigger
		setstate radarbox1 invisible		// Show radarbox
		setstate radarbox1trans default		// Hide red marker
	}

	trigger visible
	{
		accum 1 abort_if_not_equal 0		// Only use once
		setstate radarbox1 default		// Show radarbox
		setstate radarbox1trans invisible		// Hide red marker
		wm_announce	"Allies have secured the Radar Box 1!"
		accum 1 set 1			// Do not use this function again
	}
}

radarbox2
{
	spawn
	{
		wait 50
		accum 1 set 0			// Once only trigger
		setstate radarbox2 invisible		// Hide radarbox
		setstate radarbox2trans default		// Show red marker
	}

	trigger visible
	{
		accum 1 abort_if_not_equal 0		// Only use once
		setstate radarbox2 default		// Show radarbox
		setstate radarbox2trans invisible		// Hide red marker
		wm_announce	"Allies have secured the Radar Box 2!"
		accum 1 set 1			// Do not use this function again
	}
}

// ============================================================================
// Pick up point for Radar Boxes
// ============================================================================
radarbox
{
	trigger stolen
	{
		setstate radarbox invisible		// hide current radarbox
	}

	trigger returned
	{
		setstate radarbox default		// Show current radarbox
	}
}

// ============================================================================
// Exit Points - Trigger brushes
// ============================================================================
exitpoint1
{
	death
	{
		trigger radarbox1 visible		// Perform exit1 tasks
		trigger game_manager final_check	// Inc counter game counter
		wm_announce	"ExitPoint 1!"
	}
}

exitpoint2
{
	death
	{
		trigger radarbox2 visible		// Perform exit2 tasks
		trigger game_manager final_check	// Inc counter game counter
		wm_announce	"ExitPoint 2!"
	}
}

PROBLEMS

  1. Now in game this gives me only one location where i can pick up the radar parts (the count 2 line in the team_ctf_redflag allows there to be two radar parts even though there is only one entity) and i want two locations from which to pick stuff up from. i tried dupilcating the pick up point entities, getting rid of count 2 and renaming stuff etc but this did not work. How can i have two seperate locations to pick up the parts (exactly like Radar map)

  2. The drop off point has both transparent red boxes but after dropping off both radar parts only one ever becomes solid. the second one remains transparent. I read in a few threads you only need one trigger_flagonly_multiple entity so i dont know if i should use two and if so what extra scripting is required

  3. lastly i want the map to end once both radar parts have been dropped off. i have no idea how to do this

In summary im pretty stuck and my head is spinning from trying a million different things all day. scripting has never made any sense to me but i usually manange to muddle my way through somehow but this time im totally stuck. if anyone has a working prefab that i can use then please let me know as it would be so much easier to wotrk these things out if only there were decent samples to work from. anyway hope someone can help otherwise i might start doing this :banghead:


(sock) #2

Which sample map? How does it not work? Ive only done one sample map which is a special version with 2 objectives being delivered to 2 different locations in any order, this is not really a radar example.

Sock
:moo:


(CptnTriscuit) #3

in the process of writting out an long freakin’ post - so if anyone beats me to it I’ll come get you! :angry:


(Mean Mr. Mustard) #4

We used sock’s “sample08c” map for the entities in vengeance. The sample map was bug free. It allowed the capturing of 2 items (from the same location) but delivering them to 2 separate secure points (and you could secure the parts in either order)


(Ifurita) #5

Bride, I released the source code for byzantine. THis is a dual objective map where both sides have 2 objectives they must capture and take to a truck. The game ends when a side has captured both of their objectives

Source .map file
http://pcgamemods.com/5729/

PK3 file with scripts and other stuff
http://pcgamemods.com/2949/

Take a look through those - or just rip out the entities and you should have a good start

/me hopes he beats Triscuit


(Ifurita) #6

in the process of writting out an long freakin’ post - so if anyone beats me to it I’ll come get you!

Pwnd by both team mates :smiley:


(Ifurita) #7

Speaking of Vengeance, if you want to look thru the entities for that map, here is the source file

http://pcgamemods.com/5730/


(CptnTriscuit) #8

Haha, figures you two would be the first ones to screw me over :smiley:

Better idea - instead of me posting what was becoming a monsterous preachy tutorial better left to somone who knows for sure what they’re talking about (Sock :moo:) - follow Mustard’s / Ifurita’s links. If you still are stuck, send me your .map file and I’ll make it work.

CptnTriscuit@PlanetWolfenstein.com


(blushing_bride) #9

Which sample map? How does it not work? Ive only done one sample map which is a special version with 2 objectives being delivered to 2 different locations in any order, this is not really a radar example.

Sock

i used the one with two rocket type things in them. it would not work for me (i have successfully used prefabs from the LDR before so i may have missed something with this one), there were errors in the console when importing into radiant plus i got debug window messages when compiling. none of the warnings stopped it from compiling. once i had it compiled and in game it did not seem to do what i thought it was meant to do but maybe i had the wrong idea of what it should do. Anyway i assumed it was me doing something wrong but i got enough bits from it to make a start on trying to wrok out how to do a double retunrable objective thingy. the above script and the entities are all taken directly from the LDR sample.

@iffy: ive already borrowed the CP spawn from vengeance, did’nt know you had released byzantine as well so ill have a look in there

Better idea - instead of me posting what was becoming a monsterous preachy tutorial better left to somone who knows for sure what they’re talking about

@cptnTriscuit
i like long preachy tutorial’s, in fact if there were any i probably be able to work stuff out on my own. im sure if you were to write some tutorials they would be very welcome by community.

well i will take a look at byzantine and see what i can learn.


(Drakir) #10

This is easily done:

Code part is taken from radar.

Entitys u need:

2 “team_CTF_redflag” with different Scriptnames “radarbox1” and “radarbox2” and different message values “East Radar Parts” and “West Radar Parts”
NOTE! Dont ever use a targetname in the team_CTF_xxxflag entity or it will not show ingame, its a bug!

1 “trigger_flagonly_multiple” set to “red_flag” and script/targetname set to “truck_exitpoint”

2 “misc_gamemodels” of the trans version of the boxes with different scriptnames and targetnames “truckboxtrans1” and “truckboxtrans1”
NOTE! targetname is very important as this is needed to set the different states on the enity (default, invisible)

2 “misc_gamemodels” of the solid version of the boxes with different scriptnames and targetnames “truckbox1” and “truckbox2”
NOTE! targetname is very important as this is needed to set the different states on the enity (default, invisible)

Scripting.
In radar they used the counter in the game_manager part to keep tracks of when to end the game.

So what happens?
When a radarpart is taken it runs the “stolen” part of the script in “radarbox1 or radarbox2” scriptblock.
When a radarpart is captured at the trigger_flagonly_multiple there is 2 things happening at the same time, first the “death” part of the “truck_exitpoint” is executed and that triggers the “stolen_circuit” in the game_manger script block and there adds 1 to the counter and checks if booth parts are secured by running the “checkgame” block. It also runs the “captured” trigger in the “radarbox1 or radarbox2” scriptblock and that part is setting the state of the misc_gamemodels to solid by triggering the “visible” trigger in the “truckbox1” or “truckbox2” scriptblock depending on part secured.

==========================================================================================================


	// Code in game_manager
	trigger stolen_circuit
	{
		accum 1 inc 1				// One circuit board home
		trigger game_manager checkgame		// Check for end of game
	}

	trigger checkgame
	{
		accum 1 abort_if_not_equal 2
		wm_setwinner 1
		wait 1500
		wm_endround
	}


//Code for the solid radar models.
truckbox1
{
	spawn
	{
		wait 50
		setstate truckbox1 invisible
		accum 1 set 0
	}

	trigger visible
	{
		setstate truckbox1 default
		accum 1 abort_if_not_equal 0
		wm_announce	"Allies have secured the West Radar Parts!"

		// *----------------------------------- vo ------------------------------------------*
		wm_teamvoiceannounce 0 "radar_axis_radarw_secured"

		wm_teamvoiceannounce 1 "radar_allies_radarw_secured"

		wm_removeteamvoiceannounce 0 "radar_axis_radarw_defend"
		// *---------------------------------------------------------------------------------*

		accum 1 set 1
	}

	trigger invisible
	{
		setstate truckbox1 invisible
	}
}


truckbox2
{
	spawn
	{
		wait 50
		setstate truckbox2 invisible
		accum 1 set 0
	}

	trigger visible
	{
		setstate truckbox2 default
		accum 1 abort_if_not_equal 0
		wm_announce "Allies have secured the East Radar Parts!"

		// *----------------------------------- vo ------------------------------------------*
		wm_teamvoiceannounce 0 "radar_axis_radare_secured"

		wm_teamvoiceannounce 1 "radar_allies_radare_secured"

		wm_removeteamvoiceannounce 0 "radar_axis_radare_defend"
		// *---------------------------------------------------------------------------------*

		accum 1 set 1
	}

	trigger invisible
	{
		setstate truckbox2 invisible
	}
}

// Code for the transparent versions
truckboxtrans1
{
	trigger visible
	{
		setstate truckboxtrans1 default
	}

	trigger invisible
	{
		setstate truckboxtrans1 invisible
	}
}

truckboxtrans2
{
	trigger visible
	{
		setstate truckboxtrans2 default
	}

	trigger invisible
	{
		setstate truckboxtrans2 invisible
	}
}


//Code for the team_ctf_redflag entitys
radarbox1
{
	spawn
	{
	}

	trigger stolen
	{

		wait 1000

		// *----------------------------------- vo ------------------------------------------*
		wm_teamvoiceannounce 0 "radar_axis_radarw_taken"

		wm_teamvoiceannounce 1 "radar_allies_radarw_taken"
		// *---------------------------------------------------------------------------------*
	}

	trigger returned
	{
		// *----------------------------------- vo ------------------------------------------*
		wm_teamvoiceannounce 0 "radar_axis_radarw_returned"

		wm_teamvoiceannounce 1 "radar_allies_radarw_returned"
		// *---------------------------------------------------------------------------------*
	}

	trigger captured
	{
		trigger truckbox1 visible
		trigger truckboxtrans1 invisible
	}
}


radarbox2
{
	spawn
	{
	}

	trigger stolen
	{

		wait 1000

		// *----------------------------------- vo ------------------------------------------*
		wm_teamvoiceannounce 0 "radar_axis_radare_taken"

		wm_teamvoiceannounce 1 "radar_allies_radare_taken"
		// *---------------------------------------------------------------------------------*
	}

	trigger returned
	{
		// *----------------------------------- vo ------------------------------------------*
		wm_teamvoiceannounce 0 "radar_axis_radare_returned"

		wm_teamvoiceannounce 1 "radar_allies_radare_returned"
		// *---------------------------------------------------------------------------------*

	}

	trigger captured
	{
		trigger truckbox2 visible
		trigger truckboxtrans2 invisible
	}
}

// The trigger_flag_multiple
truck_exitpoint // Exit point of map
{
	death
	{
		trigger game_manager stolen_circuit
	}
}

(Loffy) #11

I spectated blushing_bride yesterday, when fragging on SD’s server. (Yes, sometimes I’m in limbo. Fluke nades will get even me eventually.) He is actually a good player.
// L


(thore) #12

on a sidenote: some of the ldr samples are BROKEN!

just to name the ‘multiple team flags’ section, radar and oasis samples
only show up with ‘entity 0’ (thats all to see there) and the dual exit
point sample map starts with

// entity 0
{
// entity 0
{
“classname” “worldspawn”

you have to delete the first // entity 0 {, then save it as a .map
file… that way it worked for me.

gl


(blushing_bride) #13

Drakir that worked perfectly, many thanks (now i just need to make the team_ctf_multiple’s visible but im sure i can work that out). A great post and should be mentioned in the sticky thread.

I spectated blushing_bride yesterday, when fragging on SD’s server. (Yes, sometimes I’m in limbo. Fluke nades will get even me eventually.) He is actually a good player.
// L

i can tell you are in awe of my running away and hiding skills. :banana: