Forum

> > CS2D > General > trigger questions
ForenübersichtCS2D-ÜbersichtGeneral-ÜbersichtEinloggen, um zu antworten

Englisch trigger questions

15 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt trigger questions

Yrael
User Off Offline

Zitieren
here are couple of things i need help with:

i cant to make a door that will shut automatically after 3 seconds after its opened.

i tried 'trigger_use' trigger: door, delay
but that doesnt work, so maybe i could put a trigger_move which triggers: delay and delay then triggers: door

i also need a fire that would hurt you, and rise in front of you but then go down and wont go back up until trigger_move triggered again.

i tried trigger_move, triggers, hurt, burn.
note: i did not edit env_burn settings, i need some help with that (i did make it a small fire).

thanks in advance,
yrael

alt Re: trigger questions

RedPillow
User Off Offline

Zitieren
Yup, try making 2 delays and make 2 delays trigger the same door?

just use Gen_FX and put env_hurt under it?

alt Re: trigger questions

Yrael
User Off Offline

Zitieren
that would make no sense, im not a total noob in map-making. and i already the flame hurt thing, thats not the problem. its that the flames are already on instead of off (i can use trigger_start for that) but when i step over it kinda goes crazy and turns on and off. i need help editing its settings so that it turns on once for a bit, but doesnt turn back on.

alt Re: trigger questions

TimeQuesT
User Off Offline

Zitieren
make a trigger "use"
"delay"
"func_dynwall"

use-trigger = "door,do"
dynwall-name= "door"
delayname = "do"
delay-trigger = "door"

alt Re: trigger questions

Yrael
User Off Offline

Zitieren
i did that, it didnt work. can you please help DC? or maybe kimkat?
2× editiert, zuletzt 15.06.09 17:48:39

alt Door 3 sec. delay

KimKat
GAME BANNED Off Offline

Zitieren
If you want to make a door that closes after 3 seconds. Do it like this...

Add a Func_DynWall entity where you want the door to be placed, then click properties. Write a name for the door, for example : "door"
Select a tile which you want to show as the door (graphicly speaking), and click Okay to apply. [default is 0]

Add a Trigger_Delay entity anywhere on the map. Although put it near the door, if you want your map to look tidy and not messy. Now write a name for the Trigger_Delay entity, for example : "delay_door"
Secondly add "door" to the "trigger" value field, and add number 3 to Delay (sec.) value field [default is 0].

There is plenty of ways of doing this, but if you want it to trigger at start do the following...

Add a Trigger_Start entity (you don't have to name it I think but I always do). Add "door_delay" to trigger value field and click Okay to apply, and you're kind of done.

In order to make it open again, you need to add further delay entities and connect it with some kind of trigger_hit, trigger_use... I don't know any otherway.

alt Re: trigger questions

Somaz
User Off Offline

Zitieren
Trigger_Start is completely unneeded here.

I spent some of my time and made a Lua script that should do what you're asking for.

Here's how to use it:
First of all make some lua file (you can copy/paste the server.lua) in the cs2d/sys/lua folder. If you want to attach it to a map then rename it to mapname.lua for example de_dust.lua

Be sure to set mp_luamap 1

Now open this file with notepad and copy this text (script) there:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
initclose = {}
prepareclose = {}

addhook("startround","varinit")
function varinit()
	for i=1,100 do
		initclose[i]=false
		prepareclose[i] = false
	end
end

function doorclose(doornumber,trigname)
	if trigname == "mydoor"..doornumber then
		if not(initclose[doornumber]) then
			initclose[doornumber] = true
			parse("trigger mydoordelay"..doornumber)
		else
			if prepareclose[doornumber] then
				prepareclose[doornumber] = false
				initclose[doornumber] = false
			else
				return 1
			end
		end
	end
	if trigname == "mydoorcheck"..doornumber then
		prepareclose[doornumber] = true
		parse("trigger mydoor"..doornumber)
	end
end

addhook("trigger","doorcloseprepare")
function doorcloseprepare(trigname)
	if string.sub(trigname,1,11)=="mydoorcheck" then
		num = string.sub(trigname, 12, string.len(trigname))
	else
		num = string.sub(trigname, 7, string.len(trigname))
	end
	num = tonumber(num)
	if not(num == nil) then
		return doorclose(num,trigname)
	end
end

Put it in your maps folder.


Now how to use it:

For each door you will need these triggers:

1. A button trigger
Has no name (the name is not needed)
Triggers: mydoor1

2. A Func_DynWall
Named: mydoor1
Doesn't trigger anything

3. A Trigger_Delay
Named: mydoordelay1
Triggers: mydoorcheck1
Delay (in seconds): 3

4. A Trigger_Delay
Named: mydoorcheck1
Doesn't trigger anything
Leave the delay at 0


Make sure to set names exactly as I sayd above.
For the second door you will need to write a 2 in the end, like this:
mydoor2
mydoordelay2
mydoorcheck2

For 57 it would be:
mydoor57
mydoordelay57
mydoorcheck57

If you use more than 100 doors (which I highly doubt) then replace
for i=1,100 do
in the script to:
for i=1,yournumber(for example 1000) do
like:
for i=1,1000 do


That's about it!
I tested it and it works.

Once opened the door becomes blocked for 3 seconds (you can't close it). After 3 seconds it closes (automatically) and can be openned again.

Edit: Just tested it with 7 doors everything works fine.
You can freely use more than 1 button for the same door.
1× editiert, zuletzt 16.06.09 12:50:06

alt Re: trigger questions

KimKat
GAME BANNED Off Offline

Zitieren
I think you can do that without lua scripts actually, Somaz.
But your script looks pretty cool haven't tested it but it looks functional in a way. Well, I think that script is pretty useful if you don't want to waste space on map by putting lots of entities on the map. Although I like to use the map editor for triggers still.

alt Re: trigger questions

Yrael
User Off Offline

Zitieren
umm, somaz, sorry, but this script is not really what i am looking for, but i will use it in the future (probably :D) kimkat, why would use a trigger_start and i tried what you said and it didn't seem to work... the point is that you can get in, but not back out...

alt Re: trigger questions

KimKat
GAME BANNED Off Offline

Zitieren
Yrael hat geschrieben
umm, somaz, sorry, but this script is not really what i am looking for, but i will use it in the future (probably :D) kimkat, why would use a trigger_start and i tried what you said and it didn't seem to work... the point is that you can get in, but not back out...
That's why I said...
KimKat hat geschrieben
In order to make it open again, you need to add further delay entities and connect it with some kind of trigger_hit, trigger_use... I don't know any otherway
but now I realise that there is a way to open it, you can do it manually. You can also bind a trigger to a key lol.

By writing this into a seperate cfg file: alias "dooropen1" "trigger door1"; bind "l" "dooropen1"

And putting this into autoexec.cfg : exec "sys/yourfile.cfg"

Alternatively, you could try adding these delays and stuff.

alt Re: trigger questions

Somaz
User Off Offline

Zitieren
Man, could you tell me WHAT you want then?

If you can get in, but can't get out, can't that be done with a single button and my script?

Yrael hat geschrieben
here are couple of things i need help with:

i cant to make a door that will shut automatically after 3 seconds after its opened.


So? It shuts after 3 seconds automatically.

And I can't think of a way you can do it without scripts.
If you make it without scripts then it's 100% abusable in some way, like spamming the button to leave the door open.

alt Re: trigger questions

KimKat
GAME BANNED Off Offline

Zitieren
You could disable the button. And use a delay entity to trigger entities which is only accessed by server and rcon.

You can trigger a delay entity by using the console.
Just write the delay entities names: trigger delay1,delay2,delay3

alt Re: trigger questions

Yrael
User Off Offline

Zitieren
it doenst matter spamming the button, because you cant go back, the point is that you go on, but you can't go back... and it should be able to opened infintely. so it makes sense to just use a triggze_use and trigger_delay, but that doesnt work... i might try it again...

alt Re: trigger questions

Somaz
User Off Offline

Zitieren
Ummm... Then I have a better solution (although my script still aplies).

Use a one-way teleport?

alt Re: trigger questions

horus
User Off Offline

Zitieren
But that completely destroys the whole point of having a door in the first place. It doesn't look as cool.
But using the door for purely aesthetic purposes would work. Just have it like that and put a teleport [triggered by the use but not turned off] right before the door.
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antwortenGeneral-ÜbersichtCS2D-ÜbersichtForenübersicht