Forum

> > CS2D > General > Shoot through the wall
ForenübersichtCS2D-ÜbersichtGeneral-ÜbersichtEinloggen, um zu antworten

Englisch Shoot through the wall

10 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt Shoot through the wall

NeptooN
User Off Offline

Zitieren
Hi us

I'm not a programmer, but I suggest adding " Shoot through the wall"

Env_Shootwall - This function can be supplied on any wall.

It can be edit, for example: 45.3% - these percentages indicate that you can shoot with the possibility of these percent through the wall.

X and Y - This is the location of the function

ADDED
I do not know how you idea, but I would like to add it

alt Re: Shoot through the wall

Mami Tomoe
User Off Offline

Zitieren
You can add a dynamic wall of the same tile with the 'obstacle' property and trigger it with the trigger command.

Modifying the damage could be hard though.
It would be easier if it was possible to get a table of the tiles that the shot has passed through in the 'hit' hook.

Such as this:

1
2
3
4
5
6
7
8
addhook('hit', 'hit')
function hit(id, source, weapon, hpdmg, apdmg, rawdmg, objectid, tiles)
	for k, v in pairs(tiles) do
		if tile(v.x, v.y, 'property') == 2 or tile(v.x, v.y, 'property') == 4 then
			msg('passed through obstacle')
		end
	end
end

alt Re: Shoot through the wall

Mami Tomoe
User Off Offline

Zitieren
That script isn't "real" its an example of how your fix could be put into action though.

I added a non existent value called "tiles" to the "hit" hook.
It doesn't exist but if it did it would've given the tiles that the bullet (or anything else) had traveled through in a table like this:

1
2
3
4
5
6
7
8
9
10
11
12
13
tiles = {
	[1] = {
		id = 53,
		x = 69,
		y = 21
	}
	[2] = "66",
	[3] = "66",
	[4] = "66",
	[5] = "66",
	[6] = "66",
	[7] = "66"
}
(I made them a string by accident, ignore that. I also didn't finish all of them.)

Assuming tile #53 is an obstacle and tile #66 is a floor.

Then you'd loop through the table and check if one of them is an obstacle using the "tile" function.

And then you'd return the modified "apdmg" accordingly.

Though your idea is nice too, but this one is a Lua alternative.

alt Re: Shoot through the wall

Mami Tomoe
User Off Offline

Zitieren
I don't get why but you could always add another variable for if the bullet was shot by a bot.

Don't know what FOW has to do with any of this though.

alt Re: Shoot through the wall

NeptooN
User Off Offline

Zitieren
@user Mami Tomoe: I'm telling you, if I wanted I would have put this question in the Lua, but I would like to see this system in the map editor. Lua is a separate topic.

Thank you for trying
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antwortenGeneral-ÜbersichtCS2D-ÜbersichtForenübersicht