I need help again


(smallwood2000) #1

Sorry but im stuck and need help again i have taken the destrution map as show in my tutorial

http://uk.geocities.com/caldecottlambert@btinternet.com/cs.htm

and tried to make a forward spawnpoint in it,
when i run the map i get a eroor message that reads

line11:’{'found,name expected

and i added a TEAM_WOLF_CHECKPOINT and the entitles go as follows

spawnflags 1
scriptname forwardspawn1_flag
targetname forwardspawn1_flag
target forwardspawn1_spawns

I have clicked on spawnpoint as well in the entitle menu

Then i have added 3 of each color spawnpoints

There entitles are

targetname forwardspawn1_spawns
classname team_CTF_redspawn

next to that the is a TEAM_WOLF_OBJECTIVE

the entitles are

description forward spawn
spawnflags 2
targetname forwardspawn1_wobj
scriptname forwardspawn1_wobj
classname team_WOLF_objective

there is aslo a dynamite/construct objective in my room and i know now thanx to your guys help it all works, the info for that is in my tutorial thats link i will post my script incase there is a problem in there.


(smallwood2000) #2

game_manager
{
spawn
{
wait 150 //Let the game rest for a sec.

wm_axis_respawntime 16
wm_allied_respawntime 16
wm_set_round_timelimit 20
}
}
{
spawn
{
wait 50 // Wait for all entities to spawn
setautospawn “Forward Spawn” 0 // Set Axis to forward spawn
}
}

// ============================================================================
// Forward Spawn point - Initially owned by Axis
//
// ============================================================================
forwardspawn1_flag
{
spawn
{
accum 0 set 0 // Who owns flag: 0-Axis, 1-Allied
}

trigger axis_capture				// Touched by an Axis player
{
	accum 0 abort_if_equal 0 		// do Axis own flag?

	accum 0 set 0 			// Axis own the flag
	wm_announce "Axis reclaim the Forward Spawn!"

	alertentity forwardspawn1_wobj		// Switch command map marker
	setautospawn "Forward Spawn"	0	// Set Axis to forward spawn
}

trigger allied_capture				// Touched by an allied player
{
	accum 0 abort_if_equal 1 		// do Allies own flag?

	accum 0 set 1 			// Allied own the flag
	wm_announce "Allies capture the Forward Spawn!"

	alertentity forwardspawn1_wobj		// Switch command map marker
	setautospawn "Forward Spawn"	1	// Set Allies to forward spawn
}

trigger force_allied
{
	accum 0 abort_if_equal 1 		// Do Allies own the flag?
	alertentity forwardspawn1_wobj		// Switch command map marker
	alertentity forwardspawn1_spawns		// Switch all spawnpoints
	setautospawn "Forward Spawn"	1	// Set Allies to forward spawn
}
trigger kill
{
	remove				// Remove self (flag model)
}

}

dynamiteobj1
{
spawn
{
wait 100 // Wait for all entities to spawn
constructible_class 3 // Dynamite only
}

death
{
	trigger forwardspawn1_flag force_allied 	// Switch forward spawn to Allied ONLY
	trigger forwardspawn1_flag kill		// Remove entities
	setstate forwardspawn1_base invisible	// Remove base of flag

	wm_announce "Allies have destroyed the Dynamite Objective 1"
}

}
fence
{
spawn
{
wait 200
constructible_class 2 //Satchel-able objective.
constructible_constructxpbonus 1
}

built final
{
setstate fence default
setstate fence_materials invisible
}

decayed final
{
setstate fence invisible
setstate fence_materials default
}

buildstart final //I’m not sure if this is necessary.
{
setstate fence underconstruction //Include it anyway.
setstate fence_materials default
}

death
{
setstate fence_materials default
wm_announce “The Fence has been destroyed!”
}
}


(smallwood2000) #3

Tried everthing still coming up with same message plz help im only a newbie


(SCDS_reyalP) #4

The error clearly states what the problem is. And BTW, when you post script you should use [ code ] tags and indent your code, like this


game_manager
{
	spawn
	{
		wait 150 //Let the game rest for a sec.

		wm_axis_respawntime 16
		wm_allied_respawntime 16
		wm_set_round_timelimit 20
	}
} 

Notice that the last } ends the gamemanager script. Thus the game expects a new script, starting with a name. Which is exactly what it is telling you.


(smallwood2000) #5

Huh sorry wot do i do im a newbie with no experiance im only just starting to script


(smallwood2000) #6

Thank you very much have now got a working map but a new error occors ingame, the pole does not show up on the axis radder or limbo and the game crashes when the allies take the flag saying could not find blue spawn


(smallwood2000) #7
game_manager
{
spawn
{
wait 150 //Let the game rest for a sec.

wm_axis_respawntime 16
wm_allied_respawntime 16
wm_set_round_timelimit 20
}
{
	spawn
	{
		wait 50				// Wait for all entities to spawn
		setautospawn "Forward Spawn"	0	// Set Axis to forward spawn
	}
}

// ============================================================================
// Forward Spawn point - Initially owned by Axis
//
// ============================================================================
forwardspawn1_flag
{
	spawn
	{
		accum 0 set 0			// Who owns flag: 0-Axis, 1-Allied
	}

	trigger axis_capture				// Touched by an Axis player
	{
		accum 0 abort_if_equal 0 		// do Axis own flag?

		accum 0 set 0 			// Axis own the flag
		wm_announce "Axis reclaim the Forward Spawn!"

		alertentity forwardspawn1_wobj		// Switch command map marker
		setautospawn "Forward Spawn"	0	// Set Axis to forward spawn
	}

	trigger allied_capture				// Touched by an allied player
	{
		accum 0 abort_if_equal 1 		// do Allies own flag?

		accum 0 set 1 			// Allied own the flag
		wm_announce "Allies capture the Forward Spawn!"

		alertentity forwardspawn1_wobj		// Switch command map marker
		setautospawn "Forward Spawn"	1	// Set Allies to forward spawn
	}

	trigger force_allied
	{
		accum 0 abort_if_equal 1 		// Do Allies own the flag?
		alertentity forwardspawn1_wobj		// Switch command map marker
		alertentity forwardspawn1_spawns		// Switch all spawnpoints
		setautospawn "Forward Spawn"	1	// Set Allies to forward spawn
	}
	trigger kill
	{
		remove				// Remove self (flag model)
	}
}

dynamiteobj1
{
	spawn
	{
		wait 100				// Wait for all entities to spawn
		constructible_class 3			// Dynamite only
	}

	death
	{
		trigger forwardspawn1_flag force_allied 	// Switch forward spawn to Allied ONLY
		trigger forwardspawn1_flag kill		// Remove entities
		setstate forwardspawn1_base invisible	// Remove base of flag

		wm_announce "Allies have destroyed the Dynamite Objective 1"
	}
}
fence
{
spawn
{
wait 200
constructible_class 2 //Satchel-able objective.
constructible_constructxpbonus 1
}

built final
{
setstate fence default
setstate fence_materials invisible
}

decayed final
{
setstate fence invisible
setstate fence_materials default
}

buildstart final //I'm not sure if this is necessary.
{
setstate fence underconstruction //Include it anyway.
setstate fence_materials default
}

death
{
setstate fence_materials default
wm_announce "The Fence has been destroyed!"
}
}
]


(smallwood2000) #8

the error line says

g_scripting:setautospawn couldn’t find target (this is when the allies take the flag the game crashes well map does)


(Ifurita) #9

g_scripting:setautospawn couldn’t find target = you set an autospawn (e.g., Forward Spawn) that does not exist. What is the description key of your forward spawn TWO?


(SCDS_reyalP) #10

Again, proper indentation would help you out:


game_manager
{
	spawn
	{
		wait 150 //Let the game rest for a sec.

		wm_axis_respawntime 16
		wm_allied_respawntime 16
		wm_set_round_timelimit 20
	}
	{
		spawn
		{
			wait 50				// Wait for all entities to spawn
			setautospawn "Forward Spawn"	0	// Set Axis to forward spawn
		}
	}

I’m rather surprised the game accepted that at all, but it clearly isn’t right. You should only have ‘spawn’ function per script, and the extra braces are bound to cause problems.

Formatting code isn’t just some nitpicking obsession, it is essentially to keeping track of wtf is going on.

If the above code is simply a mispaste, then ignore me and read iffys post :moo:


(smallwood2000) #11
g_scripting:setautospawn couldn't find target = you set an autospawn (e.g., Forward Spawn) that does not exist. What is the description key of your forward spawn TWO?

Sorry dont understand dat well im a newbie at this , i have a small map as describe above

the spawn area is 3 bluespawns with the following entitles

classname team_CTF_bluespawn
targetname forwardspawn1_spawns

3 redspawns with the following entitles

targetname forwardspawn1_spawns
classname team_CTF_redspawn

1 team wolf checkpoint with the following entitles

HAVE CLICKED SPAWNPOINT

classname team_WOLF_checkpoint
spawnflags 1
scriptname forwardspawn1_flag
targetname forwardspawn1_flag
target forwardspawn1_spawns
angle 90

I also have 1 team wolf objective next to it with the following entitles

HAVE CLICKED DEFAULT ALLIES

description forward spawn
spawnflags 2
targetname forwardspawn1_wobj
scriptname forwardspawn1_wobj
classname team_WOLF_objective

My default spwanpoints of each color have the following entitles

HAVE CLICKED STARTACTIVE AND INVULNERABLE

classname team_CTF_bluespawn
spawnflags 3

same with the redspawn area

is there any thing up or i need to add my script is posted futher up

thanx 4 all the help already

error line G_scripting:setautospawn, couldn’t find target


(smallwood2000) #12

Changed beginning of script to

game_manager
{
spawn
{
wait 150 //Let the game rest for a sec.
setautospawn "Forward Spawn"	0	// Set Axis to forward spawn

wm_axis_respawntime 16
wm_allied_respawntime 16
wm_set_round_timelimit 20
}

// ============================================================================
// Forward Spawn point - Initially owned by Axis
//
// ============================================================================
forwardspawn1_flag
{
	spawn
	{

and got the following error message
G_script_scriptphase(),error (line 108: ‘}’ expected end of script found


so i added a extra } at the end of my script so it looks like so


death
{
setstate fence_materials default
wm_announce “The Fence has been destroyed!”
}
}
}


and now the following comes up when i try to play 


G_script_scriptphase (), Error (line 16): unknown event : forwardspawn1_flag



I think i nearly have it but it is so confusing can anbody help plz below is line 16


// ============================================================================
forwardspawn1_flag
{
spawn
{
accum 0 set 0 // Who owns flag: 0-Axis, 1-Allied
}

trigger axis_capture				// Touched by an Axis player
{
	accum 0 abort_if_equal 0 		// do Axis own flag?

	accum 0 set 0 			// Axis own the flag
	wm_announce "Axis reclaim the Forward Spawn!"

	alertentity forwardspawn1_wobj		// Switch command map marker
	setautospawn "Forward Spawn"	0	// Set Axis to forward spawn
}


	trigger allied_capture				// Touched by an allied player

(TFate) #13

No no no. You’re not supposed to add the “}” at the very end of the script. You need to add it after the game manager section, like so.


game_manager
{
     spawn
     {
          wait 150 //Let the game rest for a sec.
          setautospawn "Forward Spawn"   0   // Set Axis to forward spawn

          wm_axis_respawntime 16
          wm_allied_respawntime 16
          wm_set_round_timelimit 20
     } 
} 


(smallwood2000) #14

cheers for all d help

Amended my script so the beginning it reads


game_manager
{
spawn
{
wait 150 //Let the game rest for a sec.
setautospawn "Forward Spawn"	0	// Set Axis to forward spawn

wm_axis_respawntime 16
wm_allied_respawntime 16
wm_set_round_timelimit 20
}
}

i amended the end aswell now get get the error message

G_scripting : setautospawn couldn’t find target

thnx again 4 helping


(TFate) #15

I think that description is case-sentitive, and if you gave your information correctly then you forgot to capitalize the value “Forward Spawn” for your team_WOLF_objective.


(smallwood2000) #16

THANK YOU so much im so nearly there for making my first map thnx to you guys

cheers tfate

i will go over this thread + map and my script and post a tutorial with apropiate thnx

once again i thank u all


(smallwood2000) #17

Have now sorted out tutorial i will add a futher tuorial on how to mix to objectives on script later

cheers again for all the help


(smallwood2000) #18

Have now sorted out tutorial i will add a futher tuorial on how to mix to objectives on script later

cheers again for all the help

sorry for all the irrating questions im still a newbie