AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Coding MM:S Plugins & SM Extensions (https://forums.alliedmods.net/forumdisplay.php?f=75)
-   -   Accessing MM:S plugin through Lua Script in Dota (https://forums.alliedmods.net/showthread.php?t=306400)

theslavemaster 03-29-2018 11:42

Accessing MM:S plugin through Lua Script in Dota
 
I want to write a function in C++ which I can access through my custom game lua file (addon_game_mode.lua). Is this possible through MM:S ?

psychonic 03-29-2018 12:45

Re: Accessing MM:S plugin through Lua Script in Dota
 
To do so, you need to declare a ScriptDesc, and the register it.

There are some examples in the SDK for how the game does it. Doing from a plugin is similar. There are examples of doing so in a plugin here, https://github.com/tetl/LuaEx (which was actually written for Source 1 Dota 2 long ago).

theslavemaster 03-30-2018 01:11

Re: Accessing MM:S plugin through Lua Script in Dota
 
Quote:

There are some examples in the SDK for how the game does it
Which SDK are you talking about? Source 2 SDK? Sorry I'm completely new to Source so don't know much about how plugins/sdk work

psychonic 03-30-2018 07:25

Re: Accessing MM:S plugin through Lua Script in Dota
 
Quote:

Originally Posted by theslavemaster (Post 2585269)
Which SDK are you talking about? Source 2 SDK? Sorry I'm completely new to Source so don't know much about how plugins/sdk work

Your best bet is to use that linked plugin as an example. It's explicit purpose was to expose plugin functions into the Lua API. While it was made for Source 1, the VScript APIs have not really changed since then.


All times are GMT -4. The time now is 04:40.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.