Scripting Issues


(StormShadow) #1

My two objectives are tanks. So for each objective, ive created 2 tank models, one built, one destroyed, and 2 sets of clip brushes for each tank, one to go with each stage of the tank, and labeled as such. I have named the non-damaged tanks (the one that appears at game start) northtank and southtank respectively. I have also named the portion of my script that determines the status of the tanks northank and southtank respectively. Here is the code for my northtank script:


// North Tank
northtank
{
	spawn
	{
		wait 200

		constructible_class 3

		trigger northtank setup
	}

	trigger setup
	{
		setstate northtank_smoke invisible
		setstate northtank_destroyed invisible
		setstate northtank_destroyed invisible

		setstate northtank default
	}

	death
	{
		setstate northtank_smoke default
		setstate northtank_destroyed default
		setstate northtank_destroyed default

		setstate northtank invisible

		wm_announce "Allies have destroyed the North Tank!"

		wm_objective_status 		1 0 2
		wm_objective_status 		1 1 1

		wm_set_main_objective	2 0
		wm_set_main_objective	2 1

		trigger game_manager tankcounter

		trigger end_boom_north northtank_destroyed
	}
}

Now when i try to load the map in ET, it tells me: unknown event, line 173: northtank - or something very similar to it.

Is there something wrong with my script? Is there something wrong with my entities?

I will PAY someone to script this damn map for me! And i mean it.

This is very frustrating to me - im extremely inexperienced with coding, scripting, etc… hell, i can barely write html :slight_smile: My map has been sitting in a near-finished state on my hd for the longest time. Im determined to finish it, but every time i think im close, i get errors, or problems.
:banghead: :banghead:

Anyway, thanks in advance for any help you can give me.


(SiliconSlick) #2

Post the complete script and the exact error and you’ll
have more luck… there are obviously not 173 lines in
the above so there is no telling where the error is.

SiliconSlick


(Mean Mr. Mustard) #3

Are the tanks (northtank and southtank) func_constructibles?

I believe the ‘death’ routine is only available for func_constructible and func_explosive. And the death routine is called when the func_constructible is destroyed (by dynamite in your case --> constructible_class 3)

I’m guessing they are not func_constructible/func_explosive and ET is complaining about the ‘death’ routine.


(StormShadow) #4

line 173 is the 2nd line in my script (northtank)

i dont wanna paste a 250+ line script in here :smiley:

no, the tanks arent constructible… but i copy/pasted most of this portion of the script from the pak gun scripts on oasis… and they have ‘death’ section of their scripts, and arent constructibles.


(chavo_one) #5

What kind of entity is northtank?

In oasis, the pak75_clip_2 (which you have copied this code from) is a func_explosive. It then toggles the models pak75_model_2 and pak75_model_broken_2 (seperate misc_gamemodel entities) off and on.


(StormShadow) #6

northtank is a series of clipbrushes set as a func_explosive


(Drakir) #7

Cant say for sure, but to be able to set the constructible class i belive it needs to have an trigger_objective_info targeting the func_explosive.


(chavo_one) #8

One thing I see, is you are calling setstate on northtank from inside the northtank’s script. That’s not necessary. When northtank’s death function is called, that means it is already invisible. When northtank’s setup function is called, northtank is already visible.

Also, how are you toggling the tank and damaged tank models on and off. In oasis, the models are misc_gamemodels toggled by setstate. You don’t seem to be doing that. I assume you have attached a model2 to your clipbrushes.

Just some thoughts to play around with.


(StormShadow) #9

ya, i got that

ok chavo, ill mess around with that stuff a bit, thanks


(StormShadow) #10

I have made a test map with 3 objectives, an upperwall, southtank and northtank. I have dramatically simplified all 3 in an attempt to slowly walk through every step and see where i have gone wrong. But even this script wont work!


game_manager
{
	spawn
	{

		accum 1 set 0		
		accum 5 set 0		
		accum 6 set 0		
		accum 7 set 0		

		globalaccum 5 set 0
		globalaccum 6 set 0

		wm_axis_respawntime	30
		wm_allied_respawntime	20
		wm_number_of_objectives 3
		wm_set_round_timelimit	30

		wm_set_main_objective		2	0
		wm_set_main_objective		2	1

		wm_objective_status 1 1 0
		wm_objective_status 1 0 0
		wm_objective_status 2 1 0
		wm_objective_status 2 0 0
		wm_objective_status 3 1 0
		wm_objective_status 3 0 0
	}

	trigger tank_counter
	{
		accum 5 inc 1				
		accum 5 abort_if_not_equal 2		

		wm_announce	"Allies have destroyed both tanks!"

		wait 8000

		accum 1 set 1				
}

upperwall
{
	spawn
	{
		wait 100
		constructible_class 3
	}

	death
	{
		wm_announce "The Upper Wall has been destroyed!"
	}
}

southtank
{
	spawn
	{
		wait 200
		constructible_class 3
	}

	death
	{
		setstate southtank invisible

		wm_announce "The South Tank has been destroyed!"

		wm_objective_status 		2 0 2
		wm_objective_status 		2 1 1

		trigger game_manager tank_counter
	}
}

northtank
{
	spawn
	{
		wait 200
		constructible_class 3
	}

	death
	{
		setstate northtank invisible

		wm_announce "The North Tank has been destroyed!"


		wm_objective_status 		1 0 2
		wm_objective_status 		1 1 1

		wm_set_main_objective	2 0
		wm_set_main_objective	2 1

		trigger game_manager tank_counter
	}
}

It gives me unknown event: upperwall

In the game, i have a group of brushes set as func_explosive. There is info_wolf_objective targetting them(target; upperwall). The targetname of the group is upperwall.

This is killing me. I cant even get a simple script to work.

Someone shoot me.


(Drakir) #11

It gives me unknown event: upperwall

In the game, i have a group of brushes set as func_explosive. There is info_wolf_objective targetting them(target; upperwall). The targetname of the group is upperwall.

info_wolf_objective? I hope u mean a trigger_objective_info!


(chavo_one) #12

Have you also set the scriptname to upperwall as well?


(Mean Mr. Mustard) #13

You are missing a ‘}’ for ‘trigger tank_counter’

game_manager 
{ 
   spawn 
   { 

      accum 1 set 0       
      accum 5 set 0       
      accum 6 set 0       
      accum 7 set 0       

      globalaccum 5 set 0 
      globalaccum 6 set 0 

      wm_axis_respawntime   30 
      wm_allied_respawntime   20 
      wm_number_of_objectives 3 
      wm_set_round_timelimit   30 

      wm_set_main_objective      2   0 
      wm_set_main_objective      2   1 

      wm_objective_status 1 1 0 
      wm_objective_status 1 0 0 
      wm_objective_status 2 1 0 
      wm_objective_status 2 0 0 
      wm_objective_status 3 1 0 
      wm_objective_status 3 0 0 
   } 

   trigger tank_counter 
   { 
      accum 5 inc 1             
      accum 5 abort_if_not_equal 2       

      wm_announce   "Allies have destroyed both tanks!" 

      wait 8000 

      accum 1 set 1    
   }   // missing close bracket inserted here!!         
} 


(Wils) #14

^ what he said :slight_smile:

You’re trying to define the function for northtank/upperwall inside the game_manager function. Shove that curly bracket in and all should be well.


(StormShadow) #15

and i bet that was what was wrong with my first script too…

its always so minor… one little missed charachter ruins my entire script… :angry:

Ok, ill stop complaining now :slight_smile: Thanks for the help!