Files

> > CS2D > Lua Scripts > Barbed Wire Lua (Y.A.T.E.S)
Files overviewCS2D overviewLua Scripts overview

English Barbed Wire Lua (Y.A.T.E.S) >

21 comments2 kb, 526 Downloads

old Barbed Wire Lua (Y.A.T.E.S)

Rainoth
Moderator Off Offline

In short, a more realistic barbed wire.

I remembered the stereotypical "crawl under the barbed wire" scene from many movies and it was odd how CS2D doesn't handle it that way. So I made it do it.

Here's how it works:
If you run through a barbed wire, you'll sustain damage.
If you walk through a barbed wire, you won't sustain damage.

In other words, trade off speed to prevent injury or sustain injury to get to your goal faster.

You still damage the barbed wire if you walk through it. I am unsure if I should count this as a desired or undesired effect.

Installation >


Hopefully this will be useful.

P.S. I can include a bunch of pictures of me near barbed wires if you guys are into that

Cheers,
user Rainoth
edited 9×, last 28.11.16 05:54:03 pm
Approved by Sparty

Download Download

2 kb, 526 Downloads

Comments

21 comments
Page
To the start Previous 1 2 Next To the start

Log in!

You need to log in to be able to write comments!Log in

old

Mami Tomoe
User Off Offline

Now that I think about it, I would like to see a bunch of pictures of you near barbed wires...
I like it!

old

Rainoth
Moderator Off Offline

@user Pseudon:
Interesting idea, I'll consider it.

old

Pseudon
User Off Offline

The barbed wire shouldn't be damage when you walk through it as you should be touching no barbs walking carefully, right?

Nothing special, and too simple... but would work even better when having fields of barbed wire in a custom map, with a custom story etc. that requires a certain path to be followed and this could be a nice mini puzzle here and there.

I would've rather made a new "custom entity", with new effects and image. This is a good idea and can be developed further, but I can bet it won't happen.
I like it!

old

douglasmiguel7
User Off Offline

very good... congrats bro
I like it!

old

GeoB99
Moderator Off Offline

Neatly written and great idea.
I like it!

old

Powermonger
User Off Offline

This should do the trick:

addhook("movetile","barbed_movetile")
function barbed_movetile(id,x,y,walk)
     if object(objectat(x,y),"type")==2 and walk == 0 then
          if player(id,"health")>10 then
               parse("sethealth "..id.." "..player(id,"health")-10)
          else
               parse("customkill "..player(object(objectat(x,y),"player"),"name").." Barbed Wire "..id)
          end
     end
end

Damages 10 when moving to the tile (not constantly moving inside the tile).
I believe this is what VADemon meant...?

EDIT: Although, movetile hook doesn't support parameter walk, so this doesn't work...
I like it!
edited 1×, last 04.12.16 06:20:25 pm

old

Rainoth
Moderator Off Offline

@user VADemon: It may be 1 damage but that 1 damage is applied many times. Each tile has 32 pixels so depending on how you move (and you normally don't move in straight lines when fighting), you can actually suffer more than 20 damage per tile.
In other words, if you're smart about pathing (like say you walk on the edge of barbed wire), you'll lose 2-3 hp, compared to boldly walking across it and losing 20 or more.

old

VADemon
User Off Offline

@user Rainoth:
Currently the player suffers only 1 damage, that's not noticable even in normal game modes.
You can repair the damage caused to barbed wires with cs2d cmd damageobject so they are damaged only 5-10% otherwise a player can destroy barbed wires with too much ease.
I like it!

old

Yates
Reviewer Off Offline

Y.A.T.E.S support 10/10
I like it!

old

Rainoth
Moderator Off Offline

@user VADemon: Elaborate please.
If a player walks through the wire, he'll STILL suffer roughly half the damage he'd normally do and the wire will suffer half the damage too.
If a player runs through the wire, it'll work like it currently does in the script.
Did I understand it correctly?
Not sure how to respond, I liked the idea of bypassing the barbed wires by moving more slowly. I guess I could create an option to work both ways depending on what the host prefers.

P.S. Made it possible to use this as a plugin with Y.A.T.E.S.

old

Mami Tomoe
User Off Offline

hi all i like
I like it!

old

VADemon
User Off Offline

Yeah I think the wire shouldn't take any damage and the player should take maybe 50% of the damage, so it's a more balanced trade-off.
Simple and cool idea.
I like it!

old

xsiN
User Off Offline

I don't see the screenshots so you forced me to test it myself.

Looks decent enough for a like.
I like it!

old

Mora
User Off Offline

lel, with a screenshoot i get full idea :d
oky, this is a nice one thing :d even maybe kinda imb. Anyway sadly that it damages. I can quickly remove a wire when move at the edge of tiles.
Here take a like
I like it!

old

ohaz
User Off Offline

Neat idea
I like it!

old

kerker
User Off Offline

Good!
I like it!

old

Jite
User Off Offline

cool.
I like it!

old

Rainoth
Moderator Off Offline

@user xsiN: Lmao. Okay √
Here you go
IMG:https://sc-cdn.scaleengine.net/i/625499591219c6fe6c134f7474a245af.png

old

xsiN
User Off Offline

Screenshots please
I like it!
To the start Previous 1 2 Next To the start