Announcement

Collapse

The Infinity Blade Forums Have Moved

We've launched brand new Infinity Blade forums with improved features and revamped layout. We've also included a complete archive of the previous posts. Come check out the new Infinity Blade forums.
See more
See less

UDK Flashlight Tutorial!

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

    #16
    Ok so I found out how to get it working the only thing is its not exactly what I want I need to change the speed of the player to be slower because its a horror game also I need the light to be toggable and for me to import a flashlight mesh I have and the last thing is change the hud any ideas?

    Comment


      #17
      -to get a flashlight mesh -> take a look at my custom weapon tutorial = there you can add a mesh and you have a light
      -for the HUD -> search on youtube for a custom hud tutorial
      -to change the movement speed -> http://www.youtube.com/watch?v=H0qD53W9m1w
      -to toggel it you have to add a function to the script, but I cant help you with that

      When I'm at home I can post you another way how to toggel a flashlight ^^

      Comment


        #18
        Fighter,

        Thanks for posting this, along with the video. Very clear and easy to follow. I find that, contrary to the popular expression, on these forums "those who can, teach." Thanks again.

        Cheers.

        Comment


          #19
          Originally posted by Djohn View Post
          Fighter,

          Thanks for posting this, along with the video. Very clear and easy to follow. I find that, contrary to the popular expression, on these forums "those who can, teach." Thanks again.

          Cheers.
          Nice, that you like the tutorial

          Comment


            #20
            It would be awesome if you put a vid on toggel flashlight on sorry for asking so many questions but were do I begin to make my own game script by that I mean not using the UTdeadthmatch,Teamdeathmatch etc I know you have to make your own package with your own scripting at some point in developing a game

            Comment


              #21
              Originally posted by Vicktor1985 View Post
              It would be awesome if you put a vid on toggel flashlight on sorry for asking so many questions but were do I begin to make my own game script by that I mean not using the UTdeadthmatch,Teamdeathmatch etc I know you have to make your own package with your own scripting at some point in developing a game
              I recommend you to ask this in the programming section of the forum, because there you will get a better answer

              Comment


                #22
                Thanks for this tutorial...I appreciate you for taking the time to make it...

                Comment


                  #23
                  Perfect tutorial. Straight to the point and worked the first time like a champ. Thanks!

                  I just wanted to add this in case people find it useful. I am by no means an unrealscript developer. My primary languages are Java & Ruby.

                  This is a twist on the flashlight provided. This flashlight starts off and toggles on/off with the fire button. No mesh. Just an on/off flashlight. There may be a more elegant way to do this but it does what I was looking for.

                  Code:
                  class Flashlight_2 extends UTWeapon;
                  
                  var bool LightIsOn;
                  var SpotLightComponent FlashLightComponent;
                  
                  simulated function StopFire(byte FireModeNum)
                  {
                  	Super.StopFire(FireModeNum);
                  
                  	if(LightIsOn) {
                  		LightIsOn = false;
                  		FlashLightComponent.SetEnabled(false);
                  	}
                  	else {
                  		LightIsOn = true;
                  		FlashLightComponent.SetEnabled(true);
                  	}
                  }
                  
                  defaultproperties
                  {
                  
                  LightIsOn = false
                  begin object Class=SpotLightComponent Name=SpotLightComponent0
                  Radius=1000
                  Brightness=3
                  LightColor=(R=255,G=240,B=190)
                  CastShadows=true
                  bEnabled=false
                  end object
                  Components.Add(SpotLightComponent0)
                  
                  FlashLightComponent = SpotLightComponent0
                  
                  }

                  Comment


                    #24
                    Nice, thank you for posting -> I will add a link to that to my video

                    Comment


                      #25
                      SIR how did u add a GUN along with that flashlight ??

                      Comment


                        #26
                        Originally posted by 200karar View Post
                        SIR how did u add a GUN along with that flashlight ??
                        You just have to add this code line into the default properties of the weapon.

                        e.g

                        Code:
                        Class UTWeap_TestWeap extends UTWeapon;
                        
                        defaultproperties
                        {
                        Begin Object Class=AnimNodeSequence Name=MeshSequenceA
                        End Object
                        
                        Begin Object Name=PickupMesh
                        SkeletalMesh=SkeletalMesh'Weapon_1_Mesh.*Mi6_1P'
                        End Object
                        
                        Begin Object Name=FirstPersonMesh
                        SkeletalMesh=SkeletalMesh'Weapon_1_Mesh.*Mi6_1P'
                        Rotation=(Yaw=-16384)
                        FOV=60.0
                        AnimSets(0)=AnimSet'Weapon_1_Mesh.Mi6_1P*_Anims'
                        AnimSets(1)=AnimSet'Weapon_1_Mesh.Mi6_1P*_Anims'
                        Animations=MeshSequenceA
                        End Object
                        
                        InstantHitDamage(0)=20
                        InstantHitDamage(1)=20
                        FireInterval(0)=0.1
                        FireInterval(1)=0.1
                        
                        WeaponFireSnd(0)=SoundCue'Weapon_1_Mesh.*m41'
                        WeaponFireSnd(1)=SoundCue'Weapon_1_Mesh.*m41'
                        WeaponEquipSnd=SoundCue'Weapon_1_Mesh.EQ*UIP'
                        WeaponPutDownSound=SoundCue'Weapon_1_Mes*h.EQUIP'
                        PickupSound=SoundCue'Weapon_1_Mesh.EQUIP*'
                        
                        WeaponFireAnim(0)=WeaponFire
                        WeaponFireAnim(1)=WeaponFire
                        
                        AttachmentClass=Class'UTAttachment_TestW*eap'
                        
                        ShotCost(0)=1
                        ShotCost(1)=1
                        
                        MaxAmmoCount=150
                        AmmoCount=150
                        
                        WeaponRange=20000
                        
                        MessageClass=Class'UTPickupMessage'
                        DroppedPickupClass=Class'UTDroppedPickup*'
                        
                        begin object Class=SpotLightComponent Name=SpotLightComponent0
                        Radius=1000
                        Brightness=3
                        LightColor=(R=255,G=240,B=190)
                        CastShadows=false
                        end object
                        Components.Add(SpotLightComponent0)
                        
                        }

                        Comment


                          #27
                          A flesh light tut would be noice


                          Sent from my iPhone using Tapatalk

                          Comment


                            #28
                            Originally posted by Kelt'ar View Post
                            A flesh light tut would be noice

                            Comment


                              #29
                              Never mind and ignore I said that


                              Sent from my iPhone using Tapatalk

                              Comment


                                #30
                                I know this is almost a year old, but it is perfect for one of my assignments at university. I can not get it to work though =(

                                Here are the screen shots of 3rdfoundation's version of the code as well as the errors I get when rebuilding. Any advice on how to get this working would be great!


                                Scratch that, as soon as I posted I figured out I needed to make the var and script names the exact same.

                                Now the question is, how do I toggle it on and off?



                                And again, nevermind. Got it all working. Thank you for this tutorial =D

                                Comment

                                Working...
                                X