English Shoot through the wall

10 replies
Goto Page
To the start Previous 1 Next To the start
28.02.19 12:20:51 pm
Up
NeptooN
User
Offline Off
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
28.02.19 01:56:03 pm
Up
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:

Code:
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
28.02.19 03:44:40 pm
Up
NeptooN
User
Offline Off
@user Goo: Thank you, but I don't quite understand the script. And I would like it to it added to the map editor, not through a script.
28.02.19 03:48:15 pm
Up
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:

Code:
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.
28.02.19 04:00:56 pm
Up
Devil-Thanh
GAME BANNED
Offline Off
@user Goo: that way fails with bots and FOW.
28.02.19 04:23:07 pm
Up
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.
01.03.19 10:49:50 am
Up
NeptooN
User
Offline Off
@user Goo: 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
02.03.19 12:58:48 pm
Up
Joni And Friends
User
Online On
here file cs2d Weapon WALLSHOT (11)
edited 1×, last 23.05.19 05:12:22 am
Web | file File does not exist (15501) | file File does not exist (15463) | file cs2d [JAF] Adventure (19) | file File does not exist (15919)
02.03.19 01:26:59 pm
Up
NeptooN
User
Offline Off
@user Joni And Friends: It's not what I wanted, but thank you.
04.03.19 05:21:00 am
Up
Joni And Friends
User
Online On
If you wanted to add it with map editor, you can use Func_DnyWall with obstacle behavior. Or you can use thread cs2d Ideas for CS2D - READ THE FIRST POST (OP)! to giving your idea
Web | file File does not exist (15501) | file File does not exist (15463) | file cs2d [JAF] Adventure (19) | file File does not exist (15919)
04.03.19 02:02:41 pm
Up
NeptooN
User
Offline Off
@user Joni And Friends: Thank you
To the start Previous 1 Next To the start