Author Topic: Need help changing the skybox texture  (Read 2209 times)

0 Members and 2 Guests are viewing this topic.

Offline Jeff43

  • Newbie
  • *
  • Posts: 3
  • Karma: 0
Need help changing the skybox texture
« on: October 24, 2017, 10:23:38 AM »
Has nothing to do with ulx, so I thought maybe off-topic was the way to go. I tried Facepunch, but no one seems to know a solution.
Code: [Select]
Material("painted"):SetTexture("$basetexture","sky_day01_09") -- also tried skybox/sky_day01_09
« Last Edit: October 24, 2017, 06:58:49 PM by Jeff43 »

Offline MrPresident

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 2728
  • Karma: 430
    • |G4P| Gman4President
Re: bad argument #2 to 'SetTexture' (ITexture expected, got userdata)
« Reply #1 on: October 24, 2017, 11:57:01 AM »
"painted" isn't the material.

There are individual materials for the skybox.

 "up", "dn", "lf", "rt", "bk", "ft"

For example:

lua_run_cl print(Material("painted"))
Material [___error]


But...

lua_run_cl print(Material("skybox/paintedup"))
Material [skybox/paintedup]

so you would need..

Material("skybox/paintedup")
Material("skybox/painteddn")
Material("skybox/paintedlf")
Material("skybox/paintedrt")
Material("skybox/paintedbk")
Material("skybox/paintedft")

Not sure if the rest of your code will work as I didn't try it.. but that should help you get started.

An Error Has Occurred!

array_keys(): Argument #1 ($array) must be of type array, null given