Results 1 to 4 of 4

Thread: how to get AI to recognize a flashlight from the player

  1. #1
    fuarker
    Guest

    how to get AI to recognize a flashlight from the player

    I have an issue with my AI, I got it to recognize my player and to allow it to enter a follow and an attack state. And for my game there is a toogleable flashlight and I want to use that as a cue for my AI to see that as a cue to investigate it. Any ideas??? all help is appreciated

    FYI i only have a very basic AI in case it matters. And i am not a very good programmer

  2. #2
    VendorX
    Guest
    What you use for display flashlight in Level..?
    BTW. find sourse code from game that use this interaction ie. Splinter Cell.
    ...
    FYI i only have a very basic AI in case it matters. And i am not a very good programmer
    ...
    ...that's bad.

  3. #3
    fuarker
    Guest
    class G3N3_Flashlight extends SpotLightMovable
    notplaceable;

    defaultproperties
    {
    Begin Object Name=SpotLightComponent0
    LightColor=(R=0,G=255,B=0)
    CastShadows=true
    bEnabled=true
    Radius=500.000000
    InnerConeAngle=10
    OuterConeAngle=30
    LightShaftConeAngle=45
    Brightness=1
    BloomScale=50
    BloomThreshold=50
    BloomScreenBlendThreshold=10
    BloomTint=(R=0,G=255,B=0)
    RadialBlurPercent=50

    CastStaticShadows=True
    CastDynamicShadows=True
    bCastCompositeShadow=true
    bAffectCompositeShadowDirection=true
    End Object

    bNoDelete=false
    }

    this is my flashlight code and here is how i called it out

    var G3N3_Flashlight FlashLight;

    simulated function PostBeginPlay()
    {
    FlashLight = Spawn(class'G3N3_Flashlight', self);
    SkeletalMeshComponent(Mesh).AttachComponentToSocke t(FlashLight.LightComponent, 'MF');
    //FlashLight.LightComponent.SetEnabled(self.default. bIsFlashlightOn);
    super.PostBeginPlay();
    }

    //------------------------------------------------------------------------------
    // ToggleFlashlight()
    //------------------------------------------------------------------------------
    exec function ToggleFlashlight()
    {
    if(!FlashLight.LightComponent.bEnabled)
    {
    FlashLight.LightComponent.SetEnabled(true);
    }
    else
    {
    FlashLight.LightComponent.SetEnabled(false);
    }
    }

  4. #4
    HKLM
    Guest
    You need some code to tell the bots what to do when they see the light. This article should help point you in the right direction
    udn.epicgames.com/.../CharactersTechnicalGuide.html#Decision Making

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •