PDA

View Full Version : Line 113 "}" expected, end of script found


TNR360
28th April 2007, 19:15
game_manager
{

// Game rules
wm_axis_respawntime 20
wm_allied_respawntime 25
wm_number_of_objectives 4
wm_set_round_timelimit 35

// Objectives
// 1: Use the first tank to get to the river.
// 2: Use the second tank to get to the river.
// 3: Capture the small town square.
// 4: Capture the North side of the town.

// Current main objectives for each team (0=Axis, 1=Allies)
wm_set_main_objective 1 0
wm_set_main_objective 1 1

wm_objective_status 1 0 0
wm_objective_status 1 1 0
wm_objective_status 2 0 0
wm_objective_status 2 1 0
wm_objective_status 3 0 0
wm_objective_status 3 1 0
wm_objective_status 4 0 0
wm_objective_status 4 1 0

wm_set_main_objective 1 0
wm_set_main_objective 1 1

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

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

wait 500
setautospawn "Square" 0
setautospawn "Square" 1
*---------------------------------------------------------------------------------*

square_flag
{
spawn
{
accum 0 set 1 // Who has the flag: 0-Axis, 1-Allied
}

trigger axis_capture // Flag has been touched by an Axis player
{
accum 0 abort_if_equal 0 // do Axis own flag?

accum 0 set 0 // Axis own the pole

wm_announce "Axis have taken the town square!"
// *----------------------------------- vo------------------------------------------*
wm_teamvoiceannounce 0 "Ramelle_axis_square_captured"

wm_teamvoiceannounce 1 "Ramelle_allies_square_captured"

// *---------------------------------------------------------------------------------*

wm_objective_status 3 0 1
wm_objective_status 3 1 2
wm_set_main_objective 2 0
wm_set_main_objective 2 1
alertentity square_wobj

}

trigger allied_capture // Flag has been 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 retaken the square!"

wm_objective_status 3 0 2
wm_objective_status 3 1 1
wm_set_main_objective 1 0
wm_set_main_objective 1 1
alertentity square_wobj

}

trigger force_axis
}
{
accum 0 abort_if_equal 0 // Do Axis own the flag?

alertentity square_wobj
alertentity square_flag
}
}
what seems to be wrong here?

alex82
28th April 2007, 19:50
trigger force_axis
}


good:

trigger force_axis


if i have right

murka10
28th April 2007, 20:00
many problems, and the things in game manager needs to be in "spawn"

TNR360
28th April 2007, 20:06
many problems, and the things in game manager needs to be in "spawn"

uh didnt quite get you there :? :shock:

kamikazee
28th April 2007, 20:15
There are a lot of errors in your code. Because I'm such a nice guy, I'll try to fix and clean it up quickly instead of wasting time picking on them one by one.
game_manager
{
spawn {
// Game rules
wm_axis_respawntime 20
wm_allied_respawntime 25
wm_number_of_objectives 4
wm_set_round_timelimit 35

// Objectives
// 1: Use the first tank to get to the river.
// 2: Use the second tank to get to the river.
// 3: Capture the small town square.
// 4: Capture the North side of the town.

// Current main objectives for each team (0=Axis, 1=Allies)
wm_set_main_objective 1 0
wm_set_main_objective 1 1

wm_objective_status 1 0 0
wm_objective_status 1 1 0
wm_objective_status 2 0 0
wm_objective_status 2 1 0
wm_objective_status 3 0 0
wm_objective_status 3 1 0
wm_objective_status 4 0 0
wm_objective_status 4 1 0

wm_set_main_objective 1 0
wm_set_main_objective 1 1

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

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

wait 500
setautospawn "Square" 0
setautospawn "Square" 1
}
}


square_flag
{
spawn {
accum 0 set 1 // Who has the flag: 0-Axis, 1-Allied
}

trigger axis_capture {
// Flag has been touched by an Axis player
accum 0 abort_if_equal 0 // did Axis own flag?

accum 0 set 0 // Axis own the pole

wm_announce "Axis have taken the town square!"
// vo
wm_teamvoiceannounce 0 "Ramelle_axis_square_captured"

wm_teamvoiceannounce 1 "Ramelle_allies_square_captured"

wm_objective_status 3 0 1
wm_objective_status 3 1 2
wm_set_main_objective 2 0
wm_set_main_objective 2 1
alertentity square_wobj
}

trigger allied_capture {
// Flag has been 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 retaken the square!"

wm_objective_status 3 0 2
wm_objective_status 3 1 1
wm_set_main_objective 1 0
wm_set_main_objective 1 1
alertentity square_wobj
}
trigger force_axis {
accum 0 abort_if_equal 0 // Did Axis own the flag?

alertentity square_wobj
alertentity square_flag
}
}
There, at least this looks like valid code. However, I can't guarantee it will actually work.

TNR360
28th April 2007, 20:16
There are a lot of errors in your code. Because I'm such a nice guy, I'll try to fix and clean it up quickly instead of wasting time picking on them one by one.

There, at least this looks like valid code. However, I can't guarantee it will actually work.

Thanks I'll try it out :D

hey Im still trying to learn this

cant wait till I have to get a tank going :roll:

kamikazee
28th April 2007, 20:18
A tank is not necessarily hard to script, it is just a matter of keeping the oversight in the setup and massive code. (Which is mostly the same step over and over again.)

If ET:QW features a script like DoomScript, we could save quite some lines of code.

Flippy
28th April 2007, 20:23
Ill try to comment on a few of your errors... how else are you going to learn? :)

First of all, you don't seem to understand that for each opening bracket { there should be a closing bracket } .

A script is usually build like this:

my_scriptname
{ // opening bracket, opens the script for 'my_scriptname'
event // events are for example "spawn" "death" or triggers
{ // another opening bracket, opens the event
// your code goes here
} // closing bracket that closes the event

trigger my_trigger // another event (optional obviously)
{
//code
}
} // final closing bracket that closes 'my_scriptname'


Using the indentation (tabs) it's easy to see where a part of script (bracket) is opened and closed.
Always double and triple check if every opening bracket has it's closing bracket. It can be a pain in the ass to find a missing bracket in a long code...

EDIT
I just looked at kamikazee's code and this might confuse you...
since i use the following format:
my_scriptname
{
...
}


And he uses:
my_scriptname {
...
}


Just to clarify, this is exactly the same :P I just added an enter before the first { because i can read it more easily like that :) You can use both, whatever floats your boat...

TNR360
28th April 2007, 20:23
:D it works yay

thanks