Random Uniforms: Very near completion -1 reply

  • 1
  • 2

Please wait...

SacredLizard

Its cupnoodles not cuponoodles

50 XP

23rd April 2004

0 Uploads

918 Posts

0 Threads

#1 14 years ago

Ok, so I was working on getting the "random" uniforms going, and I think that I have it "working", but I need the help of someone who has some real experience with this coding. I get the level to run, but the problem is that once the team spawns, it remains still (me included, this isn't an AI issue). I can move if I enter a nearby vehicle, or if I crouch or lay prone and then get back up. I crash about two thirds of the way through the loading screen when I try to run AI/objects file. here is a screenshot of the multiple uniforms. One interesting accident is that the hat that the soldier is wearing depends on his uniform! not his kit!




Admiral Donutz VIP Member

Wanna go Double Dutch?

735,271 XP

9th December 2003

0 Uploads

71,460 Posts

0 Threads

#2 14 years ago

awesome! i can't help you with the code though (i know how the init.con works etc. but the real complicate code is far above my skill level :( ) Try to contact an FH dev?

codingteam.jpg

Erich Hartmann - Lead Coder - [email="Burning_phoenix@gmx.de"]mail[/email] pm

D Fast - Coder/Importer - [email="D_FAST1@msn.com"]mail[/email] pm

or try TigerTeufel (not an FH dev)




Hail of Nails

I want to be like Revenge

50 XP

13th June 2004

0 Uploads

376 Posts

0 Threads

#3 14 years ago

I was trying to get this to work as well, but I when I spawned, BF would crash. I think I'm wrong in assuming some of the targets of the code.... and that's my problem. That, or having the file in my map directory has fudged some of the filetrees the code is expecting.




D-Fens

uwe bolltastic!

50 XP

2nd May 2003

0 Uploads

4,837 Posts

0 Threads

#4 14 years ago

Hmm so no random headgear with random skin?




SacredLizard

Its cupnoodles not cuponoodles

50 XP

23rd April 2004

0 Uploads

918 Posts

0 Threads

#5 14 years ago

It seems that way, but there are a few things that haven't been working yet. I figure that someone who knows the code could figure everything out quite easily. As it is, having the hats and the uniforms linked is quite interesting because I always thought that the hats were linked to kits quite solidly.




Hail of Nails

I want to be like Revenge

50 XP

13th June 2004

0 Uploads

376 Posts

0 Threads

#6 14 years ago

A question, Sacred Lizard.... Do you have as many hats as you have uniforms? That is to say, like 3 hats, and 3 uniforms? I found that the setRandomGeometries for hats doesn't select a hat randomly, but uses the numbers and goes in order. I had three hats, and PolHelm1 always appears first, PolHelm2 appears second, and Polhelm3 appears third, rinse, repeat. If you have three uniforms as well as three helmets, it may not be that the helmets are linked to the uniforms, but that the "random" is always pairing one hat with one uniform, so "Uniform1" and "Hat1" will always be together, since there are three of each. If this is indeed the case, perhaps adding an extra hat will throw off the order, and you can get different hats on different uniforms. And if you could, I'd like to see some of your code, and where you've put it. When I worked the code, I placed it in my map/objects directory, like I would any regular kit. But like I said, I may be messing with filetrees that the code expects to be intact to work. Other than that, I followed the same procedure to get random heads to work.




SacredLizard

Its cupnoodles not cuponoodles

50 XP

23rd April 2004

0 Uploads

918 Posts

0 Threads

#7 14 years ago

Hail of Nails, I guess I cheated. At first I was trying to get the uniforms to be really random, but the my custom standard meshes wouldn't read because my coding is off. So then what I did was I changed the number of different "simple objects" in the soldier/objects.con, and then (the real thing that makes this work) I went into the geometries. Instead of using the same geometry each time, I used ones from different countries which I knew I could attach a different uniform to. (i am using british, desert german, regular german, and canadian geometries and meshes) anyway, here is the code: ..bf1942/levels/Ponyri_Station/objects/soldiers/germanDesertSoldier/objects: ObjectTemplate.create BFSoldier GermanDesertSoldier ObjectTemplate.createSkeleton animations/UsSoldier.ske include ../Common/CommonSoldierData.inc rem Sound.addRunTimeDirectory Language German game.addLanguageRunTimeDirectory German include ../Common/Sounds/SoldierSound.inc ObjectTemplate.setSoldierStandingIcon "Soldier/Icon_ger_soldier_standing.tga" ObjectTemplate.setSoldierCrouchIcon "Soldier/Icon_ger_soldier_crouching.tga" ObjectTemplate.setSoldierProneIcon "Soldier/Icon_ger_soldier_lying.tga" ObjectTemplate.setMinimapIcon "flag_ger.tga" ObjectTemplate.setControlPointIcon "conp_ger.tga" ObjectTemplate.setTicketIcon "flag_ticket_ger.tga" ObjectTemplate.setTeamFlagIcon "Icon_flag_ger.tga" ObjectTemplate.setRadioLanguage "German" ObjectTemplate.addTemplate GerSoldierComplexHead ObjectTemplate.setRandomGeometries 9 ObjectTemplate.setIsFirstPersonPart 0 ObjectTemplate.setLodValue 0.01 ObjectTemplate.bindToSkeletonPart Bip01_Spine3 3 ObjectTemplate.addTemplate GerSoldierHead ObjectTemplate.setIsFirstPersonPart 0 ObjectTemplate.setLodValue -0.01 ObjectTemplate.addTemplate DesGerSoldier3PBody ObjectTemplate.setRandomGeometries 9 ObjectTemplate.setIsFirstPersonPart 0 ObjectTemplate.addTemplate DesGerSoldier1PBody ObjectTemplate.setIsFirstPersonPart 1 ObjectTemplate.addTemplate GerSoldierRightHand ObjectTemplate.setIsFirstPersonPart 0 ObjectTemplate.setLodValue 0.03 ObjectTemplate.addTemplate GerSoldierLeftHand ObjectTemplate.setIsFirstPersonPart 0 ObjectTemplate.setLodValue 0.03 ObjectTemplate.addTemplate 1PGerSoldierRightHand ObjectTemplate.setIsFirstPersonPart 1 ObjectTemplate.setLodValue 0.03 ObjectTemplate.addTemplate 1PGerSoldierLeftHand ObjectTemplate.setIsFirstPersonPart 1 ObjectTemplate.setLodValue 0.03 rem**germanUniforms ObjectTemplate.create SimpleObject DesGerSoldier3PBody1 ObjectTemplate.geometry Soldier/3PDesGerBody1 ObjectTemplate.hasDynamicShadow 1 ObjectTemplate.create SimpleObject DesGerSoldier3PBody2 ObjectTemplate.geometry Soldier/3PDesGerBody2 ObjectTemplate.hasDynamicShadow 1 ObjectTemplate.create SimpleObject DesGerSoldier3PBody3 ObjectTemplate.geometry Soldier/3PDesGerBody3 ObjectTemplate.hasDynamicShadow 1 ObjectTemplate.create SimpleObject DesGerSoldier3PBody4 ObjectTemplate.geometry Soldier/3PDesGerBody1 ObjectTemplate.hasDynamicShadow 1 ObjectTemplate.create SimpleObject DesGerSoldier3PBody5 ObjectTemplate.geometry Soldier/3PDesGerBody2 ObjectTemplate.hasDynamicShadow 1 ObjectTemplate.create SimpleObject DesGerSoldier3PBody6 ObjectTemplate.geometry Soldier/3PDesGerBody3 ObjectTemplate.hasDynamicShadow 1 ObjectTemplate.create SimpleObject DesGerSoldier3PBody7 ObjectTemplate.geometry Soldier/3PDesGerBody1 ObjectTemplate.hasDynamicShadow 1 ObjectTemplate.create SimpleObject DesGerSoldier3PBody8 ObjectTemplate.geometry Soldier/3PDesGerBody2 ObjectTemplate.hasDynamicShadow 1 ObjectTemplate.create SimpleObject DesGerSoldier3PBody9 ObjectTemplate.geometry Soldier/3PDesGerBody2 ObjectTemplate.hasDynamicShadow 1 ObjectTemplate.create AnimatedBundle GerSoldierComplexHead1 rem *** SHOULD BE UsFace.Ske on every nationality. ObjectTemplate.createSkeleton animations/UsFace.ske ObjectTemplate.geometry Soldier/GerComplexHead1 ObjectTemplate.hasDynamicShadow 1 ObjectTemplate.create AnimatedBundle GerSoldierComplexHead2 rem *** SHOULD BE UsFace.Ske on every nationality. ObjectTemplate.createSkeleton animations/UsFace.ske ObjectTemplate.geometry Soldier/GerComplexHead2 ObjectTemplate.hasDynamicShadow 1 ObjectTemplate.create AnimatedBundle GerSoldierComplexHead3 rem *** SHOULD BE UsFace.Ske on every nationality. ObjectTemplate.createSkeleton animations/UsFace.ske ObjectTemplate.geometry Soldier/GerComplexHead3 ObjectTemplate.hasDynamicShadow 1 ObjectTemplate.create AnimatedBundle GerSoldierComplexHead4 rem *** SHOULD BE UsFace.Ske on every nationality. ObjectTemplate.createSkeleton animations/UsFace.ske ObjectTemplate.geometry Soldier/GerComplexHead1 rem Soldier/GerComplexHead4 ObjectTemplate.hasDynamicShadow 1 ObjectTemplate.create AnimatedBundle GerSoldierComplexHead5 rem *** SHOULD BE UsFace.Ske on every nationality. ObjectTemplate.createSkeleton animations/UsFace.ske ObjectTemplate.geometry Soldier/GerComplexHead1 ObjectTemplate.hasDynamicShadow 1 ObjectTemplate.create AnimatedBundle GerSoldierComplexHead6 rem *** SHOULD BE UsFace.Ske on every nationality. ObjectTemplate.createSkeleton animations/UsFace.ske ObjectTemplate.geometry Soldier/GerComplexHead2 ObjectTemplate.hasDynamicShadow 1 ObjectTemplate.create AnimatedBundle GerSoldierComplexHead7 rem *** SHOULD BE UsFace.Ske on every nationality. ObjectTemplate.createSkeleton animations/UsFace.ske ObjectTemplate.geometry Soldier/GerComplexHead3 ObjectTemplate.hasDynamicShadow 1 ObjectTemplate.create AnimatedBundle GerSoldierComplexHead8 rem *** SHOULD BE UsFace.Ske on every nationality. ObjectTemplate.createSkeleton animations/UsFace.ske ObjectTemplate.geometry Soldier/GerComplexHead2 rem Soldier/GerComplexHead4 ObjectTemplate.hasDynamicShadow 1 ObjectTemplate.create AnimatedBundle GerSoldierComplexHead9 rem *** SHOULD BE UsFace.Ske on every nationality. ObjectTemplate.createSkeleton animations/UsFace.ske ObjectTemplate.geometry Soldier/GerComplexHead3 rem Soldier/GerComplexHead4 ObjectTemplate.hasDynamicShadow 1 ObjectTemplate.create SimpleObject GerSoldierHead ObjectTemplate.geometry Soldier/GerHead ObjectTemplate.hasDynamicShadow 1 ObjectTemplate.create SimpleObject GerSoldierLeftHand ObjectTemplate.geometry Soldier/GerLeftHand ObjectTemplate.create SimpleObject GerSoldierRightHand ObjectTemplate.geometry Soldier/GerRightHand ObjectTemplate.create SimpleObject 1PGerSoldierLeftHand ObjectTemplate.geometry Soldier/1PGerLeftHand ObjectTemplate.create SimpleObject 1PGerSoldierRightHand ObjectTemplate.geometry Soldier/1PGerRightHand ..bf1942/levels/Ponyri_Station/objects/soldiers/germanDesertSoldier/geometries: GeometryTemplate.create AnimatedMesh Soldier/1PDesGerBody GeometryTemplate.setSkin animations/1PDesGerBody.skn GeometryTemplate.file 1PDesGerBody GeometryTemplate.create AnimatedMesh Soldier/1PGerLeftHand GeometryTemplate.setSkin animations/1PGerLeftHand.skn GeometryTemplate.file 1PGerLeftHand GeometryTemplate.create AnimatedMesh Soldier/1PGerRightHand GeometryTemplate.setSkin animations/1PGerRightHand.skn GeometryTemplate.file 1PGerRightHand GeometryTemplate.create AnimatedMesh Soldier/3PDesGerBody1 GeometryTemplate.setSkin animations/DesGerBody.skn GeometryTemplate.file DesGerBody GeometryTemplate.setLodRange 0 0 1 30 2 80 GeometryTemplate.setLodRange 3 150 4 210 5 230 GeometryTemplate.setLodPercent 0 1.0 GeometryTemplate.setLodPercent 1 0.7 GeometryTemplate.setLodPercent 2 0.3 GeometryTemplate.setLodPercent 3 0.2 GeometryTemplate.setLodPercent 4 0.1 GeometryTemplate.setLodPercent 5 0.05 GeometryTemplate.create AnimatedMesh Soldier/3PDesGerBody2 GeometryTemplate.setSkin animations/BritBody.skn GeometryTemplate.file BritBody GeometryTemplate.setLodRange 0 0 1 30 2 80 GeometryTemplate.setLodRange 3 150 4 210 5 230 GeometryTemplate.setLodPercent 0 1.0 GeometryTemplate.setLodPercent 1 0.7 GeometryTemplate.setLodPercent 2 0.3 GeometryTemplate.setLodPercent 3 0.2 GeometryTemplate.setLodPercent 4 0.1 GeometryTemplate.setLodPercent 5 0.05 GeometryTemplate.create AnimatedMesh Soldier/3PDesGerBody3 GeometryTemplate.setSkin animations/GerBody.skn GeometryTemplate.file GerBody GeometryTemplate.setLodRange 0 0 1 30 2 80 GeometryTemplate.setLodRange 3 150 4 210 5 230 GeometryTemplate.setLodPercent 0 1.0 GeometryTemplate.setLodPercent 1 0.7 GeometryTemplate.setLodPercent 2 0.3 GeometryTemplate.setLodPercent 3 0.2 GeometryTemplate.setLodPercent 4 0.1 GeometryTemplate.setLodPercent 5 0.05 GeometryTemplate.create AnimatedMesh Soldier/3PDesGerBody4 GeometryTemplate.setSkin animations/BritBody.skn GeometryTemplate.file BritBody GeometryTemplate.setLodRange 0 0 1 30 2 80 GeometryTemplate.setLodRange 3 150 4 210 5 230 GeometryTemplate.setLodPercent 0 1.0 GeometryTemplate.setLodPercent 1 0.7 GeometryTemplate.setLodPercent 2 0.3 GeometryTemplate.setLodPercent 3 0.2 GeometryTemplate.setLodPercent 4 0.1 GeometryTemplate.setLodPercent 5 0.05 GeometryTemplate.create AnimatedMesh Soldier/3PDesGerBody5 GeometryTemplate.setSkin animations/canadian_body.skn GeometryTemplate.file Canadian_body GeometryTemplate.hasDynamicShadow 1 GeometryTemplate.setLodRange 0 0 1 30 2 80 GeometryTemplate.setLodRange 3 150 4 210 5 230 GeometryTemplate.setLodPercent 0 1.0 GeometryTemplate.setLodPercent 1 0.7 GeometryTemplate.setLodPercent 2 0.3 GeometryTemplate.setLodPercent 3 0.2 GeometryTemplate.setLodPercent 4 0.1 GeometryTemplate.setLodPercent 5 0.05 GeometryTemplate.create AnimatedMesh Soldier/3PDesGerBody6 GeometryTemplate.setSkin animations/canadian_body.skn GeometryTemplate.file Canadian_body GeometryTemplate.hasDynamicShadow 1 GeometryTemplate.setLodRange 0 0 1 30 2 80 GeometryTemplate.setLodRange 3 150 4 210 5 230 GeometryTemplate.setLodPercent 0 1.0 GeometryTemplate.setLodPercent 1 0.7 GeometryTemplate.setLodPercent 2 0.3 GeometryTemplate.setLodPercent 3 0.2 GeometryTemplate.setLodPercent 4 0.1 GeometryTemplate.setLodPercent 5 0.05 GeometryTemplate.create AnimatedMesh Soldier/3PDesGerBody7 GeometryTemplate.setSkin animations/BritBody.skn GeometryTemplate.file BritBody GeometryTemplate.setLodRange 0 0 1 30 2 80 GeometryTemplate.setLodRange 3 150 4 210 5 230 GeometryTemplate.setLodPercent 0 1.0 GeometryTemplate.setLodPercent 1 0.7 GeometryTemplate.setLodPercent 2 0.3 GeometryTemplate.setLodPercent 3 0.2 GeometryTemplate.setLodPercent 4 0.1 GeometryTemplate.setLodPercent 5 0.05 GeometryTemplate.create AnimatedMesh Soldier/3PDesGerBody8 GeometryTemplate.setSkin animations/GerBody.skn GeometryTemplate.file GerBody GeometryTemplate.setLodRange 0 0 1 30 2 80 GeometryTemplate.setLodRange 3 150 4 210 5 230 GeometryTemplate.setLodPercent 0 1.0 GeometryTemplate.setLodPercent 1 0.7 GeometryTemplate.setLodPercent 2 0.3 GeometryTemplate.setLodPercent 3 0.2 GeometryTemplate.setLodPercent 4 0.1 GeometryTemplate.setLodPercent 5 0.05 GeometryTemplate.create AnimatedMesh Soldier/3PDesGerBody9 GeometryTemplate.setSkin animations/canadian_body.skn GeometryTemplate.file Canadian_body GeometryTemplate.hasDynamicShadow 1 GeometryTemplate.setLodRange 0 0 1 30 2 80 GeometryTemplate.setLodRange 3 150 4 210 5 230 GeometryTemplate.setLodPercent 0 1.0 GeometryTemplate.setLodPercent 1 0.7 GeometryTemplate.setLodPercent 2 0.3 GeometryTemplate.setLodPercent 3 0.2 GeometryTemplate.setLodPercent 4 0.1 GeometryTemplate.setLodPercent 5 0.05 GeometryTemplate.create AnimatedMesh Soldier/GerComplexHead1 GeometryTemplate.setSkin animations/Ger1Face.skn GeometryTemplate.file Ger1Face GeometryTemplate.setLodRange 0 0 1 3 2 10 GeometryTemplate.setLodPercent 0 1.0 GeometryTemplate.setLodPercent 1 0.6 GeometryTemplate.setLodPercent 2 0.3 GeometryTemplate.create AnimatedMesh Soldier/GerComplexHead2 GeometryTemplate.setSkin animations/Ger2Face.skn GeometryTemplate.file Ger2Face GeometryTemplate.setLodRange 0 0 1 3 2 10 GeometryTemplate.setLodPercent 0 1.0 GeometryTemplate.setLodPercent 1 0.6 GeometryTemplate.setLodPercent 2 0.3 GeometryTemplate.create AnimatedMesh Soldier/GerComplexHead3 GeometryTemplate.setSkin animations/Ger3Face.skn GeometryTemplate.file Ger3Face GeometryTemplate.setLodRange 0 0 1 3 2 10 GeometryTemplate.setLodPercent 0 1.0 GeometryTemplate.setLodPercent 1 0.6 GeometryTemplate.setLodPercent 2 0.3 GeometryTemplate.create AnimatedMesh Soldier/GerComplexHead4 GeometryTemplate.setSkin animations/DAK_Face.skn GeometryTemplate.file DAK_Face GeometryTemplate.setLodRange 0 0 1 3 2 10 GeometryTemplate.setLodPercent 0 1.0 GeometryTemplate.setLodPercent 1 0.6 GeometryTemplate.setLodPercent 2 0.3 GeometryTemplate.create AnimatedMesh Soldier/GerHead GeometryTemplate.setSkin animations/GerHead.skn GeometryTemplate.file GerHead GeometryTemplate.setLodRange 0 0 1 10 2 30 GeometryTemplate.setLodRange 3 50 4 60 5 100 GeometryTemplate.setLodPercent 0 1.0 GeometryTemplate.setLodPercent 1 0.6 GeometryTemplate.setLodPercent 2 0.3 GeometryTemplate.setLodPercent 3 0.2 GeometryTemplate.setLodPercent 4 0.1 GeometryTemplate.setLodPercent 5 0.03 GeometryTemplate.create AnimatedMesh Soldier/GerLeftHand GeometryTemplate.setSkin animations/GerLeftHand.skn GeometryTemplate.file GerLeftHand GeometryTemplate.setLodRange 0 0 1 20 2 50 GeometryTemplate.setLodPercent 0 1.0 GeometryTemplate.setLodPercent 1 0.6 GeometryTemplate.setLodPercent 2 0.03 GeometryTemplate.create AnimatedMesh Soldier/GerRightHand GeometryTemplate.setSkin animations/GerRightHand.skn GeometryTemplate.file GerRightHand GeometryTemplate.setLodRange 0 0 1 20 2 50 GeometryTemplate.setLodPercent 0 1.0 GeometryTemplate.setLodPercent 1 0.6 GeometryTemplate.setLodPercent 2 0.03 NOTE: these don't work If you don't go get the "soldiers/common/objects" and put it in your map and run it. One major bug is that you become "sticky" and to "unstick" yourself, crouch or hop into a vehicle, or lie prone.




SacredLizard

Its cupnoodles not cuponoodles

50 XP

23rd April 2004

0 Uploads

918 Posts

0 Threads

#8 14 years ago

Sorry for the double post, but you are right about the random hats. I have found that I can only get three different uniforms to work at once, and I have no Idea why this is. Here are some more pics:




Hail of Nails

I want to be like Revenge

50 XP

13th June 2004

0 Uploads

376 Posts

0 Threads

#9 14 years ago

Ah, you need the common files. I should have thought of that. Alrighty then.... Still haven't talked to a coder about this? Maybe one can solve the "sticky" problem. It works in my map with the sticky bug, but the only way I can get a different uniform to show up is if I switch teams, then switch back. This random thing WILL work, because the Devs have made it so random spawn equipment will show up up in 0.65, according to my sources... So it is possible. We can make it work. Or just wait until 0.65...




SacredLizard

Its cupnoodles not cuponoodles

50 XP

23rd April 2004

0 Uploads

918 Posts

0 Threads

#10 14 years ago

I sent out a message to Major Hartmann, and he is looking into it. It really is quite puzzling, though. It seems that the answer could be (or at least relates to) the AI objects file, but whenever I run it, I crash before loading the map.




  • 1
  • 2