Help im newbie


(Gekkegast) #1

Im building my own map. But the last days i got the error:
g_script_scriptparse (), error (line79):’}’ expected end of script
Ive readed a lot of topics but noting helps:s here is my script:

game_manager
{
spawn
{
wait 300

  // Set scenario information  
  wm_setwinner 0 

// Accum #1 will be the state of objective number one
accum 1 set 0
accum 2 set 0
accum 3 set 0
accum 4 set 0
}

{

spawn
}
{

accum 0 set 2 // Who owns flag: 0-Axis, 1-Allied, 2-Nobody

}

trigger axis_capture // Touched by an Axis player

{

accum 0 abort_if_equal 0 // do Axis own flag?

accum 0 trigger_if_equal 1 forward_flag axis_reclaim // Reclaimed from Allies

accum 0 set 0 // Axis own the flag

wm_announce “Axis have captured the Forward Flag!”

}

trigger axis_reclaim

{

alertentity forward_wobj // Switch command map marker

}

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 have captured the Forward Flag!”

setstate forward_wobj default

alertentity forward_wobj // Switch command map marker

}
{
spawn
}
{
wait 200

constructible_class 3 // = 3 - dyno blow only / 2 - setchel and dyno blow
}
{
death
}
{
wm_announce “The gate”
}

Thx for every reply


(nUllSkillZ) #2

The script doesn’t make sense in it’s current state.

There’s a good scripting tutorial on Ifurita’s homepage.

What do you want to have as functionality in your map?

Basically scriptblocks start with the entity scriptname:


ENTITY_SCRIPTNAME
{
}

Then there should be a spawn event and there can be other event’s:


ENTITY_SCRIPTAME
{
	spawn
	{
		// ACTIONS THAT ARE DONE AT SPAWN OF THE ENTITY
	}

	EVENT1
	{
		// ACTIONS
	}
}

Within the event-scriptblocks there can be several actions.
There have to be an even No. of opening and closing brackets.

A script must have only one “game_manager” scriptblock.
But can have as many scriptblocks as desired/needed (for the mapentities).

chruker has an event + action list on his homepage.

Please use code tag’s [ code ]CODE GOES HERE[ /code ] (without the spaces) for posting code.
And use a better title for your post.
A last remark:
Try to format your code (I use tabs).
So it’s more visual.


(d3coy) #3

yea, your script is missing alot of info… look in pak0.pk3 located in your etmain… open this file with winrar and look in the maps folder for the scripts of the stock maps. they are lable by the map_name.map

Might help you understand some about how a script works… also check the tutorials.


(nUllSkillZ) #4

Should have posted the links, sorry:
Map Scripting 4 Newbies (a PDF file by Ifurita)
Scripting Reference (by chruker)

More tutorials @ Ifurita’s homepage:
Mapping 4 Newbies