Making Barbwire Hurt?
Moderator: Moderators
-
Sgt.Stafford
- Sergeant
- Posts: 54
- Joined: Sun Feb 02, 2003 1:43 pm
- Contact:
-
Sgt.Pepper
- Sergeant
- Posts: 69
- Joined: Tue Feb 25, 2003 5:41 pm
- Location: Canada
Sorry if I seemed rude on my last post, I didn't mean to.
Ok, I did initially look at that tut when I first looked into this, but at the time I couldn't see how it would apply just to scripting. I can see that is does, though. I'm specifying where the wire is, and from there I'm adding in the target and value to my script. It's the same with Gen Cobra's, but reading them I could see a few things I was doing wrong. Really interesting to learn about the game.
That said, I'm still having trouble. One of the things I was wondering about was this part from the tut:
key: targetname
value: gimme_a_name
For me to achieve that, would I add this line to my script:
local.trig = spawn trigger_multiple
local.trig targetname hurt
local.trig origin ( 3279.00 -82.00 384.00 )
local.trig setsize ( 0 0 0 ) ( 128.00 896.00 256.00 )
local.trig setthread _mythread
local.trig wait 0.05 // How often the trig acts
local.trig delay 0 // How long before trig acts
Then for the setthread, "_mythread",
_mythread:
$hurt volumedamage 1000
That's how I have it now, and so far no luck. So I'm wondering if I'm forgetting something in the "_mythread" part, or if there is a major error that's there. Thanks agian, for your time and responses.
Oh, and Sgt.Stafford, thanks for the compliment on my name! If it wasn't this one it would be something Beatles oriented, like Mean Mr. Mustard. But since the game is a war one, Sgt.Pepper suits it better!
Ok, I did initially look at that tut when I first looked into this, but at the time I couldn't see how it would apply just to scripting. I can see that is does, though. I'm specifying where the wire is, and from there I'm adding in the target and value to my script. It's the same with Gen Cobra's, but reading them I could see a few things I was doing wrong. Really interesting to learn about the game.
That said, I'm still having trouble. One of the things I was wondering about was this part from the tut:
key: targetname
value: gimme_a_name
For me to achieve that, would I add this line to my script:
local.trig = spawn trigger_multiple
local.trig targetname hurt
local.trig origin ( 3279.00 -82.00 384.00 )
local.trig setsize ( 0 0 0 ) ( 128.00 896.00 256.00 )
local.trig setthread _mythread
local.trig wait 0.05 // How often the trig acts
local.trig delay 0 // How long before trig acts
Then for the setthread, "_mythread",
_mythread:
$hurt volumedamage 1000
That's how I have it now, and so far no luck. So I'm wondering if I'm forgetting something in the "_mythread" part, or if there is a major error that's there. Thanks agian, for your time and responses.
Oh, and Sgt.Stafford, thanks for the compliment on my name! If it wasn't this one it would be something Beatles oriented, like Mean Mr. Mustard. But since the game is a war one, Sgt.Pepper suits it better!
-
panTera
- Brigadier General
- Posts: 573
- Joined: Wed Jan 29, 2003 11:46 pm
- Location: The Netherlands
- Contact:
I didn't know that you could spawn a trigger via scripting? (not saying you couldn't, just never tried it). The tutorial is meant to be used in co-operation with a trigger_multiple with setthread in the map's BSP, (spawnflags from the BSP are set inside the editor.)
I once adjusted the size of my trigger brush and did an -onlyents compile, but it didn't work as the trigger is also a world brush.
So with your script the barbwire spawns correctly? Do you get any console error messages when touching the barbwire? I've never tried this kinda thing myself, but the script is order dependant and your thread must be after:
level waittill spawn
_mythread:
$hurt volumedamage 1000 // no good for barbwire unless you want players to die. Use ~10
end
Perhaps you could post the complete script? I hope some of the better scripters can look into it as I haven't got a clue on how to accomplish what you want without actually editing the map.
I once adjusted the size of my trigger brush and did an -onlyents compile, but it didn't work as the trigger is also a world brush.
So with your script the barbwire spawns correctly? Do you get any console error messages when touching the barbwire? I've never tried this kinda thing myself, but the script is order dependant and your thread must be after:
level waittill spawn
_mythread:
$hurt volumedamage 1000 // no good for barbwire unless you want players to die. Use ~10
end
Perhaps you could post the complete script? I hope some of the better scripters can look into it as I haven't got a clue on how to accomplish what you want without actually editing the map.
-
Sgt.Pepper
- Sergeant
- Posts: 69
- Joined: Tue Feb 25, 2003 5:41 pm
- Location: Canada
Yeah, from what I have seen with other maps, it can be done through scripting. And yep, the barbwire shows up alright. As for putting it after the "level waittill spawn" part, that was one of the mistakes I was making earlier. But I got it after that now.
I got the damage level up high for now, that's for testing purposes, so that I know the player will be hurt, likewise I got the box around the wire big, just to make it easier to test. I'll adjust it once I get everything working properly. Since it's a map fix, I'm going to set the damage level up to 86, because it takes 14 once the person falls. That's just my twisted humour!
Ok, so here is more of the script. I left out the beginning, and I'll leave out the explosions that are scripted at the end of it. And I'll colour the parts that I added. Thanks for your help.
//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 targetname hurt
local.trig origin ( 3279.00 -82.00 384.00 )
local.trig setsize ( 0 0 0 ) ( 128.00 896.00 256.00 )
local.trig setthread _mythread
local.trig wait 0.05 // How often the trig acts
local.trig delay 0 // How long before trig acts
$world farplane_color "0.752941 0.752941 0.752941"
level.fogplane = 6700
$world farplane level.fogplane
level waitTill prespawn
//*** Precache Dm Stuff
exec global/DMprecache.scr
exec global/ambient.scr
exec global/door_locked.scr::lock
level.script = maps/dm/Angryfields.scr
level.music = "MP_Holland_DM"
level waittill spawn
_mythread:
$hurt volumedamage 1000
random_explode1:
I got the damage level up high for now, that's for testing purposes, so that I know the player will be hurt, likewise I got the box around the wire big, just to make it easier to test. I'll adjust it once I get everything working properly. Since it's a map fix, I'm going to set the damage level up to 86, because it takes 14 once the person falls. That's just my twisted humour!
Ok, so here is more of the script. I left out the beginning, and I'll leave out the explosions that are scripted at the end of it. And I'll colour the parts that I added. Thanks for your help.
//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 targetname hurt
local.trig origin ( 3279.00 -82.00 384.00 )
local.trig setsize ( 0 0 0 ) ( 128.00 896.00 256.00 )
local.trig setthread _mythread
local.trig wait 0.05 // How often the trig acts
local.trig delay 0 // How long before trig acts
$world farplane_color "0.752941 0.752941 0.752941"
level.fogplane = 6700
$world farplane level.fogplane
level waitTill prespawn
//*** Precache Dm Stuff
exec global/DMprecache.scr
exec global/ambient.scr
exec global/door_locked.scr::lock
level.script = maps/dm/Angryfields.scr
level.music = "MP_Holland_DM"
level waittill spawn
_mythread:
$hurt volumedamage 1000
random_explode1:
-
Sgt.Pepper
- Sergeant
- Posts: 69
- Joined: Tue Feb 25, 2003 5:41 pm
- Location: Canada
Oh, ok, I though the origin was the location. So how would I specify the location? Would I tie that into the original part, where I spawn the wire?
So, local.trig "static/barbwire_long_two_post.tik"?
And the setsize then would be the size of the wire, as found in MOHRad, approx. 64 448 128.
Thanks for your help, it is much appreciated.
So, local.trig "static/barbwire_long_two_post.tik"?
And the setsize then would be the size of the wire, as found in MOHRad, approx. 64 448 128.
Thanks for your help, it is much appreciated.
Example
To spawn a trigger of 64 units wide (x-axis), 96 units in length (y-axis) and 128 units high (z) at location (32, 48, -64), type:
local.trig setsize (32 48 -64) (96 144 64)
In general: A trigger 'starting' at (x y z) of size (a b c):
local.trig setsize (x y z) ((x + a) (y + b) (z + c))
Note that (x y z) in this example isn't the centroid of the trigger but one of the vertices. The other vector designates the vertex at the other size, thus the complete trigger box is defined.
Hope that helps!
local.trig setsize (32 48 -64) (96 144 64)
In general: A trigger 'starting' at (x y z) of size (a b c):
local.trig setsize (x y z) ((x + a) (y + b) (z + c))
Note that (x y z) in this example isn't the centroid of the trigger but one of the vertices. The other vector designates the vertex at the other size, thus the complete trigger box is defined.
Hope that helps!
-
Sgt.Pepper
- Sergeant
- Posts: 69
- Joined: Tue Feb 25, 2003 5:41 pm
- Location: Canada
Thanks for that detailed reply, it really helped clear the box space up. I assumed the wire was spawned from the center, so I adjusted the box to fit the wire, and after a few miscalculations it worked.
I'm really thankful for all the help I got here. This has been bugging me for some time now. I keep getting a laugh out of having myself go near the wire and blowing up!
So now I'll mess around with the damage level and search other scripts for an appropriate death message.
Thanks again, it is much appreciated.
I'm really thankful for all the help I got here. This has been bugging me for some time now. I keep getting a laugh out of having myself go near the wire and blowing up!
So now I'll mess around with the damage level and search other scripts for an appropriate death message.
Thanks again, it is much appreciated.
-
nuggets
- General
- Posts: 1006
- Joined: Fri Feb 28, 2003 2:57 am
- Location: U-england-K (england in the UK) :P
- Contact:
sorry 2 correct u JV on the scripting but this is also 2 ease my confusion mayb u r right and it needs 2 b scripted the way u did it... but...
u said and i quote
To spawn a trigger of 64 units wide (x-axis), 96 units in length (y-axis) and 128 units high (z) at location (32, 48, -64), type:
local.trig setsize (32 48 -64) (96 144 64)
should this be
local.trig setsize (32 48 -64) (64 96 144) //or should it be as you said but with y.z.x axis.
i'm not picking fault, ur a better scripter than i
u said and i quote
To spawn a trigger of 64 units wide (x-axis), 96 units in length (y-axis) and 128 units high (z) at location (32, 48, -64), type:
local.trig setsize (32 48 -64) (96 144 64)
should this be
local.trig setsize (32 48 -64) (64 96 144) //or should it be as you said but with y.z.x axis.
i'm not picking fault, ur a better scripter than i
hope this helps, prob not cos it's all foreign 2 me :-/
-
nuggets
- General
- Posts: 1006
- Joined: Fri Feb 28, 2003 2:57 am
- Location: U-england-K (england in the UK) :P
- Contact:
eh eh??? just a bit of clrity now i'll use pictures maybe that'll help
)
surely when using something like local.trig setsize or setsize 4 anything really this is what's goin on... possilby...?
(32 48 -64) (96 144 64)
x y z x y z
^-origin-^ ^-length-^
so if i said as shown... along the x-axis the trigger would start from 32 and go along 96 so therefore finish at 128? etc... with y and z,
but looking at urs it seems that is would b
(32 48 -64) (96 144 64)
x y z x y z
^-origin-^ ^-finish-^
where finish is the point on the axis where this would finish... has this been what has been causing so many problems in my life?
surely when using something like local.trig setsize or setsize 4 anything really this is what's goin on... possilby...?
(32 48 -64) (96 144 64)
x y z x y z
^-origin-^ ^-length-^
so if i said as shown... along the x-axis the trigger would start from 32 and go along 96 so therefore finish at 128? etc... with y and z,
but looking at urs it seems that is would b
(32 48 -64) (96 144 64)
x y z x y z
^-origin-^ ^-finish-^
where finish is the point on the axis where this would finish... has this been what has been causing so many problems in my life?
hope this helps, prob not cos it's all foreign 2 me :-/
-
nuggets
- General
- Posts: 1006
- Joined: Fri Feb 28, 2003 2:57 am
- Location: U-england-K (england in the UK) :P
- Contact:
eh eh??? just a bit of clrity now i'll use pictures maybe that'll help
)
surely when using something like local.trig setsize or setsize 4 anything really this is what's goin on... possilby...?
(32 48 -64) (96 144 64)
x y z x y z
^-origin-^ ^-length-^
so if i said as shown... along the x-axis the trigger would start from 32 and go along 96 so therefore finish at 128? etc... with y and z,
but looking at urs it seems that is would b
(32 48 -64) (96 144 64)
x y z x y z
^-origin-^ ^-finish-^
where finish is the point on the axis where this would finish... therefore starting at point 32 and finishing at 96 making it only 64 long... has this been what has been causing so many problems in my life?
btw i tried adding ya under ur hotmail account name and it says jv_map@hotmail.com does not use MSN messenger although it says u can b contacted under that
surely when using something like local.trig setsize or setsize 4 anything really this is what's goin on... possilby...?
(32 48 -64) (96 144 64)
x y z x y z
^-origin-^ ^-length-^
so if i said as shown... along the x-axis the trigger would start from 32 and go along 96 so therefore finish at 128? etc... with y and z,
but looking at urs it seems that is would b
(32 48 -64) (96 144 64)
x y z x y z
^-origin-^ ^-finish-^
where finish is the point on the axis where this would finish... therefore starting at point 32 and finishing at 96 making it only 64 long... has this been what has been causing so many problems in my life?
btw i tried adding ya under ur hotmail account name and it says jv_map@hotmail.com does not use MSN messenger although it says u can b contacted under that
hope this helps, prob not cos it's all foreign 2 me :-/
- MPowell1944
- Moderator
- Posts: 287
- Joined: Thu Jan 09, 2003 7:06 am
- Location: Woodstock, GA
- Contact:
-
Sgt.Pepper
- Sergeant
- Posts: 69
- Joined: Tue Feb 25, 2003 5:41 pm
- Location: Canada
Ok, I have a few more questions about this. When a player touches the barbwire and dies from it, the message is that they blew up, is there anyway to have that changed to just died?
And secondly, I seen in another map with a minefield that the player would say that they stepped into a minefield. How is that done? I took a look and messed around, and they used a "stufftext" as in:
local.sucker stufftext "Say blah blah"
Would it be possible to put that into my barbwire script?
Thanks for your time.
And secondly, I seen in another map with a minefield that the player would say that they stepped into a minefield. How is that done? I took a look and messed around, and they used a "stufftext" as in:
local.sucker stufftext "Say blah blah"
Would it be possible to put that into my barbwire script?
Thanks for your time.
If you use the 'damage' command, you can set a 'means of death' value.
Syntaxis:
local.myloser damage ent_attacker int_damage ent_inflictor vec_position vec_direction vec_normal int_knockback int_damageflags int_meansofdeath int_location
Example:
local.myloser damage $world 1000 $world (0 0 0) (0 0 0) (0 0 0) 0 20 8
Means of death values:
0 none
1 suicide
2 crush
3 crush_every_frame
4 telefrag
5 lava
6 slime
7 falling
8 last_self_inflicted
9 explosion
10 explodewall
11 electric
12 electricwater
13 thrownobject
14 beam
15 rocket
16 impact
17 bullet
18 fast_bullet
19 vehicle
20 fire
21 flashbang
22 on_fire
23 gib
24 impale
25 bash
26 total_number
Location values:
-1 Unknown
0 Pelvis
1 Spine
2 Spine1
3 Spine2
4 Neck
5 Head
6 RUpperArm
7 RForearm
8 RHand
9 LUpperArm
10 LForearm
11 LHand
12 RThigh
13 RCalf
14 RFoot
15 LThigh
16 LCalf
17 LFoot
Damage flags:
1 DAMAGE_RADIUS (damage was indirect)
2 DAMAGE_NO_ARMOR (armour does not protect from this damage)
4 DAMAGE_ENERGY (damage is from an energy based weapon)
8 DAMAGE_NO_KNOCKBACK (do not affect velocity, just view angles)
16 DAMAGE_BULLET (damage is from a bullet (used for ricochets))
32 DAMAGE_NO_PROTECTION (armor, shields, invulnerability, and godmode have no effect)
64 DAMAGE_NO_SKILL (damage is not affected by skill level)
Add the values you want to use together, for example damage_no_protection and damage_no_skill would be 96.
I got most of this information from global/bullethit.scr. Hope it helps somehow.
Syntaxis:
local.myloser damage ent_attacker int_damage ent_inflictor vec_position vec_direction vec_normal int_knockback int_damageflags int_meansofdeath int_location
Example:
local.myloser damage $world 1000 $world (0 0 0) (0 0 0) (0 0 0) 0 20 8
Means of death values:
0 none
1 suicide
2 crush
3 crush_every_frame
4 telefrag
5 lava
6 slime
7 falling
8 last_self_inflicted
9 explosion
10 explodewall
11 electric
12 electricwater
13 thrownobject
14 beam
15 rocket
16 impact
17 bullet
18 fast_bullet
19 vehicle
20 fire
21 flashbang
22 on_fire
23 gib
24 impale
25 bash
26 total_number
Location values:
-1 Unknown
0 Pelvis
1 Spine
2 Spine1
3 Spine2
4 Neck
5 Head
6 RUpperArm
7 RForearm
8 RHand
9 LUpperArm
10 LForearm
11 LHand
12 RThigh
13 RCalf
14 RFoot
15 LThigh
16 LCalf
17 LFoot
Damage flags:
1 DAMAGE_RADIUS (damage was indirect)
2 DAMAGE_NO_ARMOR (armour does not protect from this damage)
4 DAMAGE_ENERGY (damage is from an energy based weapon)
8 DAMAGE_NO_KNOCKBACK (do not affect velocity, just view angles)
16 DAMAGE_BULLET (damage is from a bullet (used for ricochets))
32 DAMAGE_NO_PROTECTION (armor, shields, invulnerability, and godmode have no effect)
64 DAMAGE_NO_SKILL (damage is not affected by skill level)
Add the values you want to use together, for example damage_no_protection and damage_no_skill would be 96.
I got most of this information from global/bullethit.scr. Hope it helps somehow.
