Skip to content

Commit

Permalink
Merge pull request #31 from kamilkrzyskow/code-inspection-2
Browse files Browse the repository at this point in the history
added mkdocs-video plugin, fixed youtube centering
  • Loading branch information
auronen committed Aug 2, 2022
2 parents 597d67c + 261ccd7 commit f5b1243
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 20 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ jobs:
- uses: actions/setup-python@v2
with:
python-version: 3.x
- run: pip install mkdocs-material mkdocs-git-revision-date-localized-plugin
- run: pip install mkdocs-material
- run: pip install mkdocs-git-revision-date-localized-plugin
- run: pip install mkdocs-video

- run: mkdocs gh-deploy --force
10 changes: 10 additions & 0 deletions docs/css/extra.css
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,17 @@
}
}


/* 16:9 aspect ratio and centering */
/* Works on top of mkdocs-video */
.video-container {
width: 32rem;
height: 18rem;
margin: auto;
}

/* Special character added to external links*/
.md-content a.external-link::after {
content: "[➽]";

}
2 changes: 1 addition & 1 deletion docs/zengin/anims/MDS.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ You will see a lot of long and scary code, but it is actually very simple, lets

To play the animation in game you use this console command `play ani t_yes`.

<center><iframe width="560" height="315" src="https://www.youtube.com/embed/aOyuGVWDefc" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe></center>
![type:video](https://www.youtube.com/embed/aOyuGVWDefc)


## Syntax and keywords
Expand Down
16 changes: 7 additions & 9 deletions docs/zengin/anims/StandaloneAni.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,17 @@ A windows pops up, you can read some interesting information about the model you

Click import and wait for the magic to happen.

<center><iframe width="560" height="315" src="https://www.youtube.com/embed/UKltt7mOfj0" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe></center>
![type:video](https://www.youtube.com/embed/UKltt7mOfj0)

This video shows a freshly imported model with all default meshes.

!!! note
Now if we wanted to play (or edit) existing animation, we can now load it on top of this. Just do as before **File > Import > Kerrax ASCII model (.asc)** and select different animation file (or armour file) for example `Hum_SmokeHerb_Layer_M01.asc` for an animation file.
<center><iframe width="560" height="315" src="https://www.youtube.com/embed/FDicnSwhv0w" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe></center>
![type:video](https://www.youtube.com/embed/FDicnSwhv0w)

Gothic characters are modular, you can change their heads on the fly (during gameplay even, as seen in this amazing video of my dear friend and colleague Fawkes - [Head changing](https://www.youtube.com/watch?v=2GBmpeyqKIA)), let's add a head, so we can see how the whole body will behave while we are animating. **File > Import > Kerrax ASCII model (.asc)** and navigate to your head model (for this, you will have to decompile it, like we did with the body itself). I will import `HUM_HEAD_PONY.ASC`. Please make sure to select the target bone for importing **Bip01 Head**, this will attach the head to the proper bone, just like the engine does it.

<center><iframe width="560" height="315" src="https://www.youtube.com/embed/AzotIDHFCSo" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe></center>
![type:video](https://www.youtube.com/embed/AzotIDHFCSo)

Now we have everything ready to start animating. The video shows the DopeSheet a nice way to edit keyframes.

Expand All @@ -49,7 +49,7 @@ We can import an animation into Blender as a base.
!!! tip
If you don't know, what the animation is called, just go into the game, and make your character to perform the animation you want, while in MARVIN mode, you can press `G` and the animation information (and some other info too) will be displayed right on the screen

<center><iframe width="560" height="315" src="https://www.youtube.com/embed/boUwngFLA-U" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe></center>
![type:video](https://www.youtube.com/embed/boUwngFLA-U)

In this video you can see, that the idle standing animation is `s_run`. Because we want to make an animation, that is going to start from this idle animation, we will import it into blender. Where do we find it? Just look into the `.mds` file, look for `s_run` name and get the name of the file.
```c++
Expand All @@ -59,8 +59,7 @@ As we can see, we have to import the `Hum_RunAmbient_M01.asc` file.
Next goes the first trick. Since we want our animation to end exactly, as it started - wither because we want the hero to continue his standing animation, or we want to make a looping animation we somehow have to copy the pose. I use the DopeSheet screen, to delete all keyframes and then copy the keyframe set from keyframe number 0 and then drag it somewhere to the end of the timeline.
<center><iframe width="560" height="315" src="https://www.youtube.com/embed/2vOMrM-9aWc" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe></center>
![type:video](https://www.youtube.com/embed/2vOMrM-9aWc)
Once the animation is done, we have to export it into a `asc` format again, **File > Export > Kerrax ASCII model (.asc)** and then save it to `_work\data\Anims\asc\` so the engine can see it and convert it.
There are many options here, that we will explore later, but we have tick **Export animation** and pick bones that we want to export - this is useful for animations that are played on different layers (dialoge gestures, scratching head, scratching a shoulder,...).
Expand All @@ -82,7 +81,7 @@ ani ("t_backpain" 1 "" 0.0 0.0 M. "Hum_back.ASC" F 0 121)
Save the `Humans.mds` file and try it in game. Nothing happens! The reason is, the `mds` has been already compiled, and we have to recompile it. The easiest is to go to `Anims\_compiled` and delete `HUMANS.MSB`.
Run the game and try to play the animation again (`play ani t_backpain` in MARVIN console) now everything should work.

<center><iframe width="560" height="315" src="https://www.youtube.com/embed/-i2un91x1UI" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe></center>
![type:video](https://www.youtube.com/embed/-i2un91x1UI)

Amazing, now you have your first animation in the game. And you can use it to do some fun stuff, like in dialogues using the `AI_PlayAni` function.

Expand Down Expand Up @@ -115,8 +114,7 @@ func void DIA_Xardas_Back_Info () {
};
```
<center><iframe width="560" height="315" src="https://www.youtube.com/embed/G14lgjA49wU" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe></center>
![type:video](https://www.youtube.com/embed/G14lgjA49wU)
Expand Down
18 changes: 9 additions & 9 deletions docs/zengin/union_plugins/zParserExtender/zPE_externals.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# External functions
External functions are Daedalus functions (defined in the engine itself) used to interface with the enigne. zParseExtender adds quite a huge amount of new functions, that help scripters to interface with the engine in more ways, that was possible before (without script extenders such as Ikarus and LeGo).

## CAST - data type conversion functions
## CAST data type conversion functions
External functions for data type conversion and pointer casting.

```c++
Expand Down Expand Up @@ -44,7 +44,7 @@ func int Cast_CheckVobClassID( var int classId, var instance object ) {};
## HLP - help functions
## HLP help functions
Helper functions, used for safety checks or to get specific information from the engine.
Expand Down Expand Up @@ -89,7 +89,7 @@ func void Hlp_WriteOptionString(var string optName, var string section, var stri



## WLD - world manipulation functions
## WLD world manipulation functions
Functions related to the world.


Expand Down Expand Up @@ -123,7 +123,7 @@ func int Wld_GetWeatherType() {};
## MDL - model functions
## MDL model functions
Functions to tweak animation and other model related settings.
Expand Down Expand Up @@ -169,7 +169,7 @@ func void Mdl_ResetNpcSpeedMultiplier( var C_Npc npc ) {};



## NPC - character functions
## NPC character functions
NPC realted functions.


Expand Down Expand Up @@ -221,7 +221,7 @@ func void Npc_RemoveFromSlot(var C_Npc npc, var string slotName, var int dropIt)
## MOB - interactive object functions
## MOB interactive object functions
Functions to manipulate interactive objects like destroying MOBs, setting lockpick combination and such.
Expand Down Expand Up @@ -253,7 +253,7 @@ func void Mob_SetKeyInstance( var instance object, var int key ) {};



## AI - functions for working with AI
## AI functions for working with AI
Functions to work with the new `C_Trigger` class and NPC's AI queue.


Expand Down Expand Up @@ -305,7 +305,7 @@ func string Hlp_GetSteamPersonalName() {};
## PAR - functions for parser manipulation
## PAR functions for parser manipulation
Parser functions are used to manipulate the parsers. Retrieve SymbolID, access arrays and such.
Expand Down Expand Up @@ -347,7 +347,7 @@ func void Par_SetSymbolValueFloatArray(var float value, var int parId, var int s
func void Par_SetSymbolValueStringArray(var string value, var int parId, var int symId, var int arrayId) {};
```

## VOB - functions for object manipulation
## VOB functions for object manipulation
VOB functions allow you to manipulate game world objects.
```c++
/// Returns the current position of the object in the world
Expand Down
4 changes: 4 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,10 @@ markdown_extensions:

plugins:
- search
- mkdocs-video:
css_style:
width: "100%"
height: "100%"
- git-revision-date-localized:
enabled: !ENV [GMC_SHOW_UPDATE_TIME, False]
type: iso_datetime
Expand Down

0 comments on commit f5b1243

Please sign in to comment.