Forum

> > CS2D > Mods > RTS Project
Forums overviewCS2D overview Mods overviewLog in to reply

English RTS Project

7 replies
To the start Previous 1 Next To the start

Poll Poll

Do you like the idea?

Only registered users are allowed to vote
Yes.
81.82% (9)
No.
18.18% (2)
11 votes cast

old Poll RTS Project

Pseudon
User Off Offline

Quote
--------------------------------------------------------------------------
Main Description
--------------------------------------------------------------------------
Hello, in this thread I want to present my project and to ask for help when I have an issue.
This mod is supposed to let you control the bots like in a RTS game.

Recently I managed to find the files, this mod is pretty old. Not long ago my PC broke and I had to buy a new one and I lost most of the stuff. Through the files I lost were this mod and the Zombie Survival mod I am working on, I got help from a friend who helped me with the tests and I managed to rebuild the script.

This would be the version 0.1.
Now you can select the bot and give him commands. The implemented commands are: Move, Patrol, Switch Weapon, Smart Attack ( Grenades and weapon ), Reload, Use, Retreat and Disband.

I have made a video to show what I have made so far.
CS2D Project - RTS Bots

What I am planning to make:
Switch from server action to click for command selection.
Add an elevation feature.
Add buildings.
New GUI.

--------------------------------------------------------------------------

I also need help with: >

old Re: RTS Project

Avo
User Off Offline

Quote
I believe the idea isn't new.

I dunno. Looks pretty neat but needs more dynamic gameplay.

Good luck!

old Re: RTS Project

MikuAuahDark
User Off Offline

Quote
user Pseudon has written
I need to know if there is any way to check the brightness of a tile. ×


Maybe something like this?
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
tile_brightness={}		-- 1 = full bright. For RGB-Brightness version, {255,255,255,1.0}

local f=io.open("maps/filetest.map","rb")
local _decode_brightness=function(byte)
	local v=math.floor(byte/4)%16
	if v==0 then return 1
	else return v/10 end
end
local __=function(x,p) return x%(p*2)>=p end

for i=0,map("xsize") do
	tile_brightness[i]={}
end
f:seek("cur",53)
if f:read(1):byte()~=0 then
	f:seek("cur",50)
	f:read("*l")
	f:seek("cur",18)
	local info_string=f:read("*l")
	local _,tile_count=info_string:match("(%d*)x(%d*)")
	f:read("*l")
	f:seek("cur",9)
	f:read("*l")
	f:seek("cur",11)
	f:read("*l")
	f:read(tile_count+1)
	f:read((map("xsize")+1)*(map("ysize")+1))
	for x=0,map("xsize") do
		for y=0,map("ysize") do
			local type=f:read(1):byte()
			-- local r,g,b=255,255,255	-- RGB-Brightness version
			if type>=192 then f:read("*l")
			elseif __(type,64) and (not __(type,128)) then f:seek("cur",1)
			elseif (not __(type,64)) and __(type,128) then
				-- r=f:read(1):byte() g=f:read(1):byte() b=f:read(1):byte() f:seek("cur",1)
				f:seek("cur",4)			-- comment this if you use RGB-Brightness version
			end
			-- tile_brightness[x][y]={r,g,b,_decode_brightness(type)}		-- RGB-Brightness version
			tile_brightness[x][y]=_decode_brightness(type)		-- comment this if you use RGB-Brightness version
		end
	end
else
	for x=0,map("xsize") do
		for y=0,map("ysize") do
			-- tile_brightness[x][y]={255,255,255,1}	-- RGB-Brightness version
			tile_brightness[x][y]=1		-- comment this if you use RGB-Brightness version
		end
	end
end
f:close()
variable tile_brightness[x][y] contains the tile brightness(0.1 for 10 brightness, 1 for 100 brightness)

I also add some extra code if you want to get the RGB value of a tile

Note: You only need to execute code above once for every server start.
edited 1×, last 07.01.15 06:41:33 am

old Re: RTS Project

Time
User Off Offline

Quote
Not quite practical due to cs2d's limitations but that looks like some sick programming nonetheless.

old Re: RTS Project

Thug Life
User Off Offline

Quote
Pseudon has written
I got help from a friend who helped me with the tests and I managed to rebuild the script.

You forgot to say that I was that friend who helped you with the files, but I don't care if you didn't mention my name. I'm still "available" to helping u in testing your projects which are awesome. Keep doing it.

old Re: RTS Project

Pehlivan
User Off Offline

Quote
There should be a label/text which gives information, if you have marked one of these icons.
To the start Previous 1 Next To the start
Log in to reply Mods overviewCS2D overviewForums overview