English Trigger Delay Milliseconds Instead of Seconds

9 replies
Goto Page
To the start Previous 1 Next To the start
Up
Apache uwu
User
Offline Off
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.

Code:
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.

Code:
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.
edited 6×, last 07.08.13 07:40:46 pm
10.09.11 08:08:47 am
Up
EngiN33R
Moderator
Offline Off
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.
I code, therefore I exist. | Visit my blog for Lua tips and other interesting info
10.09.11 08:28:21 am
Up
DannyDeth
User
Offline Off
1 microsecond = 1/1000000 of a second, so don't you mean milliseconds ?
10.09.11 05:03:29 pm
Up
Apache uwu
User
Offline Off
Opps yeah I wasn't thinking correctly.
29.01.12 11:37:54 am
Up
Iamle0
User
Offline Off
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
edited 1×, last 29.01.12 12:52:42 pm
29.01.12 01:23:03 pm
Up
maPmaKer
User
Offline Off
This really seems a good option for maps. I'mma download it and add it to my CS2D folder soon.
29.01.12 02:42:53 pm
Up
Iamle0
User
Offline Off
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
Code:
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
edited 1×, last 29.01.12 03:04:01 pm
29.01.12 04:31:16 pm
Up
Apache uwu
User
Offline Off
...nice bump

file cs2d Aztec Race (6) uses this, it's cool but I can't extend the map with more dynamic walls. As soon as I do the game lags to the point where it crashes.
29.01.12 05:16:25 pm
Up
Iamle0
User
Offline Off
Delay's dont create lags.
For example:
file cs2d Dr_DeathJoke (12) When I was creating it I had a problem. Its too big and laggy. And i have noted that Delay+Dyn_Wall create lags.

It'll be better if you will not trigger it from start, just place the bottom, and let the player start a circle
21.07.13 01:01:40 pm
Up
Egoist
User
Offline Off
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.
To the start Previous 1 Next To the start