G_Script_ScriptParse


(Boleth) #1

Another one of these questions Im afraid, Ive used the search function and used the information on thosetopics to try to sort out my problem but it doesnt seem to want to be an easy problem to solve. nothing so simple as a missing “}”.

G_Script_ScriptParse(), Error (Line 106): “}” expected, end of script found.

Ive tried various things and tried removing and adding certain “{” and “}” but everything Ive tried hasnt worked.
Heres my code.

game_manager

	spawn
{
		wm_axis_respawntime 10
		wm_allies_respawntime 10
		wm_set_round_timelimit 10
		wm_number_of_objectives 1
		wm_set_main_objective 1 -1
		
		accum 1 set -1
		accum 2 set 30
		accum 3 set 30
		accum 4 set 1
}
	
trigger axis_capture_gm
{
		wm_set_main_objective 1 0
		trigger game_manager obj_captured
		accum 1 set 0
		wm_announce "Axis capture the objective!"
}				

trigger allies_capture_gm
{
		wm_set_main_objective		1	1	
		trigger game_manager obj_captured
		accum 1 set 1 //mirrors the state of the the objective
		wm_announce "Allies capture the objective!"
}

trigger obj_captured
{
        accum 4 set 1
		alertentity holdtimer_relay
		accum 1 abort_if_equal -1
		alertentity holdtimer_relay 
}

trigger clear_skip_flag
{
		accum 4 set 0
}

trigger timer_axis
{
		accum 1 abort_if_not_equal 0 
		accum 4 abort_if_equal 1 
		accum 2 inc -1
		trigger game_manager axis_time_2
		trigger game_manager axis_time_1min30
		trigger game_manager axis_time_1min
		trigger game_manager axis_time_30sec
		trigger game_manager axis_time_10sec
		alertentity axis_speaker_relay 
		accum 2 abort_if_not_equal 0
		wm_setwinner 0
		wm_endround
}

trigger timer_allies
{
		accum 1 abort_if_not_equal 1 
		accum 4 abort_if_equal 1 
		accum 3 inc -1
		trigger game_manager allies_time_2min
		trigger game_manager allies_time_1min30
		trigger game_manager allies_time_1min
		trigger game_manager allies_time_30sec
		trigger game_manager allies_time_10sec
		alertentity allies_speaker_relay 
		accum 3 abort_if_not_equal 0
		wm_setwinner 1
		wm_endround
}

mainflag

{
		trigger axis_capture
}

{
		trigger game_manager axis_capture_gm
}

{
		trigger allied_capture
}

{
		trigger game_manager allies_capture_gm
}

holdtimer_event_handler
{
		trigger holdtimer_event
}
{
    	trigger game_manager timer_allies
		trigger game_manager timer_axis
		trigger game_manager clear_skip_flag
}

Im pretty sure its some sort of missing “{” or, more likely “}” but as I said Ive tried various things but nothing Ive tried seems to work. There are an Equal number of { and } I just counted them.
It always says Im missing a “}” on the last but one line of code.

Ive also tried deleting the “block” of script but it still tells me its expecting “}” in the last but one line.


(Malverik) #2

try this one


game_manager 
{
   spawn 
   { 
      wm_axis_respawntime 10 
      wm_allies_respawntime 10 
      wm_set_round_timelimit 10 
      wm_number_of_objectives 1 
      wm_set_main_objective 1 -1 
       
      accum 1 set -1 
      accum 2 set 30 
      accum 3 set 30 
      accum 4 set 1 
   } 
    
   trigger axis_capture_gm 
   { 
      wm_set_main_objective 1 0 
      trigger game_manager obj_captured 
      accum 1 set 0 
      wm_announce "Axis capture the objective!" 
   }             

   trigger allies_capture_gm 
   { 
      wm_set_main_objective      1   1    
      trigger game_manager obj_captured 
      accum 1 set 1 //mirrors the state of the the objective 
      wm_announce "Allies capture the objective!" 
   } 

   trigger obj_captured 
   { 
      accum 4 set 1 
      alertentity holdtimer_relay 
      accum 1 abort_if_equal -1 
      alertentity holdtimer_relay 
   } 

   trigger clear_skip_flag 
   { 
      accum 4 set 0 
   } 

   trigger timer_axis 
   { 
      accum 1 abort_if_not_equal 0 
      accum 4 abort_if_equal 1 
      accum 2 inc -1 
      trigger game_manager axis_time_2 
      trigger game_manager axis_time_1min30 
      trigger game_manager axis_time_1min 
      trigger game_manager axis_time_30sec 
      trigger game_manager axis_time_10sec 
      alertentity axis_speaker_relay 
      accum 2 abort_if_not_equal 0 
      wm_setwinner 0 
      wm_endround 
   } 

   trigger timer_allies 
   { 
      accum 1 abort_if_not_equal 1 
      accum 4 abort_if_equal 1 
      accum 3 inc -1 
      trigger game_manager allies_time_2min 
      trigger game_manager allies_time_1min30 
      trigger game_manager allies_time_1min 
      trigger game_manager allies_time_30sec 
      trigger game_manager allies_time_10sec 
      alertentity allies_speaker_relay 
      accum 3 abort_if_not_equal 0 
      wm_setwinner 1 
      wm_endround 
   } 
}


mainflag 
{ 
   trigger axis_capture 
   {
      trigger game_manager axis_capture_gm 
   } 

   trigger allied_capture 
   { 
      trigger game_manager allies_capture_gm 
   } 
}


holdtimer_event_handler 
{ 
   trigger holdtimer_event  
   { 
      trigger game_manager timer_allies 
      trigger game_manager timer_axis 
      trigger game_manager clear_skip_flag 
   }
}


(Boleth) #3

lol If I knew you irl I would kiss you!!
Thanks man
I dont quite understand scripting yet (as Im sure you can tell).
Thanks =D


(Boleth) #4

Hmmm the script doesnt do a thing.
lol
Not a single damn thing.
Ahh
Tired need rest. work more tomorrow.


(Ifurita) #5

do you have a script_multiplayer entity in your map with the key-pair scriptname=game_manager

?


(Boleth) #6

ah ha
I have the entity but I didnt give it any keys.
Thanks I’ll do that now.

edit Didnt even have the entity.
Thanks Ifurita :smiley:


(Boleth) #7

Hmmm
now its saying

G_Script_ScriptParse(), Error (line 5):unknown action: wm_allies_respawntime

everytime I try to open the map. Its also saying the error is on line 5 but the line it gives (wm_allies_respawntime) is on line 6.


(Loffy) #8

Hi!
I think the correct script is: wm_allied_respawntime (with the letter “d”).
:slight_smile:
I’ve done the same kind of misstakes many timse.
// Loffy


(nUllSkillZ) #9

Here you will find a (almost) complete list with events and actions:
http://www.splashdamage.com/index.php?name=pnPHPbb2&file=viewtopic&t=9788&highlight=actions+events


(Boleth) #10

ahh thanks
:smiley:


(Boleth) #11

Hmmm
A problem with the alertentity it cannot find the “holdtimer_relay”
Dammit I wish I could just write this myself.
holdtimer_relay Im guessing is a variable of some sort.
I’ll take a look through the forums for it.

edit Im guessing its a targetname of something, argh.
When I ran the map it crashed as soon as I grabbed the flag.
then came back with

G_Scripting: alertentity cannot find targetname “holdtimer_relay”

Ive looked through the original .map file but I cant find anything called “holdtimer_relay”
any suggestions?

editIve found several speaker relays. but no holdtimer_relay


(nUllSkillZ) #12

“holdtimer_relay” must be the value of the targetname-key of one of your entities.

Edit:

If you have copied the script and you don’t have such an entity.
Don’t bother just comment the line out.


(Boleth) #13

Ok I’ll give that a go now


(Boleth) #14

OMG!!!
It works!
After 6+ months of work my piddly little map actually works!!!
Weee
Anyone interested in testing it out for me? Need feedback.
I havent added the speaker entitys yet so theres no “Allies have capture the flag” or anything I’ll do that for the Beta.
Wow, my first map release exciting