Why does my weapon kill me.

Topics relating to Modeling with Reality Factory.
incenseman2003
Posts: 320
Joined: Sat Mar 11, 2006 11:41 pm

Why does my weapon kill me.

Post by incenseman2003 »

I made a weapon and when I fire it, it kills me and not the things Im shooting at. Can anyone tell me why that would happen and how to fix it?
Patience and tolerance are the keys to the passage of knowledge. Even those that are the most knowledgeable started with many questions.
hike1
RF FAQ-Keeper
Posts: 607
Joined: Tue Jul 05, 2005 4:19 am
Contact:

Post by hike1 »

I'll bet you have the firepoint of the weapon inside the weapon,
you need a Z? offset for it so the projectile fires out from the barrel.
incenseman2003
Posts: 320
Joined: Sat Mar 11, 2006 11:41 pm

Post by incenseman2003 »

I have searched the weapon.ini file and found no reference to "firepoint". I also did not see it in the setting for the weapon entity in the editor. It also is not in the player.ini. Can you please tell me exactly what you mean?
Patience and tolerance are the keys to the passage of knowledge. Even those that are the most knowledgeable started with many questions.
User avatar
Juutis
Posts: 1511
Joined: Thu Jan 12, 2006 12:46 pm
Location: Finland

Post by Juutis »

I believe he means the "playerlaunchoffset" and "viewlaunchoffset" fields in your weapon.ini. There should be three numbers defining the X, Y and Z offset for the firepoint. Z is the last one and changing it should fix your problem.
Pain is only psychological.
GD1
Posts: 413
Joined: Tue Jul 05, 2005 2:33 pm

Post by GD1 »

i've had the same problem myself.

the problem is a combination of the firepoint (playerlaunchoffset and/or viewlaunch offset) being inside the player's bounding box and the explosion settings on the projectile. the projectile hits inside of you, but that wouldn't normally cause damage. but, because it explodes, the splash damage from the explosion DOES cause damage to you because you are inside the range of the explosion.

move out the firepoint and try turning off the explosion settings for the projectile (all the settings i've mentioned are in weapon.ini)
Check out my band
Tougher Than Fort Knox
Image
incenseman2003
Posts: 320
Joined: Sat Mar 11, 2006 11:41 pm

Post by incenseman2003 »

Ok, the explosion for the projectile is off and the x plane for the launchpoint is set so that firing the weapon doesnt kill me. However, it doesnt kill anything else ether.

Any thoughts?
Patience and tolerance are the keys to the passage of knowledge. Even those that are the most knowledgeable started with many questions.
User avatar
QuestOfDreams
Site Admin
Posts: 1522
Joined: Sun Jul 03, 2005 11:12 pm
Location: Austria
Contact:

Post by QuestOfDreams »

What is the attribute the weapon does damage to? Is it the same as the attribute of the objects that should be damaged?

PS: If you specify a different damage-attribute for the weapon (e.g. monsterhealth instead of health) the player won't get damaged.
incenseman2003
Posts: 320
Joined: Sat Mar 11, 2006 11:41 pm

Post by incenseman2003 »

In my last post I mentiond that I no longer get killed by my own weapon but neither does anything else now. the issue of my weapon killing me has been solved. Now I just need to get it to kill other things. It just has no affect at all on other characters.
Patience and tolerance are the keys to the passage of knowledge. Even those that are the most knowledgeable started with many questions.
hike1
RF FAQ-Keeper
Posts: 607
Joined: Tue Jul 05, 2005 4:19 am
Contact:

Post by hike1 »

post your weapon.ini
incenseman2003
Posts: 320
Joined: Sat Mar 11, 2006 11:41 pm

Post by incenseman2003 »

Here is the weapon.ini that I am using.

[Tavor]
type = weapon
slot = 3
firerate = 0.2
catagory = projectile
projectile = WeaponBullet
attribute = health
ammunition = WeaponBullet
shotpermagazine = 100
ammopershot = 1
attacksound = Weapons/Fire.wav
reloadsound = Weapons/Reload.wav
emptysound = Weapons/Empty.wav
crosshair = crosshair.bmp
crosshairalpha = a_crosshair.bmp
crosshairfixed = true
allowlitcrosshair = true
crosshairlitcolor = 255 0 0
recoilamount = -5
recoildecay = 80
;
; 1st Person
;
viewactor = Weapons/tavor.act
viewfillcolor = 255 255 255
viewambientcolor = 255 255 255
viewrotation = -90 90 180
viewoffset = -5 -5 -2.5
viewscale = -0.1
viewlaunchoffset = -5 3.5 21
viewlaunchbone = BONE01
viewanimationspeed = 1
viewarmanim = Draw
viewidleanim = Idle
viewattackanim = Fire
viewaltattackanim = Fire
viewhitanim = Fire
viewalthitanim = Fire
viewwalkanim = Walk
muzzleflash = MuzzleFlash1
crosshair = crosshair.bmp
crosshairalpha = a_crosshair.bmp
crosshairfixed = true
allowlitcrosshair = true
crosshairlitcolor = 255 0 0
recoilamount = 10
recoildecay = 5
bobamount = 20
viewreloadanim = Reload
viewkeyreloadanim = Reload
viewattackemptyanim = Fire
environmentmapping = false
allmaterial = false
percentmapping = 0
percentmaterial = 0



[WeaponBullet]
type = projectile
actor = Weapons/Projectile.act
rotation = 0 0 0
scale = 0.1
gravity = false
bounce = false
speed = 3000
lifetime = 2
boundingbox = 1
explosion = GeneralExplosion
actorexplosion = GeneralExplosion
showboth = false
attachactor = false
bonelevel = true
damage = 50
altdamage = 50
explosionradius = 128
explosiondamage = 20
decal = 0
movesound = footsteps/footstep.wav
impactsound = Weapons/Impact.wav
Patience and tolerance are the keys to the passage of knowledge. Even those that are the most knowledgeable started with many questions.
User avatar
QuestOfDreams
Site Admin
Posts: 1522
Joined: Sun Jul 03, 2005 11:12 pm
Location: Austria
Contact:

Post by QuestOfDreams »

In my last post I mentiond that I no longer get killed by my own weapon but neither does anything else now. the issue of my weapon killing me has been solved. Now I just need to get it to kill other things. It just has no affect at all on other characters.
1) I just wanted to show you a different way to keep your player from getting damaged
2) The objects you want to kill must have the attribute that your weapon does damage to (in your case attribute = health).
3) Which objects do you want to damage? If you want to kill Pawns make sure that the script they are running has the necessary orders ( http://dhost.info/realityfactory/online ... htm#HEALTH )
GD1
Posts: 413
Joined: Tue Jul 05, 2005 2:33 pm

Post by GD1 »

[WeaponBullet]
type = projectile
actor = Weapons/Projectile.act
rotation = 0 0 0
scale = 0.1
gravity = false
bounce = false
speed = 3000
lifetime = 2
boundingbox = 1
explosion = GeneralExplosion
actorexplosion = GeneralExplosion
showboth = false
attachactor = false
bonelevel = true
damage = 50
altdamage = 50
explosionradius = 128
explosiondamage = 20
decal = 0
movesound = footsteps/footstep.wav
impactsound = Weapons/Impact.wav
if you'll notice, i've highlighted bonelevel = true. Bone level was designed way back in the day when we were trying to give developers the ability to script extra-damage for headshots. the idea was that collision detection would be based on the BBox of the individual bones instead of the actor's BBox. the problem with this was that the BBox for the individual bones was too small, and it required a VERY accurate shot to hit the object.

set bonelevel = false to go back to regular collision detection. this should solve your problem.
Check out my band
Tougher Than Fort Knox
Image
incenseman2003
Posts: 320
Joined: Sat Mar 11, 2006 11:41 pm

Post by incenseman2003 »

I just rebuilt the weapon act to get a visual reference as to where the bone was and adjusted from there. It no long kills me and does kill other things.

However I would like to get it to make no explosion when the projectile hits something. Havent succeeded yet. Im sure I over looked something simple. Can someone tell me what that might be?

Thanks
Patience and tolerance are the keys to the passage of knowledge. Even those that are the most knowledgeable started with many questions.
User avatar
AndyCR
Posts: 1449
Joined: Wed Jul 06, 2005 5:08 pm
Location: Colorado, USA
Contact:

Post by AndyCR »

Removing (better yet, commenting out) all the lines that start with Explosion should work.
incenseman2003
Posts: 320
Joined: Sat Mar 11, 2006 11:41 pm

Post by incenseman2003 »

AndyCR,

Thanks for the tip abot the explosions. Working fine now.

There is a problem that was not there before though. When I fire an exploding weapon under water the game crashes. The weapon fires, the projectile goes out and hits the target, the explosion starts, the game crashes. If I fire the same weapon obove water it did crashed a few times but seems to have stopped on its own. This only happens under water.

Edit: 6:14 PM 6/18/2006:
It now happens above water as well again. Seems to come and go. Works fine for about 3-4 shots and then the game crashes.
There are no errors in the RealityFactory.log. All I get is the generic window error that say that the program has to close.

I set the weapon that I made to fire the exploding ammo of the generic weapon. I fired 100 rounds and killed many bad guys. The game did not crash. This leads me to think that the issue is with the generic weapon its self.

Any helpful input on this would be greatly appreciated.


Here is the script for the weapon:

[Weapon]
type = weapon
slot = 2
firerate = 1
catagory = projectile
projectile = WeaponBullet
attribute = health
ammunition = WeaponBullet
shotpermagazine = 100
ammopershot = 1
attacksound = Weapons/Fire.wav
reloadsound = Weapons/Reload.wav
emptysound = Weapons/Empty.wav
crosshair = crosshair.bmp
crosshairalpha = a_crosshair.bmp
crosshairfixed = true
allowlitcrosshair = true
crosshairlitcolor = 255 0 0
recoilamount = -5
recoildecay = 80
;
; 1st Person
;
viewactor = Weapons/Weapon.act
viewfillcolor = 255 255 255
viewambientcolor = 255 255 255
viewrotation = -90 90 180
viewoffset = -5 -5 -2.5
viewscale = -0.1
viewlaunchoffset = -5 3.5 20
viewlaunchbone = BONE01
viewanimationspeed = 1
viewarmanim = Draw
viewidleanim = Idle
viewattackanim = Fire
viewaltattackanim = Fire
viewhitanim = Fire
viewalthitanim = Fire
iewwalkanim = Walk
muzzleflash = MuzzleFlash1
crosshair = crosshair.bmp
crosshairalpha = a_crosshair.bmp
crosshairfixed = true
allowlitcrosshair = true
crosshairlitcolor = 255 0 0
recoilamount = 10
recoildecay = 5
bobamount = 20
viewreloadanim = Reload
viewkeyreloadanim = Reload
viewattackemptyanim = Fire
environmentmapping = false
allmaterial = false
percentmapping = 0
percentmaterial = 0
Patience and tolerance are the keys to the passage of knowledge. Even those that are the most knowledgeable started with many questions.
Post Reply