Thread: Switchable Texture Lighting

Results 1 to 6 of 6
  1. #1
    Registered User
    Join Date
    Jul 2019
    Posts
    13

    Switchable Texture Lighting

    I'm attempting to create some switchable texture lights with little success. I've tried following the guidance here:

    https://twhl.info/wiki/page/Tutorial:_Light

    Despite this, the lights are refusing to toggle and I'm at a loss as to why. Has the methodology changed since this guidance was written? Any assistance would be appreciated!

  2. #2
    Administrator AdamR's Avatar  
    Manager
    Join Date
    Mar 2004
    Location
    Cardiff, South Wales [UK]
    Posts
    8,593

    Re: Switchable Texture Lighting

    I guess the lights have a targetname, and you've not ticked the "remove entity" flag? (Oh, and you didn't use "light_environment"?)
    Adam "Adambean" Reece
    Sven Co-op team

    Also on: Steam | Facebook | Twitter | YouTube | Twitch
    Released AMXX plug-ins: Bind number slots | NextMap with Sven Co-op fix | Sven Co-op administrator icons

  3. #3
    Administrator Hezus's Avatar  
    Manager
    Join Date
    Aug 2001
    Location
    The Netherlands
    Posts
    9,054

    Re: Switchable Texture Lighting

    You'd need to use the light_surface entity for this. I've got toggeable texture lights in my light prefabs here: https://forums.svencoop.com/showthre...-glow-sprites)

  4. #4
    Registered User
    Join Date
    Jul 2019
    Posts
    13

    Re: Switchable Texture Lighting

    To clarify:

    I'm using texture lighting in general successfully throughout the map, all emitting light constantly and not switchable.
    I'm using light_surface entities to specify the lighting etc. for these textures.
    There is a particular set of lights which I'm attempting to make switchable, starting initially off and then being turned on by the player.
    These lights utilise the same texture as used elsewhere.
    I've tied them to func_wall entities, named them and chosen grouped from the texstyle options.
    I've created a light entity, named it to match the func_walls and flagged 'initially dark'.
    The light entity is set up to emit no actual light (1 1 1 0.1).
    I've created a fun_button which targets the light and func_wall name.

    On loading the map, the lights are already active and pressing the button has no effect (though it does trigger other related effects as intended). I've tried flagging and unflagging 'remove entity' with no change.

  5. #5
    Administrator AdamR's Avatar  
    Manager
    Join Date
    Mar 2004
    Location
    Cardiff, South Wales [UK]
    Posts
    8,593

    Re: Switchable Texture Lighting

    Quote Originally Posted by Frel2.0 View Post
    The light entity is set up to emit no actual light (1 1 1 0.1).
    There is your issue. You must set the light RGBL to represent the on state of your light, as this is what the RAD compile tool will compute lighting patches for.

    You then correctly use the "initially dark" flag to signify that you want your light to be off until told otherwise at runtime, so the RAD compile tool will also compute additional light patches as if this light didn't exist.

    The light is likely working fine, but in its on state it's only emitting a smidge of photons.
    Last edited by AdamR; 15-08-2019 at 02:54 AM.
    Adam "Adambean" Reece
    Sven Co-op team

    Also on: Steam | Facebook | Twitter | YouTube | Twitch
    Released AMXX plug-ins: Bind number slots | NextMap with Sven Co-op fix | Sven Co-op administrator icons

  6. #6
    Registered User
    Join Date
    Jul 2019
    Posts
    13

    Re: Switchable Texture Lighting

    Having tried the various suggestions without success, I went back to basics and ended up with something workable (even if perhaps it's not how it's meant to work!):

    I copied the light texture being used successfully elsewhere (not switchable) and renamed it.
    I then created a new light_surface for the renamed texture, set it to initially dark and named it to match the lights.

    This seems to work, allowing me turn the relevant lights on and off at will.

    Thanks to all for the troubleshooting help regardless!

Posting Permissions

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