User Tools

Site Tools


super_mario_64:custom_object

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
super_mario_64:custom_object [2020/11/02 03:39]
Tenry
super_mario_64:custom_object [2020/11/05 17:44] (current)
Tenry
Line 7: Line 7:
 In Blender, install the [[Fast64]] plugin, select your object you want to export, open the Fast64 menu and expand **SM64 Geolayout Exporter**. Ensure to select C as the export. In Blender, install the [[Fast64]] plugin, select your object you want to export, open the Fast64 menu and expand **SM64 Geolayout Exporter**. Ensure to select C as the export.
  
-Choose **Actor Data** as the export type.+Choose **Actor Data** as the export type and provide a group name such as **common0**. The exported model requires a unique folder name such as **custom_platform**. For the geolayout name, it's advised to use the same as the folder name and "​_geo"​ appended, such as **custom_platform_geo**.
  
-Choose a group name you want to add your actor to, such as **common0**.+Ensure the newly created model.inc.c file is included in actors/<group>.c file, such as in **actors/common0.c** (should be done by Fast64 exporter).
  
-Choose a unique folder name. It's recommended to add the word custom to the namefor example ​**custom_platform**.+Ensure ​the newly created geo_header.h file is included in actors/<​group>​.h filesuch as in **actors/​common0.h** (should be done by Fast64 exporter).
  
-Choose a unique geolayout name, such as **custom_platform_geo**. +Ensure the newly created geo.inc.c file is included in actors/<​group>​_geo.c file, such as in **actors/​common0_geo.c** ​(should be done by Fast64 exporter).
- +
-Ensure the newly created model.inc.c file is included in actors/<​group>​.c file, such as in **actors/​common0.c**. +
- +
-Ensure the newly created geo_header.h file is included in actors/<​group>​.h file, such as in **actors/​common0.h**. +
- +
-Ensure the newly created geo.inc.c file is included in actors/<​group>​_geo.c file, such as in **actors/​common0_geo.c**.+
  
 ===== Load custom model ===== ===== Load custom model =====
Line 29: Line 23:
 ===== Create behavior script ===== ===== Create behavior script =====
  
-Open **data/​behavior_data.c** in your favorite code editor. You may want to add a dedicated file, such as **data/​custom_coin.inc.c** and include this in data/​behavior_data.c.+Open **data/​behavior_data.c** in your favorite code editor. You may want to add a dedicated file, such as **data/​custom_coin.c** ​(it is automatically found and included by the Makefile). Also add your new behavior name as a declaration ​in a header file, such as in **include/​behavior_data.h**.
  
 The easiest way to create your own behavior script is to copy an existing one that's most closely to what you want. Copy the related lines and rename the variable accordingly. The easiest way to create your own behavior script is to copy an existing one that's most closely to what you want. Copy the related lines and rename the variable accordingly.
Line 35: Line 29:
 ===== Create native code ===== ===== Create native code =====
  
-If you need new native C code, create a new code file in src/​game/​behaviors,​ such as **src/​game/​behaviors/​custom_coin.inc.c**,​ and include that file in **src/​game/​obj_behaviors.c**. You might want to copy an existing behavior code for reference. However, make sure all variables and function names are unique in the source code. For example, rename bhv_yelow_coin_loop to **bhv_custom_coin_loop**.+If you need new native C code, create a new code file in src/​game/​behaviors,​ such as **src/​game/​behaviors/​custom_coin.inc.c**,​ and include that file in **src/​game/​obj_behaviors.c**. You might want to copy an existing behavior code for reference. However, make sure all variables and function names are unique in the source code. For example, rename bhv_yelow_coin_loop to **bhv_custom_coin_loop**. Declare your custom functions in a suitable header file, such as in **src/​game/​obj_behaviors.h** or **src/​game/​behavior_actions.h**.
  
 ===== Add object to level (Fast64) ===== ===== Add object to level (Fast64) =====
super_mario_64/custom_object.txt · Last modified: 2020/11/05 17:44 by Tenry