Scripting problems...


(mizar) #1

Try to do some scripting, but…

Two objects in the map, one func_explosive (axisgenerator), one trigger_hurt (securedoor_th) and two speakers. The idea is, that with the demolition of the func_explosive, the trigger_hurt will be disabled. The func_explosive is working fine, however, the script is not fully working! The generator blows up fine, the wm_announce is playing, but nothing else… Sound will not be disabled and the trigger_hurt-part is also missing!

axisgenerator
{
spawn
{
wait 200
constructible_class 3
constructible_destructxpbonus 30
}

death
{

disablespeaker generator_sound
wm_announce "Power generator destroyed!"

wait 100
trigger securedoor_th powerdown

wait 500
remove

}	

}

securedoor_th
{
spawn
{
wait 100
enablespeaker securedoor_sound
}
trigger powerdown
{
wait 100
setstate securedoor_th invisible

	disablespeaker securedoor_sound

	wm_announce "Power is down!"
	wait 500

	remove
	}
}

Any help?
-Mizar


(heeen) #2

be sure all your entities have targetnames and scriptnames


(flashkillaman) #3

how to make a .script file?
where to place it to test map?


(seven_dc) #4

@ flashkillaman

=> You create scripts by any text editor (notepad in windows) and name it like mapname.script ex. My map name is sandheli so my script would be sandheli.script and place it in your maps directory.

I have a similiar problem. I have trigger hurt that is supposed to be appear (activate) when construction is finished and deactive when it is destoyed. Now the trigger is always on. No change at all. I checked out the goldrush map and there were a road barrier that worked similiar. It had the same parameters and were activated same way in the script but the goldrush works mine ain’t.

Here is screenie on my trigger entity.

And my script:


defense2
{
	spawn
	{
		wait 400
		trigger defense2 setup

		constructible_class 3
	}

	trigger setup
	{

		setstate defense2_materials default
		setstate defense2_materials_clip default
		setstate defense2_flag default

		setstate defense2_teeth invisible
		setstate defense2_hurt invisible
	}

	buildstart final
	{
		setstate defense2_materials default
		setstate defense2_materials_clip default
		setstate defense2_flag default

		setstate defense2_teeth underconstruction
		setstate defense2_hurt underconstruction
	}

	built final
	{
		setstate defense2_materials invisible
		setstate defense2_materials_clip invisible
		setstate defense2_flag invisible


		setstate defense2_teeth default
		setstate defense2_hurt default
		

		wm_announce "North Barrier has been constructed."
		
	}

	decayed final
	{
		setstate defense2_materials default
		setstate defense2_materials_clip default
		setstate defense2_flag default


		setstate defense2_teeth invisible
		setstate defense2_hurt invisible
	}

	death
	{
		setstate defense2_materials default
		setstate defense2_materials_clip default
		setstate defense2_flag default


		setstate defense2_teeth invisible
		setstate defense2_hurt invisible


		wm_announce "North Barrier has been destroyed."

		
	}	
}

What I am doing wrong? Can someone help me?
Is there another way to disable the trigger_hurt?


N Platform


(chavo_one) #5

You need to decide if you would rather speak British English or American English because that appears to be your problem.

The targetname/scriptname of your hurt brush is “defence2_hurt”, yet in the script you refer to it as “defense2_hurt”.


(flashkillaman) #6

how to make it .script?
and where do i need to place it if i want to test my map i cant test it now?


(seven_dc) #7

Million thanks to you chavo_one! You are a life saver! It is getting late and typos do occur when you are sleepy. I am getting my map ready for beta soon.

@ flashkillaman

=> You need to rename it from yourmapname.txt -> yourname.script or you can just save it by writing the filename in quatation marks like “yourname.script”. BTW you do not need to have script file to test your map if it does not have any objectives/functionalities ready.

I have another problem that I haven’t solved yeat. When I create pk3 file and test it on clean install of enemy territory all the misc_models have “the orange grid of death” skins?!?


Cheap u s wwii pineapple grenade inert


(chavo_one) #8

Are they models that were only included with the SDK? If you are using models and textures from the SDK (ie. not used by the actual maps) you will need to bundle it into your .pk3.

An example is the snow jagdpanther. No official maps used the snow jagdpanther, so if you wanted to use it you would have to include it in your pk3.


(flashkillaman) #9

it does awaiting challange…0 again