Raised This Month: $12 Target: $400
 3% 

Accessing MM:S plugin through Lua Script in Dota


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
theslavemaster
New Member
Join Date: Mar 2018
Old 03-29-2018 , 11:42   Accessing MM:S plugin through Lua Script in Dota
Reply With Quote #1

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 ?
theslavemaster is offline
psychonic

BAFFLED
Join Date: May 2008
Old 03-29-2018 , 12:45   Re: Accessing MM:S plugin through Lua Script in Dota
Reply With Quote #2

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).
psychonic is offline
theslavemaster
New Member
Join Date: Mar 2018
Old 03-30-2018 , 01:11   Re: Accessing MM:S plugin through Lua Script in Dota
Reply With Quote #3

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
theslavemaster is offline
psychonic

BAFFLED
Join Date: May 2008
Old 03-30-2018 , 07:25   Re: Accessing MM:S plugin through Lua Script in Dota
Reply With Quote #4

Quote:
Originally Posted by theslavemaster View Post
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.
psychonic is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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