Jump to content

Recommended Posts

Trying to tweak existing mod for myself (make ability unlimited duration).
The mod is: Homura Akemi

changed code are in \scripts\components\skill_homura.lua (line 117)

	if self.left_time > 0 then
  		--self.inst:ListenForEvent('homuraUI_fn_dirty', function() self:ForceEndSkill() end)
		TheInput:AddKeyDownHandler(PUELLA_MOD_SETTINGS.SKILLKEY, function() self:ForceEndSkill() end)
  		--self.left_time = self.left_time - dt
		if self.left_time <= 0 then
			self:EndSkill()
		elseif self.inst.components.health:IsDead()then
			self:ForceEndSkill()
		end
	end

It works in single player, but doesn't work when launching server (ability doesn't stop on key press).

If I use

self.inst:ListenForEvent('homuraUI_fn_dirty', function() self:ForceEndSkill() end)

instead of

TheInput:AddKeyDownHandler(PUELLA_MOD_SETTINGS.SKILLKEY, function() self:ForceEndSkill() end)

ability stops fine on first use (local and server), but it breaks and doesn't reactivates any further unlit relog.

What should I add to make it work properly? Any examples?

Edited by Luneyl

That's because this mod is done improperly for a client-server setup.

It should be using an RPC from the client to send to the server that the event happened for the skill use, and the server should do its actions there.

If a server needs to communicate any information back to the client, then it should use a netvar.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...