Making Barbwire Hurt?

Post your scripting questions / solutions here

Moderator: Moderators

Sgt.Pepper
Sergeant
Posts: 69
Joined: Tue Feb 25, 2003 5:41 pm
Location: Canada

Making Barbwire Hurt?

Post by Sgt.Pepper »

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.
User avatar
Gen Cobra
Major General
Posts: 739
Joined: Tue Jan 28, 2003 4:26 pm

HURT ME

Post by Gen Cobra »

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!
Image
User avatar
mohaa_rox
Field Marshal
Posts: 2760
Joined: Mon Nov 11, 2002 7:05 am
Contact:

Post by mohaa_rox »

His method is easier.
Live to map, not map to live.
-mohaa_rox, .map
moderator
User avatar
Gen Cobra
Major General
Posts: 739
Joined: Tue Jan 28, 2003 4:26 pm

Post by Gen Cobra »

How can his be easier? Look at the script then look at what I did. It took me 5 min to apply fire to an entire map and have it hurt the player.
Image
User avatar
mohaa_rox
Field Marshal
Posts: 2760
Joined: Mon Nov 11, 2002 7:05 am
Contact:

Post by mohaa_rox »

"His" as in you, Gen Cobra. :wink:
Live to map, not map to live.
-mohaa_rox, .map
moderator
Sgt.Pepper
Sergeant
Posts: 69
Joined: Tue Feb 25, 2003 5:41 pm
Location: Canada

Post by Sgt.Pepper »

Thanks for your reply, but I'm doing this entirely through scripting, will that method work with scripting?
User avatar
mohaa_rox
Field Marshal
Posts: 2760
Joined: Mon Nov 11, 2002 7:05 am
Contact:

Post by mohaa_rox »

Not with scripting alone. You need mapping for the trigger multilpe.
Live to map, not map to live.
-mohaa_rox, .map
moderator
User avatar
Gen Cobra
Major General
Posts: 739
Joined: Tue Jan 28, 2003 4:26 pm

Post by Gen Cobra »

How come everyone scripts everything?? ? Why not map it to ensure that it works? I'm confused as to why you would just script it. It sounds easier but a little cheap.
Image
Bjarne BZR
Site Admin
Posts: 3298
Joined: Wed Feb 05, 2003 2:04 pm
Location: Sweden
Contact:

Post by Bjarne BZR »

Try to compile one of my maps Cobra, and you'll see why you would like to script things :wink: ( to not be forced to recompile ).
Admin .MAP Forums
Image
Head above heels.
User avatar
Gen Cobra
Major General
Posts: 739
Joined: Tue Jan 28, 2003 4:26 pm

Post by Gen Cobra »

I think I answered this to the best of my knowlege. I never script out anything I can do in the editor. I always wait to recompile and fix problems. That way I know it got fixed.
Image
User avatar
mohaa_rox
Field Marshal
Posts: 2760
Joined: Mon Nov 11, 2002 7:05 am
Contact:

Post by mohaa_rox »

Scripting rules!!!!!!!!!!!!!
Live to map, not map to live.
-mohaa_rox, .map
moderator
User avatar
MPowell1944
Moderator
Posts: 287
Joined: Thu Jan 09, 2003 7:06 am
Location: Woodstock, GA
Contact:

Post by MPowell1944 »

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

Post by Sgt.Pepper »

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?
Sgt.Stafford
Sergeant
Posts: 54
Joined: Sun Feb 02, 2003 1:43 pm
Contact:

Post by Sgt.Stafford »

Y didnt I think of that name......... :cry: 'Sgt.Pepper
Wait till you see the whites of their eyes
User avatar
MPowell1944
Moderator
Posts: 287
Joined: Thu Jan 09, 2003 7:06 am
Location: Woodstock, GA
Contact:

Post by MPowell1944 »

If you missed this, then I feel bad for you. :wink:
Post Reply