Forum

> > CS2D > Scripts > Trigger Delay Milliseconds Instead of Seconds
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch Trigger Delay Milliseconds Instead of Seconds

9 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt Trigger Delay Milliseconds Instead of Seconds

Apache uwu
User Off Offline

Zitieren
I've been messing around with the map editor and I noticed that trigger_delay can only accept seconds and no floats.

Well here it is.

Thanks to user Iamle0 for adding that the timers need to be freed after a round.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
addhook("triggerentity","_triggerentity")

function _triggerentity(x,y)
	if entity(x,y,"typename")=="Trigger_Delay" then
		timer(entity(x,y,"int0"),"parse","trigger \""..entity(x,y,"trigger").."\"")
		return 1
	end
end

addhook("endround","_endround")

function _endround()
	freetimer()
end

Adding this means trigger_delay will now be triggered in milliseconds.

1
2
3
4
5
6
7
10000 = 10 seconds
5000 = 5 seconds
1000 = 1 second
500 = half a second
100 = 1/10 of a second
10 = 1/100 of a second
1 = 1/1000 of a second

Should be interesting what people make since now delays are more rapid.

The reason I posted this was because I had wondered if this were possible and I checked to see if this was already brought up.

Good Luck with mapping.
6× editiert, zuletzt 07.08.13 19:40:46

alt Re: Trigger Delay Milliseconds Instead of Seconds

EngiN33R
Moderator Off Offline

Zitieren
Hold on, it's either your typo or my mistake - 1 second is 1000 milliseconds, and the timer function uses exactly them, so why is 1 one hundredth of a second when it's in fact one thousandth? Otherwise this is useful indeed.

alt I like it

Iamle0
User Off Offline

Zitieren
Very cool! But please tell me how can i add array of names?
Iam a noob.. I need more then advice, I need a code, pls
upd: whoops. Sorry. This is for every delays. Sorry Anyway very usefull
1× editiert, zuletzt 29.01.12 12:52:42

alt Re: Trigger Delay Milliseconds Instead of Seconds

Iamle0
User Off Offline

Zitieren
I think here is some kind of bug.. Delays won't stop after round restart. Can you fix it? Pleaase :3

upd: i've fixed it
1
2
3
4
5
6
7
8
9
10
11
12
13
addhook("triggerentity","_triggerentity")

function _triggerentity(x,y)
     if entity(x,y,"typename")=="Trigger_Delay" then
          timer(entity(x,y,"int0"),"parse","trigger "..entity(x,y,"trigger"))
          return 1
     end
end

addhook("endround","_endround")
function _endround()
	freetimer()
end
1× editiert, zuletzt 29.01.12 15:04:01

alt Re: Trigger Delay Milliseconds Instead of Seconds

Egoist
User Off Offline

Zitieren
I solved my problem about delays with making lot of them connected to each other,i think when you type a float number in a trigger_delay,it automatically makes it 0.1 seconds,so i needed 0.4,i put 4 delays for per delay i wanted,it was easy but long.Anyway this is awesome.
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht