Level scripting? How?

CoffeePowerUp

Member
Apr 30, 2026
3
0
100
Pronouns
cof/fee
So... I don't find too much materials on this topic.
I'm building a level for the first time, didn't expect to have this much fun with it but now I'm at the point where I need to add more advanced stuffs.
How do I script? What object types have what behavior options? How do I make a button that opens a gate for example? Or make the player collect red coins to get a star? Those kind of things we see on the original levels. Moving, rotating platforms (even with custom models), switches, coin puzzles,...

Also if I die on my level, it throws back to the castle, Bob-omb Battlefield painting. I guess that's the easier fix, I just want a one level collect-a-ton thing as a first level.

I'm using Blender 3.6 with Fast64 on Linux system. I'm somewhat familiar with C and lua. But not really in SM64 context.
 
Hi, I guess you got already some sort of answers by digging through the forum?

If not i guess a good start would be the documentation on GitHub with examples sm64coopdx/docs/lua/lua.md at main · coop-deluxe/sm64coopdx

Also you will need (at least its what I did so far) to dig through the code on GitHub and watch some videos about sm64decomp and how to edit or at least know how the code behind kinda works.

Example: I didn't know how to add multiple stars with different IDs. Or at least I didn't know which Parameter to set.

In Blender you have on your Empty nodes (like level, area, object) Behaviour Parameters.

I have the Empty called "Star4" under Object Properties I set it to

Object Type : Object
Model: Star

Behaviour: Star

Behaviour Parameters:

HEX: 0x03000000

OR

as Individual Parameters:
Param 1: 0x03
Param 2:
Param 3:
Param 4:

to find out i need to edit param 1 i searched for something with bhvStar in the code
I found as example following line here sm64coopdx/levels/bob/script.c at main · coop-deluxe/sm64coopdx on line 52
OBJECT_WITH_ACTS(/*model*/ MODEL_STAR, /*pos*/ 1550, 1200, 300, /*angle*/ 0, 0, 0, /*behParam*/ 0x05000000, /*beh*/ bhvStar, /*acts*/ ALL_ACTS),

saw this in the line /*behParam*/ 0x05000000 so I guess that would be the first Param to set.


hope it helps a little
 

Users who are viewing this thread