Skip to content

Commit

Permalink
Merge branch 'main' into ci
Browse files Browse the repository at this point in the history
  • Loading branch information
GeckoEidechse authored Jul 9, 2024
2 parents 5b02c9f + 790a942 commit 8816df2
Show file tree
Hide file tree
Showing 29 changed files with 930 additions and 626 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/add-to-project.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: add-to-project

on:
issues:
types:
- opened
pull_request_target:
types:
- opened

jobs:
add-to-project:
name: Add to project
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
with:
project-url: "https://github.com/orgs/R2Northstar/projects/3"
github-token: "${{ secrets.PROJECT_BOARD_TOKEN }}"
16 changes: 16 additions & 0 deletions .github/workflows/merge-conflict-auto-label.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Merge Conflict Auto Label
on:
push:
branches:
- main

jobs:
triage:
runs-on: ubuntu-latest
steps:
- uses: mschilde/auto-label-merge-conflicts@master
with:
CONFLICT_LABEL_NAME: "merge conflicts"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
MAX_RETRIES: 5
WAIT_MS: 5000
4 changes: 2 additions & 2 deletions docs/source/guides/keyvalue/keyvaluetable.csv
Original file line number Diff line number Diff line change
Expand Up @@ -342,8 +342,8 @@ Damage scales linearly between near to far distances and far to very far (if it
``npc_dangerous_to_heavy_armor``|``bool``|True|Unknown.|
``npc_dangerous_to_normal_armor``|``bool``|True|Unknown.|
``npc_directed_fire_ang_limit_cos``|``float``|True|Unknown.|
``npc_explosion_damage``|``int``|True|Maximum explosion damage dealt to non-heavily armored targets for NPCs. Optional.|
``npc_explosion_damage_heavy_armor``|``int``|True|Maximum explosion damage dealt to heavily armored targets for NPCs. Optional.|"For each ``npc_explosion_damage`` value, if it is unused, the corresponding player value is applied instead."
``npc_explosion_damage``|``int``|True|Maximum explosion damage dealt to non-heavily armored targets for NPCs.|
``npc_explosion_damage_heavy_armor``|``int``|True|Maximum explosion damage dealt to heavily armored targets for NPCs.|"Unlike ``npc_damage_`` values, ``npc_explosion_damage`` values are set to 0 if unused."
``npc_fire_at_enemy_defense_time``|``float``|True|The time in seconds that an NPC will fire at a defensive before holding their shots.|
``npc_full_auto_vs_heavy_armor``|``bool``|True|Unknown.|
``npc_lead_time_max_dist``|``float``|True|Unknown.|
Expand Down
5 changes: 2 additions & 3 deletions docs/source/guides/tools/MDLModding.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ Prequisites
- `Portal 2 <https://store.steampowered.com/app/620/Portal_2/>`__ (and its Authoring Tools `Portal 2 SDK <https://developer.valvesoftware.com/wiki/Authoring_Tools/SDK_(Portal_2)>`__)

- `SourceFilmMaker <https://store.steampowered.com/app/1840/Source_Filmmaker/>`__ (FREE)

- `Alien Swarm <https://store.steampowered.com/app/630/Alien_Swarm/>`__ (FREE) (and its Authoring Tools `Alien Swarm SDK <https://developer.valvesoftware.com/wiki/Authoring_Tools/SDK_(Alien_Swarm)>`__)

• `mdlshit <https://github.com/headassbtw/mdlshit>`__
• `Harmony VPK <https://github.com/harmonytf/HarmonyVPKTool>`__ (optional if you want to extract the model yourself)
Expand Down Expand Up @@ -338,6 +336,7 @@ Step 7: Compiling the model
- Select the ``Compile`` tab on the top.
- Click on the ``Browse`` button on the top right.
- Select the ``.qc`` file you want to compile (for example ``ptpov_vinson.qc``).
- Choose your game from the dropdown labeled ``Games that has the model compiler`` (for example ``Portal 2``)
- Press the ``Compile`` button.
- Crowbar now compiles the model and outputs the files to the ``compiled`` folder in the same folder as the ``.qc`` file, inside the ``compiled`` folder you will find the full folder path of the model (for example ``models\weapons\vinson\``).

Expand Down Expand Up @@ -378,4 +377,4 @@ The following words correspond to the following:
``Crowbar ERROR: The model compiler, "<filename>", does not exist.``

``Crowbar ERROR: The game's "<filename>" file does not exist.``
Mostly happens if you did not properly set up Crowbar, make sure you followed the steps in `Setup Crowbar </guides/tools/mdlmodding.html#setup-crowbar-one-time-only>`__.
Mostly happens if you did not properly set up Crowbar, make sure you set the ``Game that has the model compiler`` to `your prerequisite game <https://r2northstar.readthedocs.io/en/latest/guides/tools/MDLModding.html#prequisites>`__.
10 changes: 9 additions & 1 deletion docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Cheatsheet

- `NoSkill modding guide (highly recommended to check out)
<https://noskill.gitbook.io/titanfall2/>`_
- `Tools for modding <tools.md>`_
- :doc:`Tools for modding <./guides/tools/index>`
- `All the Squirrel Constants
<https://gist.github.com/laundmo/825c4708663a179b23e144402b09244f>`_
- `Modding Documentation
Expand Down Expand Up @@ -90,3 +90,11 @@ Cheatsheet
:caption: Mapping Tools

/mapping/info-dump

.. toctree::
:maxdepth: 2
:hidden:
:caption: Plugins

/plugins/interfacesapi
/plugins/resources
104 changes: 104 additions & 0 deletions docs/source/plugins/interfacesapi.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
Interface API
=============
the plugins system now use source interfaces.

The launcher exposes almost everything required by plugins in interfaces that allow for backwards compatibility.
The only thing that's passed to a plugin directly is the northstar dll HWND and a struct of data that's different for each plugin.

Plugins are required to expose a ``void* CreateInterface(const char* name, int* status)`` function to share their own interfaces.
The launcher loads the ``PluginId`` interface from the plugin to query info such as it's name.

Plugins can use the ``CreateInterface`` function exposed by the northstarDll to use northstar interfaces such as for logging.
An interface is just an abstract class to force all functions into a vftable.

Northstar Interfaces
--------------------

NSSys001
~~~~~~~~

Exposes some system functionality to plugins

.. code-block::
// 32 bit
enum LogLevel {
INFO,
WARN,
ERR,
};
// handle: handle of the plugin. Passed to the plugin on init.
void Log(HMODULE handle, LogLevel level, char* msg); // logs a message with the plugin's log name
void Unload(HMODULE handle); // unloads the plugin
void Reload(HMODULE handle);
Required Plugin Interfaces
--------------------------

Interfaces that have to be exposed for the plugin to be loaded.

PluginId001
~~~~~~~~~~~

.. code-block::
// strings of data about the plugin itself. may be extended in the future
// 32 bit
enum PluginString {
NAME, // the name of the plugin
LOG_NAME, // the name used for logging
DEPENDENCY_NAME, // the name used for squirrel dependency constants created. The value returned for this has to be a valid squirrel identifier or the plugin will fail to load
}
// bitfields about the plugin
// 32 bit
enum PluginField {
CONTEXT // 0x1 if the plugin is allowed to run on dedicated servers and 0x2 if the plugin is allowed to run on clients (is this even needed seems useless to me)
}
char* GetString(PluginString prop);
i64 GetField(PluginField prop);
PluginCallbacks001
~~~~~~~~~~~~~~~~~~

.. code-block::
struct PluginNorthstarData { HMODULE handle; };
// COPY THE initData IT MAY BE MOVED AT RUNTIME
void Init(HMODULE nsModule, const PluginNorthstarData* initData, bool reloaded); // called after the plugin has been validated. The nsmodule allows northstar plugins to work for the ronin client as well (assuming they update their fork lmao)
void Finalize(); // called after all plugins have been loaded. Useful for dependencies
void Unload(); // called just before the plugin is getting unloaded
void OnSqvmCreated(CSquirrelVM* sqvm); // the context of the sqvm is contained in the instance
void OnSqvmDestroying(CSquirrelVM* sqvm); // callback with the sqvm instance that's about to be destroyed (for UI, CLIENT is destroyed for some reason??)
void OnLibraryLoaded(HMODULE module, const char* libraryName); // called for any library loaded by the game (for example engine.dll)
void RunFrame(); // just runs on every frame of the game I think
What's an interface anyways?
----------------------------

Interfaces are just abstract classes. So make sure the first parameter is always a pointer to the instance of the interface you're using.

an example what NSSys001 looks like in C:

.. code-block::
typedef enum {
LOG_INFO,
LOG_WARN,
LOG_ERR,
};
typedef struct CSys {
struct {
void (*log)(struct CSys* self, HMODULE handle, LogLevel level, char* msg);
void (*unload)(struct CSys* self, HMODULE handle);
}* vftable;
} CSys;
// use like this
g_c_sys->vftable->log(g_c_sys, g_handle, LOG_INFO, "my balls are itching");
Interfaces are created with CreateInterface that's exposed in another dll.
10 changes: 10 additions & 0 deletions docs/source/plugins/resources.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Resources
=========

Templates
---------
* **NSPluginTemplate:** https://github.com/uniboi/NSPluginTemplate/

Libs
----
* **rrplug:** https://crates.io/crates/rrplug
2 changes: 1 addition & 1 deletion docs/source/reference/respawn/entities.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1040,7 +1040,7 @@ Shared

Add a mod to this weapon

.. cpp:function:: void FireWeaponBullet_Special(vector origin, vector direction, int numShots, int damageType, bool noAntilag, bool noSpread, bool onlyDamageEntitiesOnce, bool unknownPurpose, bool noTracers, bool activeShot, bool doTraceBrushOnly)
.. cpp:function:: void FireWeaponBullet_Special(vector origin, vector direction, int numShots, int damageType, bool noAntilag, bool noSpread, bool onlyDamageEntitiesOnce, bool noImpactFX, bool noTracers, bool activeShot, bool doTraceBrushOnly)

.. cpp:function:: string GetWeaponSettingString( string setting )

Expand Down
2 changes: 1 addition & 1 deletion docs/source/reference/respawn/native_server/debugdraw.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Debug Drawing

The rest are defined in scripts using these.

In Titanfall it is possible to draw shapes in 3D, from the SERVER and CLIENT VM, using the debug draw functions, however in order for them to actually render you will need to set ``enable_debug_overlays 1`` in your launch config or console.
In Titanfall it is possible to draw shapes in 3D, from the SERVER and CLIENT VM, using the debug draw functions, however in order for them to actually render you will need to set ``sv_cheats 1`` and ``enable_debug_overlays 1`` in your launch config or console.

These debug drawing functions are available:

Expand Down
Loading

0 comments on commit 8816df2

Please sign in to comment.