Possible coding errorafter adding new weapon Help Please!!!

Ask questions, discuss ideas, get answers
User avatar
Kuyong_Chuin
Posts: 80
Joined: Wed May 05, 2010 2:34 pm
Location: Middle Tennessee, USA
Contact:

Possible coding errorafter adding new weapon Help Please!!!

Post by Kuyong_Chuin »

I completed the modding of the Chaos weapon and added it to BF1942, Now when I try to test it I try to start the game and I get the splash screen then nothing. I have had this happen before when adding a new weapon so I figure I coded something wrong in the weapons object file. And Yes I did make a new Projectile for it too but I know the problem isn't that code.
Can you look at the code and see if it is the code or the model itself crashing the program.

P.S. The scope is permanently attached to the model so that might be where the error in the code might be coming from. :?
P.S.S If I can get this to work I'll zip up a copy of the files, Model, Textures, and Code files, in winrar and upload them for you guys.

Code: Select all

[color=#0000BF]ObjectTemplate.create HandFireArms Chaos
ObjectTemplate.itemIndex 3
ObjectTemplate.networkableInfo HandFireArmsInfo
ObjectTemplate.projectileTemplate ChaosProjectile
ObjectTemplate.projectilePosition 0/0/0
ObjectTemplate.magSize 20
ObjectTemplate.numOfMag 6
ObjectTemplate.magType 0
ObjectTemplate.reloadtime 5.0
ObjectTemplate.roundOfFire 3.2
rem ObjectTemplate.roundOfFire 4
ObjectTemplate.fireOnce 1
ObjectTemplate.altFireOnce 1
objectTemplate.aiTemplate ChaosAI
ObjectTemplate.zoomFov 0.1
ObjectTemplate.unZoomBetweenFireTime 0.0
ObjectTemplate.useScope 1
ObjectTemplate.hasDynamicShadow 1
ObjectTemplate.soldierZoomFov 0.6 
ObjectTemplate.soldierZoomPosition -0.07/0/0
ObjectTemplate.soldierCameraPosition -0.02/-0.03/0.01
ObjectTemplate.addRootSpeed 0
ObjectTemplate.ammoType 1
ObjectTemplate.timeToNotAllowChange 0.25
ObjectTemplate.GUIIndex 3
ObjectTemplate.setHudAmmoType ATAmmoBar
ObjectTemplate.setAmmoBar "Ingame/Magbar_Rifle_empty_32x64.tga"
ObjectTemplate.setAmmoBarFill "Ingame/Magbar_Rifle_full_32x64.tga"
ObjectTemplate.setAmmoBarSize 20
ObjectTemplate.setAmmoBarPosX 6
ObjectTemplate.setAmmoBarPosY -17
ObjectTemplate.setAmmoBarTextPosX 5
ObjectTemplate.setAmmoBarTextPosY 10
ObjectTemplate.setScopeIcon "sniper.tga"
ObjectTemplate.setSniperSight 1
ObjectTemplate.setCrossHairType CHTCrossHair

ObjectTemplate.setHudAmmoType ATAmmoBar
ObjectTemplate.setAmmoBar "Ingame/Magbar_Rifle_empty_32x64.tga"
ObjectTemplate.setAmmoBarFill "Ingame/Magbar_Rifle_full_32x64.tga"
ObjectTemplate.setAmmoBarSize 46
ObjectTemplate.setAmomBarPosX 4
ObjectTemplate.setAmomBarPosY -11
ObjectTemplate.setAmomBarTextPosX 8
ObjectTemplate.setAmomBarTextPosY 4
ObjectTemplate.setCrossHairType CHTCrossHair

ObjectTemplate.setHudAmmoType ATAmmoBar
ObjectTemplate.setAmmoBar "Ingame/Magbar_Rifle_empty_32x64.tga"
ObjectTemplate.setAmmoBarFill "Ingame/Magbar_Rifle_full_32x64.tga"
ObjectTemplate.setAmmoBarSize 20
ObjectTemplate.setAmomBarPosX 6
ObjectTemplate.setAmomBarPosY -17
ObjectTemplate.setAmomBarTextPosX 5
ObjectTemplate.setAmomBarTextPosY 10
ObjectTemplate.setScopeIcon "sniper.tga"
ObjectTemplate.setSniperSight 1
ObjectTemplate.setCrossHairType CHTCrossHair

objectTemplate.aiTemplate ChaosAI
rem ObjectTemplate.positionalSpeedInDof CRD_NONE/800/0/0
ObjectTemplate.soldierZoomFov 0.6 
ObjectTemplate.soldierZoomPosition 0.1/0/0
ObjectTemplate.soldierCameraPosition -0.03/-0.04/0.1
ObjectTemplate.addRootSpeed 0
ObjectTemplate.AmmoType	1
ObjectTemplate.timeToNotAllowChange 0.25
Rem *** Deviation Begin *****

ObjectTemplate.velocity 2000
ObjectTemplate.setSpeedDev 0.8 0.2 0.2 0.1
ObjectTemplate.setMiscDev 2.5 2.5 0.1

Rem *** Deviation Begin *****

ObjectTemplate.velocity 2000
ObjectTemplate.setRecoilForceUp CRD_UNIFORM/0.2/0.2/0
ObjectTemplate.setRecoilForceLeftRight CRD_UNIFORM/-0.1/-0.3/0
ObjectTemplate.setHasRecoilForce 0.5
ObjectTemplate.setGoBackOnRecoil 0.5

ObjectTemplate.setFireDev 0 0 0
rem ObjectTemplate.setFireDev 1.8 0.25 0.03
ObjectTemplate.setDevMod  1 0.7 0.5
rem ObjectTemplate.setDevMod  1 0.7 0.5
ObjectTemplate.setMinDev 0.25
ObjectTemplate.setTurnDev 0.3 0.2 0.2 0.1
rem ObjectTemplate.setTurnDev 0 0 0 0
ObjectTemplate.setSpeedDev 1.5 0.4 0.4 0.1
rem ObjectTemplate.setSpeedDev 1.2 0.3 0.3 0.1


ObjectTemplate.setMiscDev 1.8 1.8 0.1

Rem *** Deviation  End *****

ObjectTemplate.fireInCameraDof 1
ObjectTemplate.loadSoundScript Sounds/Chaos.ssc

ObjectTemplate.createSkeleton animations/Chaos.ske
ObjectTemplate.useSkeletonPartAsMain Base

rem *** LodObject must be located as first child to work on handweapons.
ObjectTemplate.addTemplate ChaosLod

ObjectTemplate.addTemplate e_MuzzGun
ObjectTemplate.setPosition 0/0.05/0.84
ObjectTemplate.setRotation 0/0/0

ObjectTemplate.addTemplate e_shellM1Garand
ObjectTemplate.setPosition 0/0.1/0.41
ObjectTemplate.setRotation 0/0/0


ObjectTemplate.create SimpleObject ChaosSimple
ObjectTemplate.geometry ChaosSimple

ObjectTemplate.create SimpleObject ChaosMagasin
ObjectTemplate.geometry ChaosMagasin

ObjectTemplate.create SimpleObject ChaosReload
ObjectTemplate.geometry ChaosReload

ObjectTemplate.create SimpleObject ChaosPlupp
ObjectTemplate.geometry ChaosPlupp

ObjectTemplate.create SimpleObject Chaostrigger
ObjectTemplate.geometry Chaostrigger

ObjectTemplate.create AnimatedBundle ChaosComplex
ObjectTemplate.createSkeleton animations/Chaos.ske
ObjectTemplate.geometry Chaos
ObjectTemplate.hasDynamicShadow 1
ObjectTemplate.addTemplate Chaostrigger
ObjectTemplate.bindToSkeletonPart trigger
ObjectTemplate.addTemplate ChaosReload
ObjectTemplate.bindToSkeletonPart reload
ObjectTemplate.addTemplate ChaosPlupp
ObjectTemplate.bindToSkeletonPart plupp
ObjectTemplate.addTemplate ChaosMagasin
ObjectTemplate.bindToSkeletonPart mag

ObjectTemplate.create LodObject ChaosLod
ObjectTemplate.lodselector HandWeaponLodSelector
ObjectTemplate.addTemplate ChaosComplex
ObjectTemplate.addTemplate ChaosSimple[/color]

If thy sleepth in a bed of roses, thy will most likely awake with thorns in thy backside if thou doeth not prepareth thy bed beforeth thy lie down.
User avatar
Kuyong_Chuin
Posts: 80
Joined: Wed May 05, 2010 2:34 pm
Location: Middle Tennessee, USA
Contact:

Re: Possible coding errorafter adding new weapon Help Please

Post by Kuyong_Chuin »

I never did find out what was crashing the game but I did find a few typos I had made and found out I was formating the textures wrong for the game. But even after undoing all the changes the game was still crashing so I reinstalled every thing and it is working fine now though I can't really run BFV with this machine very well. I don't like seeing a bunch of snowmen running around on the screen. :lol: This video card just isn't up to processing everything in BFV (Not enough vid ram) so all the bots are white. :roll:
If thy sleepth in a bed of roses, thy will most likely awake with thorns in thy backside if thou doeth not prepareth thy bed beforeth thy lie down.
User avatar
HJGF
Posts: 233
Joined: Fri Feb 05, 2010 10:28 pm

Re: Possible coding errorafter adding new weapon Help Please

Post by HJGF »

get the bf42 http://www.fileshack.com/file.x/4529/Ba ... Executable set it up as the read me file says and check whats the problem
Image
Image
User avatar
Kuyong_Chuin
Posts: 80
Joined: Wed May 05, 2010 2:34 pm
Location: Middle Tennessee, USA
Contact:

Re: Possible coding errorafter adding new weapon Help Please

Post by Kuyong_Chuin »

HJGF wrote:get the bf42 http://www.fileshack.com/file.x/4529/Ba ... Executable set it up as the read me file says and check whats the problem
Thanks. You know I have the bfv version I forgot there was a BF42 version. :lol: I'll DL late this evening and install it for next time I have a issue with it. 8-)
If thy sleepth in a bed of roses, thy will most likely awake with thorns in thy backside if thou doeth not prepareth thy bed beforeth thy lie down.
User avatar
Kuyong_Chuin
Posts: 80
Joined: Wed May 05, 2010 2:34 pm
Location: Middle Tennessee, USA
Contact:

Re: Possible coding errorafter adding new weapon Help Please

Post by Kuyong_Chuin »

Ok finally had the time to sit down and code the Chaos Rifle and the game no longer crashes when loading it the animations work, the projectile works, the sound works, and the shell flies out all like it suppose to do. Problem is the model isn't showing up on the screen. Please help me figure out where the problem is. Here is my Geom. and object code.

handweapons Object.con for the Chaos

Code: Select all

rem ----------------------------------------------------------
rem Firearm: Chaos Covert Hi impact semiAuto spec Ops Sniper rifle 
rem ----------------------------------------------------------

ObjectTemplate.create HandFireArms Chaos
ObjectTemplate.networkableInfo HandFireArmsInfo
ObjectTemplate.itemIndex 3
ObjectTemplate.zoomFov 0.1
ObjectTemplate.unZoomBetweenFireTime 0
ObjectTemplate.useScope 1
ObjectTemplate.projectileTemplate CAPIHEProjectile
ObjectTemplate.hasDynamicShadow 1
ObjectTemplate.projectilePosition 0/0/0
ObjectTemplate.magSize 25
ObjectTemplate.numOfMag 6
ObjectTemplate.magType 0
ObjectTemplate.reloadtime 5.0
ObjectTemplate.roundOfFire 3.2
rem ObjectTemplate.roundOfFire 4
ObjectTemplate.fireOnce 1
ObjectTemplate.altFireOnce 1
ObjectTemplate.autoReload 1
ObjectTemplate.GUIIndex 113
ObjectTemplate.setHudAmmoType ATAmmoBar
ObjectTemplate.setAmmoBar "Ingame/Magbar_Rifle_empty_32x64.tga"
ObjectTemplate.setAmmoBarFill "Ingame/Magbar_Rifle_full_32x64.tga"
ObjectTemplate.setAmmoBarSize 20
ObjectTemplate.setAmmoBarPosX 6
ObjectTemplate.setAmmoBarPosY -17
ObjectTemplate.setAmmoBarTextPosX 5
ObjectTemplate.setAmmoBarTextPosY 10
ObjectTemplate.setScopeIcon "sniper.tga"
ObjectTemplate.setSniperSight 1
ObjectTemplate.setCrossHairType CHTIcon

ObjectTemplate.setHudAmmoType ATAmmoBar
ObjectTemplate.setAmmoBar "Ingame/Magbar_SMG_empty_32x64.tga"
ObjectTemplate.setAmmoBarFill "Ingame/Magbar_SMG_full_32x64.tga"
ObjectTemplate.setAmmoBarSize 46
ObjectTemplate.setAmomBarPosX 4
ObjectTemplate.setAmomBarPosY -11
ObjectTemplate.setAmomBarTextPosX 8
ObjectTemplate.setAmomBarTextPosY 4
ObjectTemplate.setCrossHairType CHTCrossHair

ObjectTemplate.setHudAmmoType ATAmmoBar
ObjectTemplate.setAmmoBar "Ingame/Magbar_Rifle_empty_32x64.tga"
ObjectTemplate.setAmmoBarFill "Ingame/Magbar_Rifle_full_32x64.tga"
ObjectTemplate.setAmmoBarSize 20
ObjectTemplate.setAmomBarPosX 6
ObjectTemplate.setAmomBarPosY -17
ObjectTemplate.setAmomBarTextPosX 5
ObjectTemplate.setAmomBarTextPosY 10
ObjectTemplate.setScopeIcon "sniper.tga"
ObjectTemplate.setSniperSight 1
ObjectTemplate.setCrossHairType CHTIcon

ObjectTemplate.aiTemplate ChaosAI
rem ObjectTemplate.positionalSpeedInDof CRD_NONE/800/0/0
ObjectTemplate.soldierZoomFov 0.6 
ObjectTemplate.soldierZoomPosition 0.1/0/0
ObjectTemplate.soldierCameraPosition -0.03/-0.04/0.1
ObjectTemplate.addRootSpeed 0
ObjectTemplate.AmmoType	1
ObjectTemplate.timeToNotAllowChange 0.25
Rem *** Deviation Begin *****

ObjectTemplate.velocity 3000
ObjectTemplate.setSpeedDev 0.8 0.2 0.2 0.1
ObjectTemplate.setMiscDev 2.5 2.5 0.1


Rem *** Deviation  End *****

ObjectTemplate.fireInCameraDof 1
ObjectTemplate.loadSoundScript Sounds/Chaos.ssc

ObjectTemplate.createSkeleton animations/Chaos.ske
ObjectTemplate.useSkeletonPartAsMain Base

rem *** LodObject must be located as first child to work on handweapons.
ObjectTemplate.addTemplate ChaosLod

ObjectTemplate.addTemplate e_MuzzGun
ObjectTemplate.setPosition 0/0.05/0.84
ObjectTemplate.setRotation 0/0/0

ObjectTemplate.addTemplate e_shellM1Garand
ObjectTemplate.setPosition 0/0.1/0.41
ObjectTemplate.setRotation 0/0/0

rem
rem ** Objects
rem

ObjectTemplate.create SimpleObject ChaosSimple
ObjectTemplate.geometry ChaosSimple

ObjectTemplate.create SimpleObject ChaosMagasin
ObjectTemplate.geometry ChaosMagasin

ObjectTemplate.create SimpleObject ChaosReload
ObjectTemplate.geometry ChaosReload

ObjectTemplate.create SimpleObject ChaosPlupp
ObjectTemplate.geometry ChaosPlupp

ObjectTemplate.create SimpleObject Chaostrigger
ObjectTemplate.geometry ChaosTrigger


ObjectTemplate.create AnimatedBundle ChaosComplex
ObjectTemplate.createSkeleton animations/Chaos.ske
ObjectTemplate.geometry Chaos
ObjectTemplate.hasDynamicShadow 1
ObjectTemplate.addTemplate ChaosTrigger
ObjectTemplate.bindToSkeletonPart Trigger
ObjectTemplate.addTemplate ChaosReload
ObjectTemplate.bindToSkeletonPart Reload
ObjectTemplate.addTemplate ChaosPlupp
ObjectTemplate.bindToSkeletonPart Plupp
ObjectTemplate.addTemplate ChaosMagasin
ObjectTemplate.bindToSkeletonPart Mag

ObjectTemplate.create LodObject ChaosLod
ObjectTemplate.lodselector HandWeaponLodSelector
ObjectTemplate.addTemplate ChaosComplex
ObjectTemplate.addTemplate ChaosSimple

The Chaos Geometry.con code

Code: Select all

GeometryTemplate.create StandardMesh Chaos

GeometryTemplate.file Chaos_Base_M2

GeometryTemplate.hasDynamicShadow 1

GeometryTemplate.setLodDistance 0 0

GeometryTemplate.setLodDistance 1 3

GeometryTemplate.setLodDistance 2 10

GeometryTemplate.setLodDistance 3 20

GeometryTemplate.setLodDistance 4 30

GeometryTemplate.setLodDistance 5 100

 

GeometryTemplate.create StandardMesh ChaosMagasin

GeometryTemplate.file Chaos_Mag_M2

GeometryTemplate.setLodDistance 0 0

GeometryTemplate.setLodDistance 1 3

GeometryTemplate.setLodDistance 2 10

GeometryTemplate.setLodDistance 3 20

GeometryTemplate.setLodDistance 4 50

GeometryTemplate.setLodDistance 5 100

 

GeometryTemplate.create StandardMesh ChaosReload

GeometryTemplate.file Chaos_Reload_M2

GeometryTemplate.setLodDistance 0 0

GeometryTemplate.setLodDistance 1 3

GeometryTemplate.setLodDistance 2 30

 

GeometryTemplate.create StandardMesh ChaosTrigger

GeometryTemplate.file Chaos_Trigger_M2

GeometryTemplate.setLodDistance 0 0

GeometryTemplate.setLodDistance 1 3

GeometryTemplate.setLodDistance 2 30

 

GeometryTemplate.create StandardMesh ChaosPlupp

GeometryTemplate.file Chaos_Plupp_M2

GeometryTemplate.setLodDistance 0 0

GeometryTemplate.setLodDistance 1 3

GeometryTemplate.setLodDistance 2 30

 

GeometryTemplate.create StandardMesh ChaosSimple

GeometryTemplate.file Shad_No4_Scope

GeometryTemplate.hasDynamicShadow 1

GeometryTemplate.setLodDistance 0 0

GeometryTemplate.setLodDistance 1 300
If thy sleepth in a bed of roses, thy will most likely awake with thorns in thy backside if thou doeth not prepareth thy bed beforeth thy lie down.
User avatar
Kuyong_Chuin
Posts: 80
Joined: Wed May 05, 2010 2:34 pm
Location: Middle Tennessee, USA
Contact:

Re: Possible coding error after adding new weapon Help Pleas

Post by Kuyong_Chuin »

Figured out why the model was not showing up. I had a typo in the geometry file so it wasn't locating the file. I fixed that and rerun the debugger again and it was locking up, no error message just locking up in mid map loading mode. That is when I found out BF doesn’t like more than one texture per model unless you use the multi/sub object mode of texturing the model. I redid the models textures to fix the rs files and renamed the one model that I did the typo on when I saved it so it could find the file. It now loads the model and everything works after a lot of tinkering with the object file, redoing the model again with the silencer and the scope as separate models except you can’t see the textures in game the whole gun is white, the silencer is black and white, and the scope is a dark grey along with the slide bolt. I figure it is my textures that are the problem. When converting them to a dds format I must be doing something wrong. What are the proper settings for exporting the Model in Max and the textures is Photoshop please. I can not fix any of the models I uploaded for everyone or the textures till this problem is solved. I will continue to make the models I am working on but won’t texture or export them till the problem is fixed. So those who are waiting on models from me sorry for the delay but you want a model that works in this game not one that just looks good on print. Thanks in advance for any help you can give me.
If thy sleepth in a bed of roses, thy will most likely awake with thorns in thy backside if thou doeth not prepareth thy bed beforeth thy lie down.
User avatar
ike
Posts: 16
Joined: Sat May 29, 2010 11:14 am
Location: Germany
Contact:

Re: Possible coding errorafter adding new weapon Help Please

Post by ike »

i´ve got the similar problem of texturing a model with the multimaterial editor. I tryed several options : unwrapping in "chanel 1" and mapping in chanel 1 - was ok but you cant lightmapping the model and the samplemaker crashed. I tryed the chanel 3 for unwrapping and texturing (someone said me its nesessary for lightmaping) but every time i set the mat ID for the collisions, or export the model with "force mat ID" the Texture is mixed too. Of course, the samplemaker make the .sample file, but you had no collisions :cry: .Im really confused about that, once i´ve exported a model with a multi texture, there was all perfect. But now, nothig works....

here my way of export: LOD01.. auto generate of LOD01-06 --> COL01 (mat id and clear uvw mapping) --> COL2 (copy of COL01) then export.

some pics:

the building is attached after i´ve textured it (attaching have also three options :? )

http://s10.directupload.net/file/d/2181 ... mt_jpg.htm

http://s10.directupload.net/file/d/2181 ... 2z_jpg.htm

after set mat ID for the collisions:

http://s10.directupload.net/file/d/2181 ... uw_jpg.htm

Now...i have got to detach the Model and retexture the model....wtf?

greetz ike
User avatar
Apache Thunder
Posts: 1210
Joined: Mon Oct 19, 2009 2:48 am
Location: Levelland Texas, USA
Contact:

Re: Possible coding errorafter adding new weapon Help Please

Post by Apache Thunder »

If you copied the lod to a new mesh called COL01, then you need not worry how the collision mesh "looks". COL meshes don't have uvmaps and are invisible ingame anyway, so that is normal. If you change the matIDs on the collision mesh, then it shouldn't effect the LOD. Also when you copy a mesh make sure to tell it to make the new object as a copy and NOT as a "Instance" or "Reference". ;)

I believe what you are seeing is the textures on your new collision mesh getting mixed up. Since col meshes don't use textures, you can just ignore that. Note upon reimport the meshes will be a solid color anyways.
ImageImageImage
I have cameras in your head!
User avatar
ike
Posts: 16
Joined: Sat May 29, 2010 11:14 am
Location: Germany
Contact:

Re: Possible coding errorafter adding new weapon Help Please

Post by ike »

ok after export i have this effect:

http://s5.directupload.net/file/d/2181/vj888skb_jpg.htm

lets see how it looking in game..(hope its good)
User avatar
ike
Posts: 16
Joined: Sat May 29, 2010 11:14 am
Location: Germany
Contact:

Re: Possible coding errorafter adding new weapon Help Please

Post by ike »

hmm... . look at the rs file ..

subshader "eod_house_05_m1_Material0" "StandardMesh/Default"
{
lighting true;
materialDiffuse 0.588235 0.588235 0.588235;
lightingSpecular false;
texture "texture/roof2";
}
subshader "eod_house_05_m1_Material1" "StandardMesh/Default"
{
lighting true;
materialDiffuse 0.588235 0.588235 0.588235;
lightingSpecular false;
texture "texture/roof2";
}
subshader "eod_house_05_m1_Material2" "StandardMesh/Default"
{
lighting true;
materialDiffuse 0.588235 0.588235 0.588235;
lightingSpecular false;
texture "texture/roof2";
}
subshader "eod_house_05_m1_Material3" "StandardMesh/Default"
{
lighting true;
materialDiffuse 0.588235 0.588235 0.588235;
lightingSpecular false;
texture "texture/roof2";
}
subshader "eod_house_05_m1_Material4" "StandardMesh/Default"
{
lighting true;
materialDiffuse 0.588235 0.588235 0.588235;
lightingSpecular false;
texture "texture/roof2";
}
subshader "eod_house_05_m1_Material5" "StandardMesh/Default"
{
lighting true;
materialDiffuse 0.588235 0.588235 0.588235;
lightingSpecular false;
texture "texture/roof2";
}
subshader "eod_house_05_m1_Material6" "StandardMesh/Default"
{
lighting true;
materialDiffuse 0.588235 0.588235 0.588235;
lightingSpecular false;
texture "texture/roof2";
}

hmm and its ingame like in max.."texture/roof2"
Post Reply