Post Topic: Re: [Crysis 2] Helmet-mounted flashlight
Posted 26.05.2012, 00:19
@OCASM Actually it's pretty easy Well probably you have to move a Tagpoint to the players position and then link an other tagpoint to the first one. Now you can move the flashlight every 0.01 second to Tagpoint2. It will look like the flaslight is linked tho the payer
Post Topic: Re: [Crysis 2] Helmet-mounted flashlight
Posted 26.05.2012, 19:36
@ODemuth Yes, you're right. The position for the "attached" object is easy, but the direction was the problem. I think I've fixed that now.
@USSR_GRAND You can find my attempt in the attached file in this post. The light position isn't quite right yet so I disabled the shadows but you can make your own adjustments if you want to.
INSTRUCTIONS: 1. Unzip the XML file in your Prefabs folder. 2. In your level, open the prefab library called custom_playerflashlight.xml 3. Place it anywhere inside the level. 4. Extract all the components. 5. Link the playerFlashLight and playerFlashLightFill lights to the playerFlashLightProxy tagpoint. 6. Play the game. The key "k" activates/deactivates the flashlight
Notes: -Haven't checked yet, but I think it works only inside the editor for now ^^u -If your level is outdoors you will need to enclose it using invisible solids. Otherwise when you look at the sky the raycast won't hit anything and the flashlight won't update its direction, looking weird / wrong.
Post Topic: Re: [Crysis 2] Helmet-mounted flashlight
Posted 27.05.2012, 15:48
@coheed82 You could use VokusX's method, but an easier way is just to create a folder called "Prefabs" inside gamecrysis2 and put the file in there.
The prefab consists of three files: -playerFlashLight. -playerFlashLightFill (this one is optional, you can disable/delete it if you want). -playerFlashLightProxy.
The first two should be linked to the last one, which will be then synchronized with the player's position and direction via flowgraph automatically when you're in-game. I linked them to offset their positions relative to the player because while it could be done in flowgraph, it would require vector math at which I completely suck. Linking them to the proxy is just easier xD
Post Topic: Re: [Crysis 2] Helmet-mounted flashlight
Posted 28.05.2012, 08:24
Thankyou very much to VokusX and to OCASM! yeah it works, i just put the file in the new "prefabs" folder under gamecrysis2.. also i put it in the gamedata.pak as well. it came up with a window though regarding said file being added to the gamedata.pak something about it being added to the MOD folder.. i guess i'll have to add the custom_playerFlashLight.xml into my MOD folder of my level for when im ready to ship it out. Of course you two will be in the credits of my map.
i admit it i've actually begun work on a new map.. kind of a side project from the one im currently showing on the cryengine 3 forum.. as we all know we get better as we go, and as such this new "secret" map has me blown away, let alone what you guys may think when you see it thanks again.
My all new Professional Portfolio is here.. Take a visit here to get into the mindset that is me!
Post Topic: Re: [Crysis 2] Helmet-mounted flashlight
Posted 31.07.2012, 22:53
Hey i love the idea and id love to give u credit it my map but i cant seem to get the custom player flashlight to work. I am new so it is probably something simple that i cannot see and id be grateful if u could help me. So i got the 3 files in the prefab into the game by extracting them all and i linked playerflashlightfill to the playerflashlightproxy but it would not let me select the playerflashlight so that i could link it again to the playerflashlightproxy ik its prob something simple but thanks in advance and the flashlight looks amazing xD
Post Topic: Re: [Crysis 2] Helmet-mounted flashlight
Posted 01.08.2012, 21:57
You're in luck. I just discovered that you can in fact make prefabs out of linked objects. Just select the parent and only the parent when you make the prefab. If you select the children it won't work.
So, given that, here are updated versions of the prefabs. You don't have to manually link all the components anymore!
Here are the updated instructions on how to use them:
For the AI flashlight:
1. Place the flashLightHeadA.pak file inside the gamecrysis2 folder. 2. In your level, open the prefab library called CUSTOM.xml. 3. Place the flashLightHeadA prefab next to a soldier and extract it all. 4. Link the flashLightHeadAProxy to the AI you want it to be attached to. 5. Go to the flashLightHeadAProxy flowgraph and assign the chosen soldier to the only unassigned flownode. 6. That's it! After that you can just copy the soldier and all the attached parts will be copied as well. If you just want to copy the flashlight, just unlink it from the soldier.
For the player flashlight:
1. Make a folder named "Prefabs" inside your GameCrysis2 directory. It can be your mod's or the standard one. 2. Unzip the file "custom_playerflashlight.xml" inside it. 3. In your level, open the prefab library called custom_playerflashlight.xml 3. Place the prefab anywhere inside the level. 4. That's it. You don't have to extract anything unless you want to make modifications to the lights.