diff --git a/docs/zengin/scripts/externals/doc.md b/docs/zengin/scripts/externals/doc.md index 9cf648f0dd..be8ae3c415 100644 --- a/docs/zengin/scripts/externals/doc.md +++ b/docs/zengin/scripts/externals/doc.md @@ -6,223 +6,225 @@ title: Doc functions Doc functions are used to control the document manager. They allow you to fine tune the display of maps, letters and books. ## `Doc_Create` - -Creates a new instance of the document manager and returns its ID. -```dae -func int Doc_Create() {}; -``` - -**Return value** -Returns the ID of the document manager instance. - -!!! Example +!!! function "`Doc_Create`" + Creates a new instance of the document manager and returns its ID. ```dae - var int nDocID; // Variable to store the id in - nDocID = Doc_Create(); + func int Doc_Create() {}; ``` -## `Doc_CreateMap` + **Return value** + Returns the ID of the document manager instance. -Creates a new instance of the document manager with the arrow showing players position on the map and returns its ID. -```dae -func int Doc_CreateMap() {}; -``` + !!! Example + ```dae + var int nDocID; // Variable to store the id in + nDocID = Doc_Create(); + ``` -**Return value** -Returns the ID of the document manager instance. - -!!! Example +## `Doc_CreateMap` +!!! function "`Doc_CreateMap`" + Creates a new instance of the document manager with the arrow showing players position on the map and returns its ID. ```dae - var int nDocID; // Variable to store the id in - nDocID = Doc_CreateMap(); + func int Doc_CreateMap() {}; ``` -## `Doc_SetLevel` + **Return value** + Returns the ID of the document manager instance. -Set a world level to a map. This maps the texture of the document to the bounding box of the provided level. -```dae -func void Doc_SetLevel(var int docID, var string level) {}; -``` - -**Parameters** + !!! Example + ```dae + var int nDocID; // Variable to store the id in + nDocID = Doc_CreateMap(); + ``` -- `#!dae var int docID` - document manager ID -- `#!dae var string level` - name of the ZEN file - -!!! Example +## `Doc_SetLevel` +!!! function "`Doc_SetLevel`" + Set a world level to a map. This maps the texture of the document to the bounding box of the provided level. ```dae - nDocID = Doc_CreateMap(); - Doc_SetLevel(nDocID, "WORLD.ZEN"); + func void Doc_SetLevel(var int docID, var string level) {}; ``` -## `Doc_SetLevelCoords` + **Parameters** -!!! Warning - This function is only available in Gothic 2 + - `#!dae var int docID` - document manager ID + - `#!dae var string level` - name of the ZEN file -Sets the map coordinates. This is used to map smaller portions of the world map to the document map to correctly show players position on the map. -```dae -func void Doc_SetLevelCoords(var int docID, var int left, var int top, var int right, var int bottom) {}; -``` + !!! Example + ```dae + nDocID = Doc_CreateMap(); + Doc_SetLevel(nDocID, "WORLD.ZEN"); + ``` -**Parameters** +## `Doc_SetLevelCoords` +!!! function "`Doc_SetLevelCoords`" -- `#!dae var int docID` - document manager ID -- `#!dae var int left` - left coordinate -- `#!dae var int top` - top coordinate -- `#!dae var int right` - right coordinate -- `#!dae var int bottom` - bottom coordinate + !!! Warning + This function is only available in Gothic 2 -!!! Example + Sets the map coordinates. This is used to map smaller portions of the world map to the document map to correctly show players position on the map. ```dae - Doc_SetLevelCoords(nDocID, -28000, 50500, 95500, -42500); + func void Doc_SetLevelCoords(var int docID, var int left, var int top, var int right, var int bottom) {}; ``` -## `Doc_SetFont` -Sets a `font` to be used on a `page` in a document with `docID`. Can be called multiple times to display different lines with different fonts. + **Parameters** -```dae -func void Doc_SetFont(var int docID, var int page, var string font) {}; -``` + - `#!dae var int docID` - document manager ID + - `#!dae var int left` - left coordinate + - `#!dae var int top` - top coordinate + - `#!dae var int right` - right coordinate + - `#!dae var int bottom` - bottom coordinate -**Parameters** + !!! Example + ```dae + Doc_SetLevelCoords(nDocID, -28000, 50500, 95500, -42500); + ``` -- `#!dae var int docID` - document manager ID -- `#!dae var int page` - page index, if set to `-1`, fonts will be applied to all pages -- `#!dae var string font` - font to be used +## `Doc_SetFont` +!!! function "`Doc_SetFont`" + Sets a `font` to be used on a `page` in a document with `docID`. Can be called multiple times to display different lines with different fonts. -!!! Example ```dae - Doc_SetFont(nDocID, -1, "FONT_10_BOOK.TGA"); + func void Doc_SetFont(var int docID, var int page, var string font) {}; ``` -## `Doc_SetPages` + **Parameters** -Sets the number of pages `numOfPages` of the document. -```dae -func void Doc_SetPages(var int docID, var int numOfPages) {}; -``` + - `#!dae var int docID` - document manager ID + - `#!dae var int page` - page index, if set to `-1`, fonts will be applied to all pages + - `#!dae var string font` - font to be used -**Parameters** + !!! Example + ```dae + Doc_SetFont(nDocID, -1, "FONT_10_BOOK.TGA"); + ``` -- `#!dae var int docID` - document manager ID -- `#!dae var int numOfPages` - number of pages - -!!! Example +## `Doc_SetPages` +!!! function "`Doc_SetPages`" + Sets the number of pages `numOfPages` of the document. ```dae - nDocID = Doc_Create(); - Doc_SetPages(nDocID, 2); + func void Doc_SetPages(var int docID, var int numOfPages) {}; ``` -## `Doc_SetPage` - -Set `page` to have `texture` as a background with `scale`. -```dae -func void Doc_SetPage(var int docID, var int page, var string texture, var int scale) {}; -``` + **Parameters** -**Parameters** + - `#!dae var int docID` - document manager ID + - `#!dae var int numOfPages` - number of pages -- `#!dae var int docID` - document manager ID -- `#!dae var int page` - page index, if set to `-1`, settings are applied to all pages -- `#!dae var string texture` - texture of the background -- `#!dae var int scale` - scale of the texture, `TRUE` to scale the page, `FALSE` to not scale + !!! Example + ```dae + nDocID = Doc_Create(); + Doc_SetPages(nDocID, 2); + ``` -!!! Example +## `Doc_SetPage` +!!! function "`Doc_SetPage`" + Set `page` to have `texture` as a background with `scale`. ```dae - Doc_SetPage(nDocID, 0, "Book_Mage_L.tga", FALSE); - Doc_SetPage(nDocID, 1, "Book_Mage_R.tga", FALSE); + func void Doc_SetPage(var int docID, var int page, var string texture, var int scale) {}; ``` -## `Doc_SetMargins` + **Parameters** -Sets text margins of the page -```dae -func void Doc_SetMargins(var int docID, - var int page, - var int left, - var int top, - var int right, - var int bottom, - var int pixels) {}; -``` - -**Parameters** + - `#!dae var int docID` - document manager ID + - `#!dae var int page` - page index, if set to `-1`, settings are applied to all pages + - `#!dae var string texture` - texture of the background + - `#!dae var int scale` - scale of the texture, `TRUE` to scale the page, `FALSE` to not scale -- `#!dae var int docID` - document manager ID -- `#!dae var int page` - page index, if set to `-1`, settings are applied to all pages -- `#!dae var int left` - left margin -- `#!dae var int top` - top margin -- `#!dae var int right` - right margin -- `#!dae var int bottom` - bottom margin -- `#!dae var int pixels` - `TRUE` to use pixels, `FALSE` to use virtual coordinates -!!! Warning - After a thorough examination of this external function in the decompiler, it looks like the function works in pixels only regardless of this parameter. + !!! Example + ```dae + Doc_SetPage(nDocID, 0, "Book_Mage_L.tga", FALSE); + Doc_SetPage(nDocID, 1, "Book_Mage_R.tga", FALSE); + ``` -!!! Example +## `Doc_SetMargins` +!!! function "`Doc_SetMargins`" + Sets text margins of the page ```dae - Doc_SetMargins(nDocID, 0, 275, 20, 30, 20, TRUE); + func void Doc_SetMargins(var int docID, + var int page, + var int left, + var int top, + var int right, + var int bottom, + var int pixels) {}; ``` -## `Doc_PrintLine` + **Parameters** -Prints a line of `text` (font is set using [Doc_SetFont](#doc_setfont)) onto the document with `docID`, onto the `page`. Does not split the text into multiple lines if they do not fit onto the page. -```dae -func void Doc_PrintLine(var int docID, var int page, var string text) {}; -``` - -**Parameters** + - `#!dae var int docID` - document manager ID + - `#!dae var int page` - page index, if set to `-1`, settings are applied to all pages + - `#!dae var int left` - left margin + - `#!dae var int top` - top margin + - `#!dae var int right` - right margin + - `#!dae var int bottom` - bottom margin + - `#!dae var int pixels` - `TRUE` to use pixels, `FALSE` to use virtual coordinates + !!! Warning + After a thorough examination of this external function in the decompiler, it looks like the function works in pixels only regardless of this parameter. -- `#!dae var int docID` - document manager ID -- `#!dae var int page` - page index -- `#!dae var string text` - text to be printed + !!! Example + ```dae + Doc_SetMargins(nDocID, 0, 275, 20, 30, 20, TRUE); + ``` -!!! Example +## `Doc_PrintLine` +!!! function "`Doc_PrintLine`" + Prints a line of `text` (font is set using [Doc_SetFont](#doc_setfont)) onto the document with `docID`, onto the `page`. Does not split the text into multiple lines if they do not fit onto the page. ```dae - Doc_PrintLine(nDocID, 0, ""); // insert empty line - Doc_PrintLine(nDocID, 0, "The Book"); + func void Doc_PrintLine(var int docID, var int page, var string text) {}; ``` -## `Doc_PrintLines` + **Parameters** -Prints a line of `text` (font is set using [Doc_SetFont](#doc_setfont)) onto the document with `docID`, onto the `page`. Splits the text into multiple lines if they do not fit onto the page. -```dae -func void Doc_PrintLines(var int docID, var int page, var string text) {}; -``` + - `#!dae var int docID` - document manager ID + - `#!dae var int page` - page index + - `#!dae var string text` - text to be printed -**Parameters** + !!! Example + ```dae + Doc_PrintLine(nDocID, 0, ""); // insert empty line + Doc_PrintLine(nDocID, 0, "The Book"); + ``` -- `#!dae var int docID` - document manager ID -- `#!dae var int page` - page index -- `#!dae var string text` - text to be printed - -!!! Example +## `Doc_PrintLines` +!!! function "`Doc_PrintLines`" + Prints a line of `text` (font is set using [Doc_SetFont](#doc_setfont)) onto the document with `docID`, onto the `page`. Splits the text into multiple lines if they do not fit onto the page. ```dae - Doc_PrintLines(nDocID, 0, "The war had been decided. Varant had lost its seaports, vital to army supplies. King Rhobar had not lingered on the battle fields for a long time, but left his generals to deal with the few remaining enemy troops. Varant had only one large force left, commanded by Lukkor, the most capable warlord of the Varant army, who had more than once turned defeat into victory."); - Doc_PrintLines(nDocID, 0, "But now his army was trapped. The situation was hopeless, even though his army greatly outnumbered the enemy. Lee, a war hero from Myrtana, had lured him into this trap. The heavy cavalry had been unable to fight on the thick, swamped ground of the narrow valley. Lee's soldiers had occupied the range of hills surrounding the swamp, and they had struck repeatedly, decimating the army. The desperate sallies his troops had launched had been cut short in pools of blood. He was beaten."); + func void Doc_PrintLines(var int docID, var int page, var string text) {}; ``` -## `Doc_Show` - -Display the document using the document manager ID -```dae -func void Doc_Show(var int docID) {}; -``` + **Parameters** -**Parameters** + - `#!dae var int docID` - document manager ID + - `#!dae var int page` - page index + - `#!dae var string text` - text to be printed -- `#!dae var int docID` - document manager ID + !!! Example + ```dae + Doc_PrintLines(nDocID, 0, "The war had been decided. Varant had lost its seaports, vital to army supplies. King Rhobar had not lingered on the battle fields for a long time, but left his generals to deal with the few remaining enemy troops. Varant had only one large force left, commanded by Lukkor, the most capable warlord of the Varant army, who had more than once turned defeat into victory."); + Doc_PrintLines(nDocID, 0, "But now his army was trapped. The situation was hopeless, even though his army greatly outnumbered the enemy. Lee, a war hero from Myrtana, had lured him into this trap. The heavy cavalry had been unable to fight on the thick, swamped ground of the narrow valley. Lee's soldiers had occupied the range of hills surrounding the swamp, and they had struck repeatedly, decimating the army. The desperate sallies his troops had launched had been cut short in pools of blood. He was beaten."); + ``` -!!! Example +## `Doc_Show` +!!! function "`Doc_Show`" + Display the document using the document manager ID ```dae - var int nDocID; // Variable to store the id in - nDocID = Doc_Create(); - - // ... document configuration - - Doc_Show(nDocID); + func void Doc_Show(var int docID) {}; ``` + **Parameters** + + - `#!dae var int docID` - document manager ID + + !!! Example + ```dae + var int nDocID; // Variable to store the id in + nDocID = Doc_Create(); + + // ... document configuration + + Doc_Show(nDocID); + ``` + ## Externals with docu comments ```dae diff --git a/docs/zengin/scripts/externals/log.md b/docs/zengin/scripts/externals/log.md index e31119cdaf..7996d694df 100644 --- a/docs/zengin/scripts/externals/log.md +++ b/docs/zengin/scripts/externals/log.md @@ -4,61 +4,63 @@ title: Log functions # Log external functions Log externals are used to manipulate players log and to track quest progress. +## ``Log_CreateTopic`` +!!! function "``Log_CreateTopic``" + Creates a new log topic with the name `topicName` under the section `logSection` -## `Log_CreateTopic` -Creates a new log topic with the name `topicName` under the section `logSection` - -```dae -func void Log_CreateTopic(var string topicName, var int logSection) {}; -``` -**Parameters** + ```dae + func void Log_CreateTopic(var string topicName, var int logSection) {}; + ``` + **Parameters** -- `#!dae var string topicName` - Unique string used to identify and name the topic -- `#!dae var int logSection` - Indicates in which section to create the topic in. - Takes constants `LOG_MISSION`, `LOG_NOTE` as values + - `#!dae var string topicName` + Unique string used to identify and name the topic + - `#!dae var int logSection` + Indicates in which section to create the topic in. + Takes constants `LOG_MISSION`, `LOG_NOTE` as values ## `Log_AddEntry` -Adds an entry to a log topic with the name `topicName` under the section `logSection` +!!! function "`Log_AddEntry`" + Adds an entry to a log topic with the name `topicName` under the section `logSection` -```dae -func void Log_AddEntry(var string topicName, var string entry) {}; -``` -**Parameters** + ```dae + func void Log_AddEntry(var string topicName, var string entry) {}; + ``` + **Parameters** -- `#!dae var string topicName` - Unique string used to identify and name the topic -- `#!dae var string entry` - Content of the new entry + - `#!dae var string topicName` + Unique string used to identify and name the topic + - `#!dae var string entry` + Content of the new entry -!!! Info - In the engine the `#!dae Log_AddEntry()` is wrapped in a `#!dae B_LogEntry()` function. This function also handles printing the "New Journal Entry" message to the screen and playing the sound effect. - ```dae - func void B_LogEntry(var string topic, var string entry) - { - PrintDebugNpc(PD_ZS_DETAIL, "B_LogEntry"); // Logging + !!! Info + In the engine the `#!dae Log_AddEntry()` is wrapped in a `#!dae B_LogEntry()` function. This function also handles printing the "New Journal Entry" message to the screen and playing the sound effect. + ```dae + func void B_LogEntry(var string topic, var string entry) + { + PrintDebugNpc(PD_ZS_DETAIL, "B_LogEntry"); // Logging - Log_AddEntry(topic, entry); + Log_AddEntry(topic, entry); - PrintScreen(NAME_NewLogEntry, -1, _YPOS_MESSAGE_LOGENTRY, "font_old_10_white.tga", _TIME_MESSAGE_LOGENTRY); - Snd_Play("LogEntry"); - }; - ``` + PrintScreen(NAME_NewLogEntry, -1, _YPOS_MESSAGE_LOGENTRY, "font_old_10_white.tga", _TIME_MESSAGE_LOGENTRY); + Snd_Play("LogEntry"); + }; + ``` ## `Log_SetTopicStatus` -Changes the status of the topic with the name `topicName` +!!! function "`Log_SetTopicStatus`" + Changes the status of the topic with the name `topicName` -```dae -func void Log_SetTopicStatus(var string topicName, var int status) {}; -``` -**Parameters** + ```dae + func void Log_SetTopicStatus(var string topicName, var int status) {}; + ``` + **Parameters** -- `#!dae var string topicName` - Unique string used to identify and name the topic -- `#!dae var int status` - The status to be set. - Takes constants `LOG_RUNNING`, `LOG_SUCCESS`, `LOG_FAILED`, `LOG_OBSOLETE` as values + - `#!dae var string topicName` + Unique string used to identify and name the topic + - `#!dae var int status` + The status to be set. + Takes constants `LOG_RUNNING`, `LOG_SUCCESS`, `LOG_FAILED`, `LOG_OBSOLETE` as values ## zParserExtender diff --git a/docs/zengin/scripts/externals/mdl.md b/docs/zengin/scripts/externals/mdl.md index 20cedf29a1..cb23742619 100644 --- a/docs/zengin/scripts/externals/mdl.md +++ b/docs/zengin/scripts/externals/mdl.md @@ -5,210 +5,219 @@ title: MDL functions Functions to tweak animation and other model related settings. ## `Mdl_ApplyOverlayMDS` -Apply an animation overlay with `overlay_name` for the specified `npc` -```dae -func void Mdl_ApplyOverlayMDS(var c_npc npc, var string overlay_name) {}; -``` +!!! function "`Mdl_ApplyOverlayMDS`" + Apply an animation overlay with `overlay_name` for the specified `npc` + ```dae + func void Mdl_ApplyOverlayMDS(var c_npc npc, var string overlay_name) {}; + ``` -**Parameters** + **Parameters** -- `#!dae var c_npc npc` - NPC to apply the overlay to -- `#!dae var string overlay_name` - Name of the animation overlay + - `#!dae var c_npc npc` + NPC to apply the overlay to + - `#!dae var string overlay_name` + Name of the animation overlay ## `Mdl_ApplyOverlayMDSTimed` -Apply an animation overlay with `overlay_name` for the specified `npc` for `duration` milliseconds -```dae -func void Mdl_ApplyOverlayMDSTimed(var c_npc npc, var string overlay_name, var float duration) {}; -``` +!!! function "`Mdl_ApplyOverlayMDSTimed`" + Apply an animation overlay with `overlay_name` for the specified `npc` for `duration` milliseconds + ```dae + func void Mdl_ApplyOverlayMDSTimed(var c_npc npc, var string overlay_name, var float duration) {}; + ``` -**Parameters** + **Parameters** -- `#!dae var c_npc npc` - NPC to apply the overlay to -- `#!dae var string overlay_name` - Name of the animation overlay -- `#!dae var float duration` - Overlay duration in milliseconds + - `#!dae var c_npc npc` + NPC to apply the overlay to + - `#!dae var string overlay_name` + Name of the animation overlay + - `#!dae var float duration` + Overlay duration in milliseconds ## `Mdl_RemoveOverlayMDS` -Remove the animation overlay `overlay_name` from specified `npc` -```dae -func void Mdl_RemoveOverlayMDS(var c_npc npc, var string overlay_name) {}; -``` +!!! function "`Mdl_RemoveOverlayMDS`" + Remove the animation overlay `overlay_name` from specified `npc` + ```dae + func void Mdl_RemoveOverlayMDS(var c_npc npc, var string overlay_name) {}; + ``` -**Parameters** + **Parameters** -- `#!dae var c_npc npc` - NPC to remove the overlay from -- `#!dae var string overlay_name` - Name of the animation overlay + - `#!dae var c_npc npc` + NPC to remove the overlay from + - `#!dae var string overlay_name` + Name of the animation overlay ## `Mdl_ApplyRandomAni` -Assign a random animation `ani2` to random animation list of animation `ani1` -```dae -func void Mdl_ApplyRandomAni(var c_npc npc, var string ani1, var string ani2) {}; -``` +!!! function "`Mdl_ApplyRandomAni`" + Assign a random animation `ani2` to random animation list of animation `ani1` + ```dae + func void Mdl_ApplyRandomAni(var c_npc npc, var string ani1, var string ani2) {}; + ``` -**Parameters** + **Parameters** -- `#!dae var c_npc npc` - NPC owning the animation -- `#!dae var string ani1` - The animation to assign random animation to -- `#!dae var string ani2` - Animation to be assigned + - `#!dae var c_npc npc` + NPC owning the animation + - `#!dae var string ani1` + The animation to assign random animation to + - `#!dae var string ani2` + Animation to be assigned ## `Mdl_ApplyRandomAniFreq` -Sets the random animation frequency for animation `ani1` -```dae -func void Mdl_ApplyRandomAniFreq(var c_npc npc, var string ani1, var float frequency) {}; -``` +!!! function "`Mdl_ApplyRandomAniFreq`" + Sets the random animation frequency for animation `ani1` + ```dae + func void Mdl_ApplyRandomAniFreq(var c_npc npc, var string ani1, var float frequency) {}; + ``` -**Parameters** + **Parameters** -- `#!dae var c_npc npc` - NPC owning the animation -- `#!dae var string ani1` - The animation to set the random frequency -- `#!dae var float frequency` - Number of seconds between random animations + - `#!dae var c_npc npc` + NPC owning the animation + - `#!dae var string ani1` + The animation to set the random frequency + - `#!dae var float frequency` + Number of seconds between random animations -??? Abstract "Example" - ```dae - // Attach T_WOUNDED_TRY animation to the S_WOUNDED animation - Mdl_ApplyRandomAni(self, "S_WOUNDED", "T_WOUNDED_TRY"); - // Make the random animation attached play every 8 seconds - Mdl_ApplyRandomAniFreq(self, "S_WOUNDED", 8); - ``` + ??? Abstract "Example" + ```dae + // Attach T_WOUNDED_TRY animation to the S_WOUNDED animation + Mdl_ApplyRandomAni(self, "S_WOUNDED", "T_WOUNDED_TRY"); + // Make the random animation attached play every 8 seconds + Mdl_ApplyRandomAniFreq(self, "S_WOUNDED", 8); + ``` ## `Mdl_SetModelFatness` -Set the procedural model fatness -```dae -func void Mdl_SetModelFatness(var c_npc npc, var float fatness) {}; -``` - -**Parameters** +!!! function "`Mdl_SetModelFatness`" + Set the procedural model fatness + ```dae + func void Mdl_SetModelFatness(var c_npc npc, var float fatness) {}; + ``` -- `#!dae var c_npc npc` - NPC to apply the fatness to -- `#!dae var float fatness` - Fatness value + **Parameters** + - `#!dae var c_npc npc` + NPC to apply the fatness to + - `#!dae var float fatness` + Fatness value ## `Mdl_SetModelScale` -Set model scale per axis -```dae -func void Mdl_SetModelScale(var c_npc npc, var float x, var float y, var float z) {}; -``` - -**Parameters** +!!! function "`Mdl_SetModelScale`" + Set model scale per axis + ```dae + func void Mdl_SetModelScale(var c_npc npc, var float x, var float y, var float z) {}; + ``` -- `#!dae var c_npc npc` - NPC to apply the scale to -- `#!dae var float x` - Scale along the x-axis, 1.0 = 100%, 1.5 = 150%, 0.9 = 90% -- `#!dae var float y` - Scale along the y-axis, 1.0 = 100%, 1.5 = 150%, 0.9 = 90% -- `#!dae var float z` - Scale along the z-axis, 1.0 = 100%, 1.5 = 150%, 0.9 = 90% + **Parameters** + - `#!dae var c_npc npc` + NPC to apply the scale to + - `#!dae var float x` + Scale along the x-axis, 1.0 = 100%, 1.5 = 150%, 0.9 = 90% + - `#!dae var float y` + Scale along the y-axis, 1.0 = 100%, 1.5 = 150%, 0.9 = 90% + - `#!dae var float z` + Scale along the z-axis, 1.0 = 100%, 1.5 = 150%, 0.9 = 90% ## `Mdl_SetVisualBody` -Sets up the visual of an NPC -```dae -func void Mdl_SetVisualBody(var instance npc, - var string body_mesh, - var int body_tex, - var int skin, - var string head_mesh, - var int head_tex, - var int teeth_tex, - var int armor_inst ) {}; -``` - -**Parameters** - -- `#!dae var instance npc` - NPC to be affected -- `#!dae var string body_mesh` - Mesh to be used as the body e.g. `HUN_BODY_NAKED0` -- `#!dae var int body_tex` - Body texture assigned to this body mesh -- `#!dae var int skin` - Body texture variant -- `#!dae var string head_mesh` - Head mesh -- `#!dae var int head_tex` - Head texture -- `#!dae var int teeth_tex` - Teeth texture -- `#!dae var int armor_inst` - Armor ([`C_ITEM`](../classes/c_item.md) instance) to be equipped or `-1` for no armor +!!! function "`Mdl_SetVisualBody`" + Sets up the visual of an NPC + ```dae + func void Mdl_SetVisualBody(var instance npc, + var string body_mesh, + var int body_tex, + var int skin, + var string head_mesh, + var int head_tex, + var int teeth_tex, + var int armor_inst ) {}; + ``` + + **Parameters** + + - `#!dae var instance npc` + NPC to be affected + - `#!dae var string body_mesh` + Mesh to be used as the body e.g. `HUN_BODY_NAKED0` + - `#!dae var int body_tex` + Body texture assigned to this body mesh + - `#!dae var int skin` + Body texture variant + - `#!dae var string head_mesh` + Head mesh + - `#!dae var int head_tex` + Head texture + - `#!dae var int teeth_tex` + Teeth texture + - `#!dae var int armor_inst` + Armor ([`C_ITEM`](../classes/c_item.md) instance) to be equipped or `-1` for no armor ## `Mdl_SetVisual` -Set the animation set (also dictates models you can set using the `Mdl_SetVisualBody`) -```dae -func void Mdl_SetVisual(var instance npc, var string animation_set) {}; -``` +!!! function "`Mdl_SetVisual`" + Set the animation set (also dictates models you can set using the `Mdl_SetVisualBody`) + ```dae + func void Mdl_SetVisual(var instance npc, var string animation_set) {}; + ``` -**Parameters** + **Parameters** -- `#!dae var instance npc` - NPC to apply the animation set to -- `#!dae var string animation_set` - Name of the MDS file that contains the animation set + - `#!dae var instance npc` + NPC to apply the animation set to + - `#!dae var string animation_set` + Name of the MDS file that contains the animation set ## `Mdl_StartFaceAni` -Start a face animation -```dae -func void Mdl_StartFaceAni(var c_npc npc, - var string name, - var float intensity, - var float holdtime) {}; -``` +!!! function "`Mdl_StartFaceAni`" + Start a face animation + ```dae + func void Mdl_StartFaceAni(var c_npc npc, + var string name, + var float intensity, + var float holdtime) {}; + ``` -**Parameters** + **Parameters** -- `#!dae var c_npc npc` - NPC to apply the animation to -- `#!dae var string name` - Animation name -- `#!dae var float intensity` - Intensity of the animation 0.0 to 1.0 -- `#!dae var float holdtime` - How long should the animation be held for `-2` will use the MMS defined value, '-1' will make the hold time infinite + - `#!dae var c_npc npc` + NPC to apply the animation to + - `#!dae var string name` + Animation name + - `#!dae var float intensity` + Intensity of the animation 0.0 to 1.0 + - `#!dae var float holdtime` + How long should the animation be held for `-2` will use the MMS defined value, '-1' will make the hold time infinite ## `Mdl_ApplyRandomFaceAni` -Start a random face animation -```dae -func void Mdl_ApplyRandomFaceAni(var c_npc npc, - var string name, - var float timemin, - var float timeminvar, - var float timemax, - var float timemaxvar, - var float probmin) {}; -``` - -**Parameters** - -- `#!dae var c_npc npc` - NPC to apply the animation to -- `#!dae var string name` - Animation name -- `#!dae var float timemin` - Minimum time after which the ani should be started (in seconds) -- `#!dae var float timeminvar` - Minimum boundary variation (in seconds) -- `#!dae var float timemax` - Maximum time after which the ani should be started (in seconds) -- `#!dae var float timemaxvar` - Maximum boundary variation (in seconds) -- `#!dae var float probmin` - Probability (0.0 to 1.0) to choose the lower boundary time +!!! function "`Mdl_ApplyRandomFaceAni`" + Start a random face animation + ```dae + func void Mdl_ApplyRandomFaceAni(var c_npc npc, + var string name, + var float timemin, + var float timeminvar, + var float timemax, + var float timemaxvar, + var float probmin) {}; + ``` + + **Parameters** + + - `#!dae var c_npc npc` + NPC to apply the animation to + - `#!dae var string name` + Animation name + - `#!dae var float timemin` + Minimum time after which the ani should be started (in seconds) + - `#!dae var float timeminvar` + Minimum boundary variation (in seconds) + - `#!dae var float timemax` + Maximum time after which the ani should be started (in seconds) + - `#!dae var float timemaxvar` + Maximum boundary variation (in seconds) + - `#!dae var float probmin` + Probability (0.0 to 1.0) to choose the lower boundary time ## Externals with docu comments