Problems with my Trigger Code door


(Soap958) #1

Hey guys, a friend and me are gonna make a map but we want a secret room in it with a code door so u see like 6 numbers and you have to press 4 combo or 3 combo and then the door will go open and close in 5 sec again. I know it’s possible maybe some of you remember the map CodFrag there was a code door in it, i tried to copy the script but it did give errors.

game_manager
{
	spawn
	{
		wm_axis_respawntime 8
		wm_allied_respawntime 8
		accum 0 set 0
		accum 1 set 0
	}

	trigger inc
	{
		accum 0 inc 1
		accum 0 abort_if_not_equal 4
		accum 1 abort_if_equal 3
		alertentity lock_sound
		wait 500
		wm_announce "reset"
		accum 0 set 0
		accum 1 set 0
	}
	
	trigger b3_activate
	{
		accum 0 abort_if_not_equal 1
		accum 1 inc 1
	}

	trigger b6_activate
	{
		accum 0 abort_if_not_equal 2
		accum 1 inc 1
	}

	trigger b1_activate
	{
		accum 0 abort_if_not_equal 3
		accum 1 inc 1
		accum 1 abort_if_not_equal 3
		alertentity unlock_sound
		wm_announce "OK !"
		wait 1000
		alertentity door_code
		accum 0 set 0
		accum 1 set 0
		wait 150
		wm_announce "reset"
	}
}

button
{
	trigger b1_activate
	{
		alertentity button_sound
		wm_announce "*"
                wait 50
		trigger button b1
                
	}

	trigger b2_activate
	{
		alertentity button_sound
		wm_announce "*"
		trigger button b2
		
	}

	trigger b3_activate
	{
		alertentity button_sound
		wm_announce "*"
                wait 50
		trigger button b3
	}

	trigger b4_activate
	{
		alertentity button_sound
		wm_announce "*"
		trigger button b4
		
	}

	trigger b5_activate
	{
		alertentity button_sound
		wm_announce "*"
		trigger button b5
	}

	trigger b6_activate
	{
		alertentity button_sound
		wm_announce "*"
                wait 50
		trigger button b6
	}

I am kinda new to this so i give some info about the triggers and what i got in my map:

“classname” “func_invisible_user”
“target” “b1_activate”
“cursorhint” “hint_activate”
“targetname” "b1

Connected to:

“classname” “target_script_trigger”
“scriptname” “button”
“targetname” “b1_activate”
“origin” “866 1367 977”
“target” “b1_activate”

And so on with 2-6, maybe u know what i do wrong but if i got it like this it only says * * * * no reset and Entity used it self or something like that.

Hope u can help me.

Roel


(Zer0Cool) #2

here an working example

http://www.file-upload.net/download-2325094/pass.rar.html


(Soap958) #3

Hey i tried ur working map but it doesn’t work for me i changed something and dont know how to trigger the door in the script really but heres what i thought:

game_manager
{
	spawn
	{
	wait 200
	accum 0 set 1		//index of the password (1 is first digit of password)
	accum 1 set 0		//0 password is correct (so far), 1 password is wrong
	//pass 5928
	}
	
	trigger num1
	{
	trigger self num1x
	trigger self check 
	}
	
	trigger num2
	{
	trigger self num2x
	trigger self check 
	}
	
	trigger num3
	{
	trigger self num3x
	trigger self check 
	}
	
	trigger num4
	{
	trigger self num4x
	trigger self check 
	}
	
	trigger num5
	{
	trigger self num5x
	trigger self check 
	}
	
	trigger num6
	{
	trigger self num6x
	trigger self check 
	}
	
	trigger num7
	{
	trigger self num7x
	trigger self check 
	}
	
	trigger num8
	{
	trigger self num8x
	trigger self check 
	}
	
	trigger num9
	{
	trigger self num9x
	trigger self check 
	}
	
	trigger check
	{
	accum 0 inc 1				 // index is increased by 1 (next digit of password)
	accum 0 abort_if_less_than 5 // amount of digits of the pass +1 (5928 = 4, +1 = 5)
	accum 0 set 1				 // index set back to 1
	trigger self open			 // here you can open your door, or whatever you want to do
	accum 1 set 0				 // next password is set correct
	wm_announce "pass was resetted"
	}
	
	trigger open
	{
	accum 1 abort_if_equal 1	//just opens if password was correct
	wm_announce "door was opened"
	trigger button door_code
	}
	
	trigger num1x
	{
	//accum 0 abort_if_equal x
	accum 1 set 1
	}
	
	trigger num2x
	{
	accum 0 abort_if_equal 3  //3 is the index of the digit (index 3 must be a 2)
	accum 1 set 1
	}
	
	trigger num3x
	{
	//accum 0 abort_if_equal x
	accum 1 set 1
	}
	
	trigger num4x
	{
	//accum 0 abort_if_equal x
	accum 1 set 1
	}
	
	trigger num5x
	{
	accum 0 abort_if_equal 1  //1 is the index of the digit (index 1 must be a 5)
	accum 1 set 1
	}
	
	trigger num6x
	{
	//accum 0 abort_if_equal x
	accum 1 set 1
	}
	
	trigger num7x
	{
	//accum 0 abort_if_equal x
	accum 1 set 1
	}
	
	trigger num8x
	{
	accum 0 abort_if_equal 4  //4 is the index of the digit (index 4 must be a 8)
	accum 1 set 1
	}
	
	trigger num9x
	{
	accum 0 abort_if_equal 2  //2 is the index of the digit (index 2 must be a 9)
	accum 1 set 1
	}

}

assistant
{
	trigger num1
	{
	trigger game_manager num1
	}
	
	trigger num2
	{
	trigger game_manager num2
	}
	
	trigger num3
	{
	trigger game_manager num3
	}
	
	trigger num4
	{
	trigger game_manager num4
	}
	
	trigger num5
	{
	trigger game_manager num5
	}
	
	trigger num6
	{
	trigger game_manager num6
	}
	
	trigger num7
	{
	trigger game_manager num7
	}
	
	trigger num8
	{
	trigger game_manager num8
	}
	
	trigger num9
	{
	trigger game_manager num9
	}

	trigger door_code
	{
	trigger game_manager num9
	}
}

button
{


	trigger door_code
	{
		wm_announce "Door is open!!"
                wait 50
		trigger button door1
	}
}

and my door that should go open is this:

"script" "button"
"key" "-1"
"targetname" "door1"
"classname" "func_door_rotating"

And the button triggers are the same as in the map u gave to me in ur post.
Maybe u can check this out and say what is wrong with it: when i try it in my server it says The door is open! twice then pass reset.

thnx for reading


(Soap958) #4

Well i got another problem when i save my map and build a .bsp and make a .pk3 and i am testing it on my Etpub homehosted server it works fine when i send it to my friend and he puts it on ycn hosted server JAYMOD it gives the sv_brushmodel NULL error… even if he puts mine working bsp file in his etmain and start it it fails with same error…

Hope u can help.


(masterkiller) #5

hi

For the first post, try this:


button
{
	trigger b1_activate
	{
		alertentity button_sound
		wm_announce "*"
		trigger game_manager inc
		wait 50
		trigger game_manager b1_activate

	}

	trigger b2_activate
	{
		alertentity button_sound
		wm_announce "*"
		trigger game_manager inc
		wait 50
//		trigger game_manager b2_activate

	}

	trigger b3_activate
	{
		alertentity button_sound
		wm_announce "*"
		trigger game_manager inc
		wait 50
		trigger game_manager b3_activate

	}

	trigger b4_activate
	{
		alertentity button_sound
		wm_announce "*"
		trigger game_manager inc
		wait 50
//		trigger game_manager b4_activate

	}

	trigger b5_activate
	{
		alertentity button_sound
		wm_announce "*"
		trigger game_manager inc
		wait 50
//		trigger game_manager b5_activate

	}

	trigger b6_activate
	{
		alertentity button_sound
		wm_announce "*"
		trigger game_manager inc
		wait 50
		trigger game_manager b6_activate

	}
}

For the sv_brushmodel NULL error , probably an origin brush entity attach to nothing…


(Soap958) #6

yea oke but why does it work in my homehosted?


(stealth6) #7

I’d say just check your map for an origin brush as masterkiller said. Why it does or doesn’t work is a mystery to me, but if you just fix it problem solved no?


(Soap958) #8

Yea well i searched for that yesterday already couldnt find much, i will give it another try. But u guys can see what is wrong with my second script why the door isnt gonna trigger but the text is ?


(Zer0Cool) #9

“script” “button”
should be
“scriptname” “button”

the command is “alertentity <targetname>”
http://games.chruker.dk/enemy_territory/scripting_reference.php

trigger door_code
	{
		wm_announce "Door is open!!"
                wait 50
		alertentity door1
	}

(Soap958) #10

Ah yea that worked, i tried that be4 u posted ur comment because i say that in a script name i tried that before but in the wrong section of the script…

Thnx for the help :slight_smile:


(ailmanki) #11

SV_SetBrushModel: NULL on Katsbits