what's the light X, Y, and Z value for ex-coop?

Jun 9, 2024
23
1
160
Pronouns
he/him
this has been reposted from a Reddit post i made so don't say that i stole the question from somewhere. My name in Reddit also doesn't include "esponja" in the original name (no nickname included)

so i was doing a mod that makes mario have his old shading
if you don't know what type of shading its this one, but i tried inserting the light X, Y, and Z values and when i test it in-game, i am greeted with a "Old Shading" has script errors.

the code:
function shading(m)

m.marioBodyState.light_X = 0

m.marioBodyState.light_Y = 0

m.marioBodyState.light_Z = 127

end
 
Solution
It's just a function, so example code would be

Code:
function shading(m)
    set_lighting_dir(0, 0)
    set_lighting_dir(1, 0)
    set_lighting_dir(2, 127)
end

-----------
-- hooks --
-----------

hook_event(HOOK_MARIO_UPDATE, shading)

You can tweak the variables to get the desired effect.
Rather frankly, all the reddit sm64 communities I know of- even the big ones- are kiiiinda dead.
As such, I wouldn't worry much. 😅
Pretty positive you'd need to configure the stuff in blender, and make a [CS] pack.
Not unlike the last post of yours I commented on.
As always, though, I could very much be wrong.
 
No you can do this, this code simply isn't correct. Firstly, be sure you're hooking the shading function via hook_event(HOOK_MARIO_UPDATE, shading). Next, the light_X variable and y and z are all named wrong, it's lightX, lightY, and lightZ, no underscore. Once that's done that code should work fine.
 
What's the error, and what does your code look like?
the error says "Invalid key 'lightY"

code with the hook i forgot to put:
function shading(m)
m.marioBodyState.lightX = 0
m.marioBodyState.lightY = 0
m.marioBodyState.lightZ = 127
end

-----------
-- hooks --
-----------

hook_event(HOOK_MARIO_UPDATE, shading)
 
that made the shading be like this:


EUxN3Aw.png
 
I'm sorry, I just looked at the image, I believe you're editing the wrong variable. What you're wanting to change is the light direction. That can be done with set_lighting_dir, this passes in an index and a value. The index 0 is X, the index 1 is Y, and the index 2 is Z. Then simply set the number to be the light direction. Sorry about that!
 
It's just a function, so example code would be

Code:
function shading(m)
    set_lighting_dir(0, 0)
    set_lighting_dir(1, 0)
    set_lighting_dir(2, 127)
end

-----------
-- hooks --
-----------

hook_event(HOOK_MARIO_UPDATE, shading)

You can tweak the variables to get the desired effect.
 
Solution

Users who are viewing this thread