Making Barbwire Hurt?
Moderator: Moderators
-
Sgt.Pepper
- Sergeant
- Posts: 69
- Joined: Tue Feb 25, 2003 5:41 pm
- Location: Canada
Making Barbwire Hurt?
Hey There,
I asked this at TMT, but I'm afraid I didn't quite understand the response I got, and to avoid making myself look more like a idiot there, I decide to show you guys my lack of knowledge!
I'm working on a fix for a custom map, a player can leave the boundries of the map, and I have barbwire placed there to stop the player from leaving. The wire is there fine, but I would like it to inflict pain on the player. It is for SH. I'll put what I have so far. Thanks in advance.
//Allie Map Fix
local.wire = spawn script_model
local.wire model "static/barbwire_long_two_post.tik"
local.wire.origin = ( 3279.00 -82.00 384.00 )
local.wire.angles = (0 0 0)
local.wire.scale = 0.70
local.wire solid
local.trig = spawn trigger_multiple
local.trig origin ( 3279.00 -82.00 384.00 )
local.trig setsize ( 0 0 0 ) ( 64.00 448.00 128.00 )
local.trig setthread _mythread
local.trig wait 0.05 // How often the trig acts
local.trig delay 0 // How long before trig acts
_mythread:
local.player = parm.other
local.player hurt 96 // Cause 10 hurt every time
I'm tired and I may have forgotten to tell you something, if so then please ask. Thanks again.
I asked this at TMT, but I'm afraid I didn't quite understand the response I got, and to avoid making myself look more like a idiot there, I decide to show you guys my lack of knowledge!
I'm working on a fix for a custom map, a player can leave the boundries of the map, and I have barbwire placed there to stop the player from leaving. The wire is there fine, but I would like it to inflict pain on the player. It is for SH. I'll put what I have so far. Thanks in advance.
//Allie Map Fix
local.wire = spawn script_model
local.wire model "static/barbwire_long_two_post.tik"
local.wire.origin = ( 3279.00 -82.00 384.00 )
local.wire.angles = (0 0 0)
local.wire.scale = 0.70
local.wire solid
local.trig = spawn trigger_multiple
local.trig origin ( 3279.00 -82.00 384.00 )
local.trig setsize ( 0 0 0 ) ( 64.00 448.00 128.00 )
local.trig setthread _mythread
local.trig wait 0.05 // How often the trig acts
local.trig delay 0 // How long before trig acts
_mythread:
local.player = parm.other
local.player hurt 96 // Cause 10 hurt every time
I'm tired and I may have forgotten to tell you something, if so then please ask. Thanks again.
HURT ME
Ok here is how I make stuff hurt.
much easier
Right click and make a trigger around the barbwire where you want it to hurt.
press n and give it
key/targetname
value/hurtme(you can make one up but this is mine)
key/setthread
value/pain(you can make one up but this is mine)
key/wait
value/1
Now that's done. You can copy this trigger as much as you want but MAKE SURE the target is right after you copy it.
Now open your .scr and insert these lines after 'level waittill spawn'
pain:
$hurtme volumedamage 25
end
that's it
you can change the volume of the damage to 100 or 50 or whatever. It changes the amount of life taken when you are hit by the trigger. The wait is for how many secondds to wait before the player gets hit with the damage. I use 1 cause it works well and 25 for the volume because the player doesn't get wiped out when he touches the trigger.
Hope that helped!
much easier
Right click and make a trigger around the barbwire where you want it to hurt.
press n and give it
key/targetname
value/hurtme(you can make one up but this is mine)
key/setthread
value/pain(you can make one up but this is mine)
key/wait
value/1
Now that's done. You can copy this trigger as much as you want but MAKE SURE the target is right after you copy it.
Now open your .scr and insert these lines after 'level waittill spawn'
pain:
$hurtme volumedamage 25
end
that's it
you can change the volume of the damage to 100 or 50 or whatever. It changes the amount of life taken when you are hit by the trigger. The wait is for how many secondds to wait before the player gets hit with the damage. I use 1 cause it works well and 25 for the volume because the player doesn't get wiped out when he touches the trigger.
Hope that helped!

-
Sgt.Pepper
- Sergeant
- Posts: 69
- Joined: Tue Feb 25, 2003 5:41 pm
- Location: Canada
-
Bjarne BZR
- Site Admin
- Posts: 3298
- Joined: Wed Feb 05, 2003 2:04 pm
- Location: Sweden
- Contact:
- MPowell1944
- Moderator
- Posts: 287
- Joined: Thu Jan 09, 2003 7:06 am
- Location: Woodstock, GA
- Contact:
When I made Stalingrad 2, I used scripting to hurt the player that touched the barbwire. Had a trigger_multiple with a setthread, and the thread activated the .scr file for a bullet hit, hence the player would be hit with a bullet with set amount of damage everytime they touched the trigger. Worked quite well for using script.
-
Sgt.Pepper
- Sergeant
- Posts: 69
- Joined: Tue Feb 25, 2003 5:41 pm
- Location: Canada
Yeah, I'm not doing it through mapping because it's not my map that I'm doing it for. It's a custum map, made by someone else, and we are running it on our server. And also, I've done lots of searching, and I think it may be done through scripting. Not too sure, though. But since the hole is patched, there is rush for it, I just want to be able to do it for the knowledge, and the challenge. I'm new to scripting, and I want to see what can be done.
Mpowell, Yeah, I was looking at the script that you have for Stali2 and the one for Omaha SE. But I'm afraid that I don't understand it too much. Plus, if at all possible, I would like to have this all in one script without having to go into another folder.
Now, I'm wondering if a trigger_hurt will work. I've read that it won't work in AA, but since this is for SH, perhaps it will. I think I've tried it, so that leads me to believe that I've messed up somewhere else in my script. Any suggestions?
Mpowell, Yeah, I was looking at the script that you have for Stali2 and the one for Omaha SE. But I'm afraid that I don't understand it too much. Plus, if at all possible, I would like to have this all in one script without having to go into another folder.
Now, I'm wondering if a trigger_hurt will work. I've read that it won't work in AA, but since this is for SH, perhaps it will. I think I've tried it, so that leads me to believe that I've messed up somewhere else in my script. Any suggestions?
-
Sgt.Stafford
- Sergeant
- Posts: 54
- Joined: Sun Feb 02, 2003 1:43 pm
- Contact:
- MPowell1944
- Moderator
- Posts: 287
- Joined: Thu Jan 09, 2003 7:06 am
- Location: Woodstock, GA
- Contact:
If you missed this, then I feel bad for you. 
