码迷,mamicode.com
首页 > 其他好文 > 详细

Rpgmakermv(14)Archeia_Steamworks

时间:2018-03-24 13:29:41      阅读:323      评论:0      收藏:0      [点我收藏+]

标签:form   friends   serve   font   ext   mat   lib   skill   ade   

作用:

接入steam成就

 

-----------------------------------------------------------------------------------原文:-----------------------------------------------------------------------------------

---------------------------------------------------------------------------

This plugin allows Steamworks integration into your RPG Maker Game via a

modified Greenworks node module. This plugin will only function on Windows

(and Mac ONE DAY MAYBE I HOPE) builds. Due to this plugin being built upon

a modified Greenworks module, you must credit the creators of Greenworks

and since Greenworks is Licensed under the MIT license, you must also include

that license in your game package.

 

Greenworks: https://github.com/greenheartgames/greenworks

 

----------------------------------------------------------------------------

HOW-TO (INSTALL)

----------------------------------------------------------------------------

 

In order to use this plugin, you must first have the Steamworks SDK found

here: https://partner.steamgames.com/?goto=%2Fhome

 

Once you have the Steamworks SDK downloaded and extracted copy the binaries

from the redistributable folder to "yourProject\js\libs" directory. The files

you will want to copy are:

 

WINDOWS: steam_api.dll

(FOR THE FUTURE: MAC: libsteam_api.dylib)

 

Then copy the contents of this package to your plugin folder, keeping the

file structure intact. The end result of this should be:

 

yourProjectMainFolder

- js

-- libs

--- steamworks-win32.node

--- steamworks.js

-- plugins

--- Archeia_Steamworks.js

- data

- img

- audio

- fonts

- icon

 

Then simply add the plugin to the plugin manager, and it is installed.

 

(NOTE FOR PLAY TESTING)

Steam needs to know the app-id for your game, it can only knows this

automatically when you launch the game via steam. So when play testing, you

need to place a text file called steam_appid.txt with a single line containing

your games steam app id, inside the nwjs-win (FOR FUTURE: nwjs-osx for Mac‘s)

folder of your RPG Maker MV install. On steam that is the following:

 

(WINDOWS)

STEAM_INSTALL_LOCATION\steamapps\common\RPG Maker MV\nwjs-win

(FOR FUTURE WHEN MACS BECOME A THING)

STEAM_INSTALL_LOCATION\steamapps\common\RPG Maker MV\nwjs-osx

 

============================================================================

HOW-TO (USAGE)

============================================================================

 

The plugin is meant to be easily usable for non-developers via plugin commands.

Some things however require a "Callback" function, as they have to connect to

steams servers to get information, or do things (e.g: unlocking achievements)

these things may take some time, and therefore when using plugin commands that

require a callback, you should apply a wait before executing more logic.

The plugin is a wrapper for my modified Greenworks module, meaning that

the functions used by the plugin commands are usable by developers in their

own plugins.

 

 

----------------------------------------------------------------------------

PLUGIN COMMANDS

----------------------------------------------------------------------------

 

Plugin commands are case insensitive so any case is usable.

All plugins have the initial command prefix as "steamworks" followed by the

action name, and then the arguments for the action.

 

All plugins that return a value, will return -1 if an error occurs. This

is so you can check if something bad happens with events.

 

----------------------------------------------------------------------------

GETTING THE USERS STEAM NAME

----------------------------------------------------------------------------

 

Action Name(s): steamname, screenname, or name

 

Arguments: the variable id (a number) to place the name in.

 

Callback(s): No.

 

Usage Example(s):

 

steamworks steamname 1

steamworks screenname 999

StEaMwOrKs NAME 626

 

Usage Explanation:

 

First we use the command steamworks, this lets the plugin command interpreter

know that we want to do a steamworks command, then we specify the action as

getting the steam name, we then use the variable provided (in the examples:

1, 999 and 626) to store the steam name once we obtain it.

 

----------------------------------------------------------------------------

GETTING THE USERS STEAM ID/ACCOUNT ID

----------------------------------------------------------------------------

 

Action Name(s): steamid, accountid, or id

 

Arguments: the variable id (a number) to place the steam id in.

 

Callback(s): No.

 

Usage Example(s):

 

steamworks steamid 1

steamworks accountid 1333

StEaMwOrKs Id 909

 

Usage Explanation:

 

First we use the command steamworks, this lets the plugin command interpreter

know that we want to do a steamworks command, then we specify the action as

getting the steam id, we then use the variable provided (in the examples:

1, 1333 and 909) to store the steam id once we obtain it.

 

----------------------------------------------------------------------------

GETTING THE USERS STATIC STEAM ID/STATIC ACCOUNT ID

----------------------------------------------------------------------------

 

Action Name(s): staticsteamid, staticid, or staticaccountid

 

Arguments: the variable id (a number) to place the static id in.

 

Callback(s): No.

 

Usage Example(s):

 

steamworks staticsteamid 2

steamworks staticid 2000

StEaMwOrKs staticaccountid 109

 

Usage Explanation:

 

First we use the command steamworks, this lets the plugin command interpreter

know that we want to do a steamworks command, then we specify the action as

getting the static steam id, we then use the variable provided (in the examples:

2, 2000 and 109) to store the static steam id once we obtain it.

 

 

----------------------------------------------------------------------------

GETTING THE USERS STEAM LEVEL

----------------------------------------------------------------------------

 

Action Name(s): level or steamlevel

 

Arguments: the variable id (a number) to place the level in.

 

Callback(s): No.

 

Usage Example(s):

 

steamworks level 2

steamworks steamlevel 987

StEaMWORKs STEAMLEVEL 1100

 

Usage Explanation:

 

First we use the command steamworks, this lets the plugin command interpreter

know that we want to do a steamworks command, then we specify the action as

getting the users steam level, we then use the variable provided (in the examples:

2, 987 and 1100) to store the users steam level once we obtain it.

 

 

----------------------------------------------------------------------------

GETTING THE NUMBER OF PLAYERS IN GAME NOW

----------------------------------------------------------------------------

 

Action Name(s): numofplayers or playercount

 

Arguments: the variable id (a number) to place the amount of players in.

 

Callback(s): Yes, so use a wait event.

 

Usage Example(s):

 

steamworks numofplayers 1

steamworks playercount 200

StEaMwOrKs NUMOFPLAYERS 10

 

Usage Explanation:

 

First we use the command steamworks, this lets the plugin command interpreter

know that we want to do a steamworks command, then we specify the action as

getting the amount of players in game, we then use the variable provided (in the examples:

1, 200 and 10) to store the amount of players once it is obtained. This

is an action that requires a callback, and must connect to steams server. It

is advised to use a wait event to wait a few frames for this to occur.

 

----------------------------------------------------------------------------

GETTING THE NUMBER OF ACHIEVEMENTS IN YOUR GAME

----------------------------------------------------------------------------

 

Action Name(s): numofachievements or achievementcount

 

Arguments: the variable id (a number) to place the returned value in.

 

Callback(s): No.

 

Usage Example(s):

 

steamworks numofachievements 7

steamworks numofachievements 8

StEaMwOrKs achievementcount 9

 

Usage Explanation:

 

First we use the command steamworks, this lets the plugin command interpreter

know that we want to do a steamworks command, then we specify the action as

getting the amount of achievements the game as, we then use the variable

provided (in the examples: 7, 8 and 9) to store the amount of achievements

the game has.

 

----------------------------------------------------------------------------

GETTING IF THE USER HAS STEAM OVERLAY ENABLED

----------------------------------------------------------------------------

 

Action Name(s): overlayenabled, gameoverlayenabled or steamoverlayenabled

 

Arguments: the variable id (a number) to place the returned value in.

 

Callback(s): No.

 

Usage Example(s):

 

steamworks overlayenabled 10

steamworks gameoverlayenabled 11

StEaMwOrKs steamoverlayenabled 12

 

Usage Explanation:

 

First we use the command steamworks, this lets the plugin command interpreter

know that we want to do a steamworks command, then we specify the action as

getting whether the user has overlay enabled or not, we then use the variable

provided (in the examples: 10, 11 and 12) to store if they have the overlay

enabled or not in it.

 

NOTE: The return values for this differ since this returns a boolean.

If an error occurs (such as Steamworks not being initialized) it returns -1

if the value is false it return 0, if the value is true it returns 1.

 

----------------------------------------------------------------------------

OPENING THE STEAM OVERLAY

----------------------------------------------------------------------------

 

Action Name(s): openoverlay, opensteamoverlay or opengameoverlay

 

Arguments: the location to open to. The following are valid options:

Friends, Community, Players, Settings, OfficialGameGroup, Stats and Achievements

 

Callback(s): No.

 

Usage Example(s):

 

steamworks openoverlay Friends

steamworks opensteamoverlay Settings

StEaMwOrKs opengameoverlay Achievements

 

Usage Explanation:

 

First we use the command steamworks, this lets the plugin command interpreter

know that we want to do a steamworks command, then we specify the action is to

open the game overlay to the Friends list, the Settings, and the Achievements

page.

 

----------------------------------------------------------------------------

OPENING THE STEAM OVERLAY TO A URL

----------------------------------------------------------------------------

 

Action Name(s): openoverlaytourl, opengameoverlayurl or opensteamovertourl

 

Arguments: the url to open to.

 

Callback(s): No.

 

Usage Example(s):

 

steamworks openoverlay http://anima.mintkit.lol

steamworks opensteamoverlay http://archeia.moe

StEaMwOrKs opengameoverlay http://rpgmakerweb.com

 

Usage Explanation:

 

First we use the command steamworks, this lets the plugin command interpreter

know that we want to do a steamworks command, then we specify the action is to

open the game overlay to the specified url. The urls given in the examples

are urls to Liquidize‘s and Archeia‘s websites, as well as the website to

RPGMaker Web.

 

----------------------------------------------------------------------------

UNLOCKING AN ACHIEVEMENT

----------------------------------------------------------------------------

 

Action Name(s): activateachievement, giveachivement or grantachievement

 

Arguments: the achievement name to unlock.

 

Callback(s): Yes, this function requires a callback and therefore must

take some time, it is recommended to do a wait message if you want to do things

such as notify the player in game.

 

Usage Example(s):

 

steamworks activateachievement THE_BEST_ACHIEVEMENT_EVER

steamworks giveachivement WHAT_IS_MOE_BABY_DONT_MOE_ME_NO_MOE

StEaMwOrKs grantachievement BY_THE_POWER_OF_MEMES

 

Usage Explanation:

 

First we use the command steamworks, this lets the plugin command interpreter

know that we want to do a steamworks command, then we specify the action is to

unlock the specified achievement.

 

Special Notes: The plugin command for this, uses a special call back that

executes the function to give, or take items and skills when an achievement

is acquired. For more information about this, see the notetag section.

 

 

----------------------------------------------------------------------------

REMOVING/CLEARING/LOCKING AN ACHIEVEMENT

----------------------------------------------------------------------------

 

Action Name(s): deactivateachievement, clearachievement or getrekted

 

Arguments: the achievement name to lock/remove.

 

Callback(s): Yes, this function requires a callback and therefore must

take some time, it is recommended to do a wait message if you want to do things

such as notify the player in game.

 

Usage Example(s):

 

steamworks activateachievement THE_BEST_ACHIEVEMENT_EVER

steamworks giveachivement WHAT_IS_MOE_BABY_DONT_MOE_ME_NO_MOE

StEaMwOrKs grantachievement BEST_PLUGIN_2016

 

Usage Explanation:

 

First we use the command steamworks, this lets the plugin command interpreter

know that we want to do a steamworks command, then we specify the action is to

lock the specified achievement.

 

Special Notes: The plugin command for this, uses a special call back that

executes the function to give, or take items and skills when an achievement

is removed/locked. For more information about this, see the notetag section.

 

============================================================================

NOTE TAGS

============================================================================

 

This plugin makes it easy for non-scripters to grant their users some rewards

for obtaining, or losing achievements. You do this by using note tags on the

specified objects.

 

Note tags are case insensitive, so any casing will work.

 

-----------------------------------------------------------------------------

ITEM,WEAPON, and ARMOR Note tags

-----------------------------------------------------------------------------

The below are note tags usable in Item, Weapon, or Armor objects.

-----------------------------------------------------------------------------

WHEN AN ACHIEVEMENT IS UNLOCKED

-----------------------------------------------------------------------------

 

Notetag: <ACHIEVEMENT GRANT: ACHIEVEMENT_NAME,+/-AMOUNT_TO_GIVEHERE/>

 

Aliases: <ACHIEVEMENT UNLOCKED: ACHIEVEMENT_NAME,+/-AMOUNT_TO_GIVEHERE/>

<ACHIEVEMENT ACHIEVED: ACHIEVEMENT_NAME,+/-AMOUNT_TO_GIVEHERE/>

 

Usage Example(s):

 

<ACHIEVEMENT GRANT: MY_LOVELY_ACHIEVEMENT,+1/>

<ACHIEVEMENT ACHIEVED: MY_LOVELY_ACHIEVEMENT_SUPERMODE,-10/>

 

Usage Explanation:

 

The first example above will give the player 1 of the item,weapon,or armor

when the achievement called "MY_LOVELY_ACHIEVEMENT" is unlocked.

 

The second example will take 10 of the item,weapon,or armor from the user if

the achievement "MY_LOVELY_ACHIEVEMENT_SUPERMODE" is unlocked.

 

-----------------------------------------------------------------------------

WHEN AN ACHIEVEMENT IS REMOVED/LOCKED

-----------------------------------------------------------------------------

 

Notetag: <ACHIEVEMENT CLEAR: ACHIEVEMENT_NAME,+/-AMOUNT_TO_GIVEHERE/>

 

Aliases: <ACHIEVEMENT TAKEN: ACHIEVEMENT_NAME,+/-AMOUNT_TO_GIVEHERE/>

<ACHIEVEMENT UNACHIEVED: ACHIEVEMENT_NAME,+/-AMOUNT_TO_GIVEHERE/>

<ACHIEVEMENT REKTED: ACHIEVEMENT_NAME,+/-AMOUNT_TO_GIVEHERE/>

 

Usage Example(s):

 

<ACHIEVEMENT CLEAR: MY_LOVELY_ACHIEVEMENT,+1/>

<ACHIEVEMENT UNACHIEVED: MY_LOVELY_ACHIEVEMENT_SUPERMODE,-10/>

 

Usage Explanation:

 

The first example above will give the player 1 of the item,weapon,or armor

when the achievement called "MY_LOVELY_ACHIEVEMENT" is removed or locked.

 

The second example will take 10 of the item,weapon,or armor from the user if

the achievement "MY_LOVELY_ACHIEVEMENT_SUPERMODE" is removed or locked.

 

-----------------------------------------------------------------------------

Class Note tags

-----------------------------------------------------------------------------

The below are note tags usable in the Class object.

 

-----------------------------------------------------------------------------

WHEN AN ACHIEVEMENT IS UNLOCKED

-----------------------------------------------------------------------------

 

Notetag: <ACHIEVEMENT GRANT: ACHIEVEMENT_NAME,LEARN/UNLEARN,SKILL_ID/>

 

Aliases: <ACHIEVEMENT UNLOCKED: ACHIEVEMENT_NAME,LEARN/UNLEARN,SKILL_ID/>

<ACHIEVEMENT ACHIEVED: ACHIEVEMENT_NAME,LEARN/UNLEARN,SKILL_ID/>

 

Usage Example(s):

 

<ACHIEVEMENT GRANT: MY_LOVELY_ACHIEVEMENT,LEARN,1/>

<ACHIEVEMENT ACHIEVED: MY_LOVELY_ACHIEVEMENT_SUPERMODE,UNLEARN,99/>

 

Usage Explanation:

 

The first example above will give any party member, whose class has this tag,

the skill with ID 1, when this achievement is unlocked.

 

The second example will take skill 99 from any party member, whose class has

this tag when this achievement (MY_LOVELY_ACHIEVEMENT_SUPERMODE) is unlocked.

 

-----------------------------------------------------------------------------

WHEN AN ACHIEVEMENT IS REMOVED/LOCKED

-----------------------------------------------------------------------------

 

Notetag: <ACHIEVEMENT CLEAR: ACHIEVEMENT_NAME,LEARN/UNLEARN,SKILL_ID/>

 

Aliases: <ACHIEVEMENT TAKEN: ACHIEVEMENT_NAME,LEARN/UNLEARN,SKILL_ID/>

<ACHIEVEMENT UNACHIEVED: ACHIEVEMENT_NAME,LEARN/UNLEARN,SKILL_ID/>

<ACHIEVEMENT REKTED: ACHIEVEMENT_NAME,LEARN/UNLEARN,SKILL_ID/>

 

Usage Example(s):

 

<ACHIEVEMENT CLEAR: MY_LOVELY_ACHIEVEMENT,LEARN,1/>

<ACHIEVEMENT UNACHIEVED: MY_LOVELY_ACHIEVEMENT_SUPERMODE,UNLEARN,99/>

 

Usage Explanation:

 

The first example above will give any party member, whose class has this tag,

the skill with ID 1, when this achievement is removed/locked.

 

The second example will take skill 99 from any party member, whose class has

this tag.

 

 

============================================================================

WHY NO MAC!?

============================================================================

Neither I nor does Archeia own a Mac, and therefore we can‘t compile the

required libraries for Mac easily. A Mac version will be available soon.

Please be patient.

 

============================================================================

Coming soon, to a plugin near you.

============================================================================

 

- Steam Cloud Syncing (We‘re working on it)

- Workshop Support (I don‘t know why, but we‘re working on it)

- Find a way to make steam overlay function

- Mac and Linux Support

 

============================================================================

Change Log

============================================================================

 

Version 1.0:

- Finished Script!

 

=============================================================================

 

 

 

 

------------------------------------------------------------------------------------简要翻译:-----------------------------------------------------------------------------------

-------------------------------------------------- -------------------------
這個插件允許Steamworks集成到你的RPG遊戲製作者遊戲中
修改了Greenworks節點模塊。這個插件只能在Windows上運行
(以及Mac ONE ONE MAYBE I HOPE)構建。由於這個插件是建立在
一個修改過的Greenworks模塊,你必須相信Greenworks的創造者
並且由於Greenworks根據MIT許可獲得許可,您還必須包括
該遊戲包中的許可證。

綠色工作:https://github.com/greenheartgames/greenworks

-------------------------------------------------- --------------------------
如何安裝)
-------------------------------------------------- --------------------------

為了使用這個插件,你必須先找到Steamworks SDK
這裡:https://partner.steamgames.com/?goto=%2Fhome

一旦你有Steamworks SDK下載並提取複製二進製文件
從可再發行文件夾到“yourProject \ js \ libs”目錄。文件
你會想要復制的是:

WINDOWS:steam_api.dll
(未來:MAC:libsteam_api.dylib)

然後將這個包的內容複製到你的插件文件夾中,保留這個文件夾
文件結構完好無損。最終的結果應該是:

yourProjectMainFolder
- js
- 庫
--- steamworks-win32.node
--- steamworks.js
- 插件
--- Archeia_Steamworks.js
- 數據
- img
- 音頻
- 字體
- 圖標

然後只需將該插件添加到插件管理器,然後安裝它。

(遊戲測試注意事項)
Steam需要知道你的遊戲的app-id,它只能知道這一點
自動通過蒸汽啟動遊戲。所以當玩測試時,你
需要在一行中包含一個名為steam_appid.txt的文本文件
你的遊戲蒸汽應用ID,在nwjs-win(未來:Mac的nwjs-osx)
你的RPG Maker MV安裝文件夾。以下是蒸汽:

(視窗)
STEAM_INSTALL_LOCATION \ steamapps \ common \ RPG Maker MV \ nwjs-win
(未來當MACS成為事物時)
STEAM_INSTALL_LOCATION \ steamapps \ common \ RPG Maker MV \ nwjs-osx

================================================== ==========================
如何使用(使用)
================================================== ==========================

該插件旨在通過插件命令輕鬆適用於非開發人員。
然而,有些事情需要“回撥”功能,因為他們必須連接
讓服務器獲取信息或做事情(例如:解鎖成就)
這些事情可能需要一些時間,因此使用插件命令時
需要回調,您應該在執行更多邏輯之前應用等待。
該插件是我修改的Greenworks模塊的封裝,意思是說
插件命令使用的函數可供開發人員使用
自己的插件。


-------------------------------------------------- --------------------------
插件命令
-------------------------------------------------- --------------------------

插件命令不區分大小寫,所以任何情況都是可用的。
所有的插件都有最初的命令前綴作為“steamworks”,接著是
動作名稱,然後是動作的參數。

如果發生錯誤,所有返回值的插件將返回-1。這個
是這樣你可以檢查事件是否發生了不好的事情。

-------------------------------------------------- --------------------------
獲取用戶Steam名稱
-------------------------------------------------- --------------------------

操作名稱:steamname,screenname或name

參數:放置名稱的變量id(一個數字)。

回調:沒有。

用法示例:

steamworks steamname 1
steamworks screenname 999
StEaMwOrKs名稱626

用法說明:

首先我們使用命令steamworks,這讓plugin命令解釋器
知道我們想要執行steamworks命令,那麼我們將動作指定為
獲取蒸汽名稱,然後使用提供的變量(在示例中:
1,999和626)存儲蒸汽名稱,一旦我們獲得它。

-------------------------------------------------- --------------------------
獲取用戶Steam帳戶ID /帳戶ID
-------------------------------------------------- --------------------------

操作名稱:steamid,accountid或id

參數:放置蒸汽ID的變量id(一個數字)。

回調:沒有。

用法示例:

steamworks蒸汽1
蒸汽工程獲得1333
StEaMwOrKs Id 909

用法說明:

首先我們使用命令steamworks,這讓plugin命令解釋器
知道我們想要執行steamworks命令,那麼我們將動作指定為
獲取蒸汽ID,然後使用提供的變量(在示例中:
1,1333和909),一旦我們獲得了蒸汽識別碼。

-------------------------------------------------- --------------------------
獲取用戶靜態蒸汽ID /靜態帳戶ID
-------------------------------------------------- --------------------------

操作名稱:staticsteamid,staticid或staticaccountid

參數:放置靜態id的變量id(一個數字)。

回調:N

 

Rpgmakermv(14)Archeia_Steamworks

标签:form   friends   serve   font   ext   mat   lib   skill   ade   

原文地址:https://www.cnblogs.com/empist/p/8638482.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!