Making Barbwire Hurt?

Post your scripting questions / solutions here

Moderator: Moderators

Sgt.Stafford
Sergeant
Posts: 54
Joined: Sun Feb 02, 2003 1:43 pm
Contact:

Post by Sgt.Stafford »

U got me all wrong....I mean ur user name...........Sgt.Pepper........it's cool
:!:
Wait till you see the whites of their eyes
Sgt.Pepper
Sergeant
Posts: 69
Joined: Tue Feb 25, 2003 5:41 pm
Location: Canada

Post by Sgt.Pepper »

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!
panTera
Brigadier General
Posts: 573
Joined: Wed Jan 29, 2003 11:46 pm
Location: The Netherlands
Contact:

Post by panTera »

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.
Sgt.Pepper
Sergeant
Posts: 69
Joined: Tue Feb 25, 2003 5:41 pm
Location: Canada

Post by Sgt.Pepper »

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:
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

Uh are you sure the trigger is at the right location? Note that the origin key you're setting is completely useless. The vectors as supplied for the setsize command are absolute values, not relative to the origin.
Image
Sgt.Pepper
Sergeant
Posts: 69
Joined: Tue Feb 25, 2003 5:41 pm
Location: Canada

Post by Sgt.Pepper »

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.
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Example

Post by jv_map »

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!
Image
Sgt.Pepper
Sergeant
Posts: 69
Joined: Tue Feb 25, 2003 5:41 pm
Location: Canada

Post by Sgt.Pepper »

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.
nuggets
General
Posts: 1006
Joined: Fri Feb 28, 2003 2:57 am
Location: U-england-K (england in the UK) :P
Contact:

Post by nuggets »

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 :D
hope this helps, prob not cos it's all foreign 2 me :-/
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

I think I was correct :roll:

Yours would result in a trigger with the following dimensions:
x: 32 (64 - 32)
y: 48 (96 - 48 )
z: 208 (144 + 64)
Image
nuggets
General
Posts: 1006
Joined: Fri Feb 28, 2003 2:57 am
Location: U-england-K (england in the UK) :P
Contact:

Post by nuggets »

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? :D
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:

Post by nuggets »

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? :D

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 :D
hope this helps, prob not cos it's all foreign 2 me :-/
User avatar
MPowell1944
Moderator
Posts: 287
Joined: Thu Jan 09, 2003 7:06 am
Location: Woodstock, GA
Contact:

Post by MPowell1944 »

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

Post by Sgt.Pepper »

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.
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

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.
Image
Post Reply