1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Two Factor Authentication is now available on BeyondUnreal Forums. To configure it, visit your Profile and look for the "Two Step Verification" option on the left side. We can send codes via email (may be slower) or you can set up any TOTP Authenticator app on your phone (Authy, Google Authenticator, etc) to deliver codes. It is highly recommended that you configure this to keep your account safe.

UE3 - UT3 Possible to change an mesh's texture in-game?

Discussion in 'Mapping' started by KalypsoSig, Jul 17, 2008.

  1. KalypsoSig

    KalypsoSig New Member

    Joined:
    Jul 17, 2008
    Messages:
    7
    Likes Received:
    0
    Hey everyone. So I'm just wondering if there's a way to change a texture on a mesh in-game, maybe through kismet? Perhaps for a lamp that has both "on" and "off" state texture maps.
     
  2. _N_

    _N_ addicted to mapping

    Joined:
    May 23, 2008
    Messages:
    233
    Likes Received:
    0
    If by "texture" you mean Material, then yes. I did something like that for the core status screens in my recent warfare map. Apparently, it doesn't work for Static Meshes though, so you'll need to add your static mesh as an interp actor instead (and simply not have it move at all).

    To actually change the material, you can do it easily in Kismet. Simply connect the trigger event node (whatever it is that you have triggering this change) to a "Set Material" node. (i.e. New Action->Actor->Set Material).

    Good Luck ;).
     
  3. CPTStewart

    CPTStewart New Member

    Joined:
    May 10, 2008
    Messages:
    33
    Likes Received:
    0
    Or, you can copy the mesh from the stock package into your own and change the material that way. That's what I did for the skydome in my Valhalla map.

    You can find the instructions for copying the mesh in this tutorial.
     
  4. Hourences

    Hourences New Member

    Joined:
    Aug 29, 2000
    Messages:
    5,050
    Likes Received:
    0
    Why would you need to copy the mesh from a stock package just to change the material?

    What _N_ said is correct, and I have a tutorial on my website on triggering materials via Kismet if you need additional help.

    You dont need to make an all new lamp texture for the off state, you only need to disable the emissive to save memory.
     
  5. CPTStewart

    CPTStewart New Member

    Joined:
    May 10, 2008
    Messages:
    33
    Likes Received:
    0
    Wait... I think I copied the material from genthly's package and got confused :p

    So... nevermind what I said.
     
  6. _N_

    _N_ addicted to mapping

    Joined:
    May 23, 2008
    Messages:
    233
    Likes Received:
    0
    Oh wow, Hourences, your solution is much better than mine :). It gets rid of the need for those pesky inefficient interp actors (which I could never get to accept static lights). Do you know if there's any risk of there being one of those crazy texture-streaming artefacts (like a lower detail texture being used) if the texture was not previously used elsewhere in the map?
     
  7. Hourences

    Hourences New Member

    Joined:
    Aug 29, 2000
    Messages:
    5,050
    Likes Received:
    0
    you always have that risk, I wouldnt bother thinking about that for things like this.
     
  8. Kantham

    Kantham Fool.

    Joined:
    Sep 17, 2004
    Messages:
    18,047
    Likes Received:
    2
    From what I recall, yes you can do it from kismet depending on your goals. If you want something to trigger it then it's definitively in Kismet that you're going to do it.
     
  9. KalypsoSig

    KalypsoSig New Member

    Joined:
    Jul 17, 2008
    Messages:
    7
    Likes Received:
    0
    Thanks for all the information guys!

    I can see how this would work now in kismet. However, Hourences suggested that I simply disable the emmisive channel instead.

    How would I go about doing that?
     
  10. _N_

    _N_ addicted to mapping

    Joined:
    May 23, 2008
    Messages:
    233
    Likes Received:
    0
    Yeah, I would suggest running through Hourence's tutorials on the material editor too :rolleyes:. You would probably just multiply the emissive channel stuff by solid black (0 times anything is still 0 afterall ;)).
     
  11. KalypsoSig

    KalypsoSig New Member

    Joined:
    Jul 17, 2008
    Messages:
    7
    Likes Received:
    0
    Yes I know how to hook up and disable the emissive channel, my question is how would I trigger that with kismet... is there a way to target a specific channel in a single material or do I need two copies of the that material, one with the effect on and one with it off?
     
  12. Hourences

    Hourences New Member

    Joined:
    Aug 29, 2000
    Messages:
    5,050
    Likes Received:
    0
    http://www.hourences.com/book/tutorialsue3triggeredmaterials.htm

    In this case I would not use another texture though, but I would work with VectorParam, and simply do a multiply with constant 1 vector on whats inputted on emissive, then changing that constant 1 vector from value 0.0 to 1.0 to toggle it on through kismet, or other way around for toggling it off...

    Saves texturespace.
     
  13. KalypsoSig

    KalypsoSig New Member

    Joined:
    Jul 17, 2008
    Messages:
    7
    Likes Received:
    0
    Very nice!! Thank you very much, this is exactly what I need to do here.
     

Share This Page