2 problems... mapcoords + target_lock


(Flippy) #1

Hey
ive got 2 problems with my map…
i was trying to make a command map… i read a thread about using the tracemap to make it easier… so i tried to generate the tracemap and it comes up with this error:
Mapcoords need to be square

now… im very sure that my mapcoords are indeed square and that i entered them correctly… but i probably made some stupid mistake :clap:
Here’s a screenshot (i deleted the 2 huge brushes before compiling ofcourse)

Note the length of the x and y axes (both 9216, making it perfectly square in my eyes…)


2nd prob…
I have a door in my map which i want to be locked / unlocked with one single button
I tried it with one target_lock, no luck

now i tried having two target_locks (one with key -1, scriptname and targetname “locker” and one with key 0, scriptname/targetname “unlocker” )
in the script i do
alertentity locker

but it doesnt lock the door…
im sure my script is right, i used wm_announce “Door locked!” and “Door unlocked!” and both messages come up at the right time… only the alertentity bit is not working
am i doing it wrong, or is it impossible??


(Flippy) #2

Ok problem one solved… i still had an old pk3’d version of the map in etmain and even with sv_pure 0 it loaded that one…

Second problem still not solved tho


(DerSaidin) #3

With the doors, you could just make a locked one, and an unlocked one then setstate invisible/default between them.
I’m not sure how the transition would go.

I do remember a tutorial from someone on these forum which had a scriptmover door that went to pieces. You might find something helpfull from that.


(BigBadWolf) #4

The better way to do this is probably through the script and a script_mover as the door.

Setup your door as you would normally. And add in your trigger w/target_script_trigger for your lock/unlock button. And in the script you will need to set it up using accums to check if the door is locked or not.

so basically:
Both Target_Script_Triggers need to point to the same scriptname, But the door_control target_script_trigger needs to point to trigger Use, and the lock target_script_trigger needs to point to trigger LockButton

script:

door_control
{
	spawn
	{
		accum 1 set 0   // 0 is unlocked
		accum 2 set 0   // toggle lock
	}

	trigger use
	{
		trigger door_control locksound
		accum 1 abort_if_not_equal 0

		trigger door_control open
		wait 5000
		trigger door_control close
	}

	trigger locksound
	{
		accum 1 abort_if_not_equal 1
		trigger door locksound
	}

	trigger lockbutton
	{
		trigger door_control lock
		wait 5
		trigger door_control unlock
	}

	trigger lock
	{
		accum 2 abort_if_not_equal 0
		resetscript
		accum 2 set 1

		accum 1 set 1
	}

	trigger unlock
	{
		accum 2 abort_if_not_equal 1
		resetscript
		accum 2 set 0

		accum 1 set 0
	}

	trigger open
	{
		trigger door open
	}

	trigger close
	{
		trigger door close
	}
}

door
{
	spawn
	{
	}
	
	trigger locksound
	{
		playsound sound/.../sound.wav
	}

	trigger open
	{
		gotomarker...
	}

	trigger close
	{
		gotomarker...
	}
}

This is all untested and is only theory, so hopefully it just gives you the ideas of the setup i was thinking, i also threw in a sound to play that will fire if the door is locked.

I hope this isnt too confusing and helps you solve the problem.