Coder Social home page Coder Social logo

mhwluascript's Introduction

MHWLua脚本载入Mod

可用于载入Lua脚本来控制游戏行为,初始化完成后将加载Monster Hunter World\nativePC\LuaScript中的全部lua文件并运行其中的run函数。

示例

示例脚本为榴弹袭击脚本,可在使用动作决胜姿势2时对目视方向释放最少8发榴弹袭击

function run ()
	local x,y,z = Game_Player_GetPlayerCollimatorCoordinate()
	local wpType = Game_Player_Weapon_GetWeaponType()
	local wpId = Game_Player_Weapon_GetWeaponId()
	if Game_Player_GetPlayerActionId() == 12390
	then
		System_Chronoscope_AddChronoscope(1,'PreLaunchAction')
	end
	if System_Chronoscope_CheckChronoscope('PreLaunchAction')
	then
		Game_Player_Weapon_ChangeWeapons(12,30)
		Game_Player_RunFsmAction(3,11)
		System_Chronoscope_AddChronoscope(0.05,'LaunchAction')
	end
	if System_Chronoscope_CheckChronoscope('LaunchAction')
	then
		local monsterList = Game_Monster_GetAllMonsterCoordinatesInTargetPointRange(x,y,z,0,8000)
		if #monsterList < 8 then
			for i=0,8 - #monsterList,1 do
				Game_Player_CreateWeaponProjectiles(
					13,
					x,y+1500,z,
					x + Lua_Math_Rander(-500,500) ,y + Lua_Math_Rander(0,500) ,z + Lua_Math_Rander(-500,500)
				)
			end
		end
		for _, monster in pairs(monsterList) do
			Game_Player_CreateWeaponProjectiles(
				13,
				x,y+1500,z,
				monster.X + Lua_Math_Rander(-150,150) ,monster.Y + Lua_Math_Rander(-150,150) ,monster.Z + Lua_Math_Rander(-150,150)
			)
		end
		Game_Player_Weapon_ChangeWeapons(wpType,wpId)
		Game_Player_RunFsmAction(1,6)
	end
end

API说明

LuaApi调用请参考https://docs.alcedogroup.com/

mhwluascript's People

Contributors

halcyonalcedo avatar ooomu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

mhwluascript's Issues

在线脚本库

拟创建在线脚步库,支持在线编写、保存、共享脚本,并通过共享地址被游戏直接获取脚本.

  • 实现Mod从云端加载并运行脚本
  • 创建可供编写、保存、共享的网页平台
  • 可供个人托管的平台和脚本配置

How to use this line of code?

Hi, i've been using your LUASCRIPT and have been reading your contents at https://docs.alcedogroup.com/jiao-ben/gong-neng/guai-wu
and I really loved your content, big fan of it, and I've been making several mods based on LUA too!!!

I really wanted to ask how this syntax works System_Sound_PlaySound(). I've tried this System_Sound_PlaySound('NativePC/LuaScript/Sfx/JCE.wav') but it still doesn't work. Can you help me identify the issue? thanks!

更换时装崩溃

更换时装时部分时装发生闪退情况,目前还不确定是否为当前Mod导致的,还有待排查

环境生物获取异常

环境生物地址获取在小屋时正常,但在大地图上获取时会出现漏获取的问题,怀疑是注入点错误导致,需要花时间再去寻找注入点。
目前先排查是否由于代码问题导致获取到的正确地址未能正常使用,确认后如果代码无误,则去寻找更加合适的注入点

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.