Scripting problem with flags, got the flags working kinda


(lispider) #1
flag1
{
	spawn
	{
		accum 1 set -1
	}

	trigger axis_capture	// flag has been touched by an Axis player
	{
		accum 1 abort_if_not_equal -1	// flag owned by someone, then abort.
		accum 1 set 0					// Axis own the pole
		wm_announce	"Axis capture the flag 1!"
		//alertentity flag1spawns
		alertentity flag1area

		globalaccum 0 abort_if_greater_than 0 // atleast flag number 1 already taken, abort
		globalaccum 0 set 1
		wait 500
		setautospawn "Flag 1" 0
		setautospawn "Flag 1" 1
	}

	trigger allied_capture	// flag has been touched by an allied player
	{
		accum 1 abort_if_not_equal -1	// flag owned by someone, then abort.
		accum 1 set 1					// Allies own the pole
		wm_announce	"Allies capture the flag 1!"
		//alertentity flag1spawns
		alertentity flag1area

		globalaccum 0 abort_if_greater_than 0 // atleast flag number 1 already taken, abort
		globalaccum 0 set 1
		wait 500
		setautospawn "Flag 1" 0
		setautospawn "Flag 1" 1
	}

	trigger kill
	{
		remove
	}
}

I have the entities setup as follows

FlagPole
classname = team_WOLF_checkpoint
scriptname = flag1area
targetname = flag1area
target = Flag 1
spawnflags = 1

Objective Above Pole
classname = team_WOLF_objective
scriptname = flag1area
description = Flag 1

Axis Flag 1 Spawnbox
classname = team_CTF_redspawn
scriptname = Flag 1
targetname = Flag 1

The accume should add 1 as you go along and be checking so that you spawn at the next flag but something isnt right and im not sure what. Can anyone help?[/b]


(The Wanderer) #2

You could try to make the thing go to the other thing and then maybe that something that’s not right will be good.


(lispider) #3

jesus christ wtf is the point of giving someone a hard time when they are learning? hope u die right now at ur desk reading this wanderer ur useless and a waste of oxygen and resources. Infact go commit suicide no one cares :stuck_out_tongue:


(The Wanderer) #4

Nobody is giving you a hard time.
If you had actually said what the problem is that you’re having instead of “something is not right in my map” I would’ve gladly helped you.
A stupid question deserves a stupid answer which is what you got.

P.S. you might wanna give decaf a try.


(lispider) #5

Ok heres what I have now… I have really put alot of effort and read through the forums trying to solve this problem.


game_manager
{
	spawn
	{
		// Game rules
		wm_axis_respawntime	3
		wm_allied_respawntime	3
		wm_set_round_timelimit	60
		wm_setwinner -1

		// accums
		globalaccum 0 set 0		// what is the highest flag number taken

	}
}

// FLAG 1
//
flag1
{
	spawn
	{
		accum 1 set -1
	}

	trigger axis_capture	// flag has been touched by an Axis player
	{
		accum 1 abort_if_not_equal -1	// flag owned by someone, then abort.
		accum 1 set 0					// Axis own the pole
		wm_announce	"Axis capture the flag 1!"
		alertentity flagspawn1
		alertentity flagblob1
		globalaccum 0 abort_if_greater_than 0 // atleast flag number 1 already taken, abort
		globalaccum 0 set 1
		wait 500
		setautospawn "Flag 1" 0
		setautospawn "Flag 1" 1
	}

	trigger allied_capture	// flag has been touched by an allied player
	{
		accum 1 abort_if_not_equal -1	// flag owned by someone, then abort.
		accum 1 set 1					// Allies own the pole
		wm_announce	"Allies capture the flag 1!"
		alertentity flagspawn1
		alertentity flagblob1

		globalaccum 0 abort_if_greater_than 0 // atleast flag number 1 already taken, abort
		globalaccum 0 set 1
		wait 500
		setautospawn "Flag 1" 0
		setautospawn "Flag 1" 1
	}

	trigger kill
	{
		remove
	}
}

Then the following 4 entities,


team_WOLF_objective
scriptname = flagblob1
targetname = flagblob1
Description = Flag 1


team_WOLF_checkpoint
scriptname = flag1
targetname = flag1
target = flagspawn1


team_CTF_redspawn
targetname = flagspawn1


team_CTF_bluespawn
targetname = flagspawn1

As soon as the flag gets grabbed/touched the game kicks me out with the following error: “G_Scripting: setautospawn, couldn’t find target”

Why am I getting this error? How do I fix it? Is the error in my script?


(Ifurita) #6

Description needs to be description (lower case d)