Forum

> > CS2D > Scripts > PCS Construction 3on3 tournament-Request for US
Forums overviewCS2D overview Scripts overviewLog in to reply

English PCS Construction 3on3 tournament-Request for US

30 replies
Page
To the start Previous 1 2 Next To the start

old PCS Construction 3on3 tournament-Request for US

Andrez
User Off Offline

Quote
IMG:https://i1085.photobucket.com/albums/j432/Diosise/Logomakr_2KedsY_zpsfbnjs8w9.png


Hello, i am Andréz, administrator of PCS (cs2d.net), i am currently triying to make the best construction tournament there ever was, for that i need help from US Scripters there are examples of good scripters which have helped in the past like @user Gajos: and his money script.


-Scripts required:
√ Timer(counting the time from LIVE then rr when live again.)
√ Then compare the times between second round and first round(if 1:1, the team that won in less time wins)

√From 0:0 to 2 min mp_damagefactor 0.5 for everyone
from 2 min to 10 min: 1.0 (damagefactor)
from 10 min to 15 min: 1.2
from 15 min to 20 min:1.5
from +20 min 2.0
this gotta be automatic.

×Kills counter as team.
25 kills:10%speed for the team
50 kills= 1 molotov each 30 seconds for every player of the team
75: air strikes each minute for the attacker of the team
100 kills: that machinegun that has like 500 ammo each 1min for one player of the team

-Armor restart when round ends

√TIE BREAKERS(last 3 min)(kinda work like doom bots onl eague of legends)

SPEEDMOD FOR ALL (number to be decided)
RPG at respawn for all(multiplies
- more that i dont have ideas yet...
-rpg launchers for all
-air strikes for all (each min)


× roles: (its 3v3) there can only be one of each, selected at the start of the game
defender(130 hp)
support(15% faster than all the players)
attacker:1 gas grenade each 1 min

each one with different settings

+should have automatically these settings with the lua when you press !live



now the rules

default:

√ mp_damagefactor 1
mp_building_limit dispenser 1
mp_building_limit turret 3
mp_dispenser_health 10
mp_dispenser_money 10000

I need to limit gatefields to 6
barbed wires to 20
walls to 15 per player.. but idk how.. any clue?


Idk about turret damage or building healths.

Fun moments:

√ each 2,5 min one of these change:

-sv_fow 3 for 2,5 min
then switch off
2,5 min of friendly fire
2,5 min of ...somethign fun and different


Thank you!

old Re: PCS Construction 3on3 tournament-Request for US

Rainoth
Moderator Off Offline

Quote
K. Seems easy enough, I'll upload some when I can ^,o
I'll go one by one through them.

I am going to work under the assumptions that
Construction mode is on so rounds never end unless you capture objectives.
The kills are not shown on hud (if they are, tell me and also give me the hud IDs that are free for use)

P.S. Do you use Y.A.T.E.S or not?
edited 3×, last 02.12.16 04:39:18 am

old Re: PCS Construction 3on3 tournament-Request for US

Andrez
User Off Offline

Quote
user Rainoth has written
K. Seems easy enough, I'll upload some when I can ^,o
I'll go one by one through them.

I am going to work under the assumptions that
Construction mode is on so rounds never end unless you capture objectives.
The kills are not shown on hud (if they are, tell me and also give me the hud IDs that are free for use)

P.S. Do you use Y.A.T.E.S or not?


Hello @user Rainoth: , thanks!

Yes, they never end but if for example 30 minute, tie breakers should be much stronger... for example, no more building.

yes actually do that. if +30 min on timer: no more new buildings (remove wrenchs etc)

I didndt understand about the kills but yea they should constantly appear around the chat

I dont, and i wont use Y.A.T..ES

Thank you, if you have any other question or idea tell me

old Re: PCS Construction 3on3 tournament-Request for US

Yates
Reviewer Off Offline

Quote
Well I always liked to have the same administration script across every server I had. It just works better and doesn't require me to flip a switch while in-game thinking of what commands there were again or code wise.

I'm planning to make sure you only need one setup of Y.A.T.E.S which will work across all servers and then you can configure each one separately with different plugins. This means you don't need to keep multiple servers up to date.

I guess I'm going a bit off here, anyway, it's all up to you really. I guess what I'm trying to say is I'm always here to help if you need it with Y.A.T.E.S

For now go with the script you were planning to, seeing as I assume you want this asap.

old Re: PCS Construction 3on3 tournament-Request for US

Rainoth
Moderator Off Offline

Quote
K, here's the first part.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
-- A script that measures time passed for one round
round_timer = {seconds = 0, minutes = 0}

-- Handles time
addhook("second","round_timer.second")
function round_timer.second()
	round_timer.seconds = round_timer.seconds + 1
	if round_timer.seconds == 60 then
		round_timer.minutes = round_timer.minutes + 1
		round_timer.seconds = 0
	end
	local text = string.rep("0",2 - #tostring(round_timer.minutes))..tostring(round_timer.minutes)..":"..string.rep("0",2 - #tostring(round_timer.seconds))..tostring(round_timer.seconds)
	parse('hudtxt 0 "'..text..'" 69 420 0')
end

-- Resets time passed
addhook("startround","round_timer.startround")
function round_timer.startround(mode)
	round_timer.seconds = 0
	round_timer.minutes = 0
end

Simple time display. Mind the hudtxt. Feel free to change position and hud id to fit your needs.

CLARIFICATION: The round ends only when you capture the flag, is that it? There's no other way, right?

old Re: PCS Construction 3on3 tournament-Request for US

Andrez
User Off Offline

Quote
@user Rainoth:

well there's another way

Timer(counting the time from LIVE then rr when live again.) Then compare the times between second round and first round(if 1:1, the team that won in less time wins)

once you won first round you have to defend then

you see? so if you defend for a certain amount of time(no need to capture the flag) (or win again) it ends.

If they win second round in less time, they win

Thanks @user Rainoth:
I'll check it.

It works, but it should keep the time when it was first captured so you have the time in eyes to defend it.


@user Yates:
Well althought its interesting what you are saying, we already have Hajt's script iin there

old Re: PCS Construction 3on3 tournament-Request for US

Rainoth
Moderator Off Offline

Quote
Ye ye. I am well aware that this isn't exactly what you want. I don't have the time to sit and do everything in one go so I'll do it in parts.

// Here's the updated code to handle decreasing.
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
-- A script that measures time passed for each round
round_timer = {seconds = 0, minutes = 0, rounds = 0}

-- Handles time
addhook("second","round_timer.second")
function round_timer.second()
	if round_timer.rounds == 1 then
		round_timer.seconds = round_timer.seconds + 1
		if round_timer.seconds == 60 then
			round_timer.minutes = round_timer.minutes + 1
			round_timer.seconds = 0
		end
	elseif round_timer.rounds == 2 then
		round_timer.seconds = round_timer.seconds - 1
		if round_timer.seconds == 0 then
			if round_timer.minutes == 0 then
				-- endround(0)
				msg("Round end!@C")
			else
				round_timer.minutes = round_timer.minutes - 1
				round_timer.seconds = 59
			end
		end
	end
	local text = string.rep("0",2 - #tostring(round_timer.minutes))..tostring(round_timer.minutes)..":"..string.rep("0",2 - #tostring(round_timer.seconds))..tostring(round_timer.seconds)
	parse('hudtxt 0 "'..text..'" 69 420 0')
end

addhook("startround","round_timer.startround")
function round_timer.startround(mode)
	round_timer.rounds = round_timer.rounds + 1
end

Check if there's anything missing.

// I did another for tiebreakers.
Untested so see if it works.
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
44
45
46
47
48
49
50
51
52
-- requires round_timer.lua

tiebreakers = { -- state defines if the tiebreaker is active and can also be used to define how a tiebreaker works (check SECOND entry)
	[1] = {state = 0, on = "spawn", effect = function(id) parse("equip "..id.." 47") end},
	[2] = {state = 0, on = "spawn", effect = function(id) parse("speedmod "..id.." "..tiebreakers[2].state) end},
	[3] = {state = 0, on = "spawn_minute", effect = function(id) parse("equip "..id.." 76") end}
}

addhook("spawn","tiebreakers.spawn")
function tiebreakers.spawn(id)
	for k,v in pairs (tiebreakers) do
		if v.state > 0 then -- if this tiebreaker is active then run it's function
			if v.on:find("spawn") then
				v.effect(id)
			end
		end
	end
end

addhook("minute","tiebreakers.minute")
function tiebreakers.minute()
	for k,v in pairs (tiebreakers) do
		if v.state > 0 then
			for _,id in pairs (player(0,"tableliving")) do
				if v.on:find("minute") then
					v.effect(id)
				end
			end
		end
	end
end

function startTiebreaker()
	local tiebreaker = math.random(1,#tiebreakers-3) -- 3 entries are used for functions so we deduct them
	tiebreakers[tiebreaker].state = 1 -- enable tiebreaker
	if tiebreaker == 2 then -- if it requires additional params (like random speedmod)
		tiebreakers[tiebreaker].state = math.random(10,30) -- then write an if condition like this
	end -- This will set speed from 10 to 30 randomly if speedmod tiebreaker is chosen
end

addhook("second","tiebreakers.second")
function tiebreakers.second()
	if round_timer.rounds == 1 then
		if round_timer.minutes == 25 and round_timer.seconds == 0 then -- CHANGE this number to the minute when tiebreaker starts!
			startTiebreaker()
		end
	elseif round_timer.rounds == 2 then
		if round_timer.minutes == 3 and round_timer.seconds == 0 then -- assuming this works when time is going backwards too
			startTiebreaker()
		end
	end
end
edited 3×, last 03.12.16 07:26:03 pm

old Re: PCS Construction 3on3 tournament-Request for US

Rainoth
Moderator Off Offline

Quote
Oops! That was really dumb. Lemme fix it and add the "announcement" stuff.
The Code >

There shouldn't be that error anymore. I didn't test it beyond that. Added the announcements too.

old Re: PCS Construction 3on3 tournament-Request for US

Rainoth
Moderator Off Offline

Quote
@user Andrez: No problem. Unless you need it fast.
Anyways, here's the code for damage scaling. Feel free to test it out.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
-- requires round_timer.lua
damage_changes = {
[2] = 1,
[10] = 1.2,
[15] = 1.5,
[20] = 2.0}

addhook("second","damage_changes.second")
function damage_changes.second()
	for k,v in pairs (damage_changes) do
		if type(k) == "number" then
			if round_timer.minutes == k then
				parse("mp_damagefactor "..v)
			end
		end
	end
end

addhook("startround","damage_changes.startround")
function damage_changes.startround()
	parse("mp_damagefactor 0.5")
end
I'll put all codes together after I write all of them, as I fixed some things while checking through.

By the way, in the first post, you wrote that each class has different settings and that we should have automatically these settings when we press "!live". What did you mean by that? Elaborate please.

old Re: PCS Construction 3on3 tournament-Request for US

Rainoth
Moderator Off Offline

Quote
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
diversifiers = {
{name = "FOW Diversifier", duration = 15, on = function() parse("sv_fow 3") end, off = function() parse("sv_fow 1") end},
{name = "FF Diversifier", duration = 15, on = function() parse("sv_friendlyfire 1") end, off = function() parse("sv_friendlyfire 0") end},
number, -- number of diversifier that we'll enable.
diversifier, -- diversifier we'll enable
duration -- duration (LEFT) before end of diversifier
}

function diversifiers.enable()
	diversifiers.number = math.random(1,#diversifiers) -- which diversifier to use
	diversifiers.diversifier = diversifiers[diversifiers.number] -- actual diversifier information
	diversifiers.diversifier.on() -- enable what it does
	diversifiers.duration = diversifiers.diversifier.duration -- for how long it's set to be
	msg(diversifiers.diversifier.name.." enabled for "..diversifiers.duration.." seconds@C") -- tell everyone about it
end

addhook("second","diversifiers.second")
function diversifiers.second()
	if diversifiers.duration then
		if diversifiers.duration > 0 then
			diversifiers.duration = diversifiers.duration - 1
		end
		if diversifiers.duration == 0 then
			diversifiers.diversifier.off()
			diversifiers.enable()
		end
	end
end		

addhook("endround","diversifiers.endround")
function diversifiers.endround(mode)
	if diversifiers.duration then
		diversifiers.duration = 0
		diversifiers.diversifier.off()
	end
end
	
addhook("startround","diversifiers.startround")
function diversifiers.startround(mode)
	diversifiers.enable()
end

Here's the code for diversifiers. I made it work with functions instead of passing params to parse so you can do everything you want instead of just changing settings. Just think of what you want to happen and write a function that accomplishes it. Then just write to run that function when you define a new diversifier.

This needs more testing since I had a lot of problems writing this one. Tell me if there are any problems.

As for classes, you can either just think of more classes or double the amount (so there's 2 attackers, 2 defenders and so on).
For now I won't do it cause I don't know what you really think so I'll do other things you requested for now.

old Re: PCS Construction 3on3 tournament-Request for US

Rainoth
Moderator Off Offline

Quote
@user Andrez: No, I already posted a tiebreaker script. Diversifier is exactly what it says... A diversifier. It switches up things to make it more interesting. It's what you wrote under "fun moments".

// Here's the settings.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
building_limit = {
["Dispenser"] = 1,
["Turret"] = 3,
["Gate Field"] = 6,
["Wall I"] = 15,
["Barbed Wire"] = 20
}

for k,v in pairs (building_limit) do
	parse("mp_buildinglimit "..k.." "..v)
end

parse("mp_dispenser_health 10")
parse("mp_dispenser_money 10000")
Test if it works.
ATTENTION! Shameless advertising - I suggest to use my file cs2d Barbed Wire Lua (Y.A.T.E.S) for barbed wires.

Don't forget to tell me if you still want classes.
edited 1×, last 07.12.16 09:30:02 pm
To the start Previous 1 2 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview