This page belongs to the force power registration structure when creating your own force powers in the lua/wos/advswl/forcepowers
folder of the addon.
The syntax is an expanded version of Robotboy's original addon to be more modular. All properties are always registered within the forcepower and accessible at any time, but only select properties are networked.
name [string]
The name of the force power.
icon [string]
The characters that will be used for quick reference if using Hybrid or Classic force power HUD settings.
image [string]
The path of the material or png that will be used for the force power in all related menus and HUDs.
description [string]
The description of the force power that will appear in the force power selection menu or the selection of Hybrid or Classic force power HUD settings.
help [string]
The help text on how to use the force power that will appear in the force power selection menu when you right click on it.
cooldown [float]
The amount of time that a player must wait before casting this power again.
action [function]
The function that activates when you press your alternate fire button. The only argument is the weapon (self) and it is only called on the SERVER
A simple force power that heals the current owner when used
action = function( self ) local owner = self.Owner if not IsValid( owner ) then return end if self:GetForce() < 30 then return end self.Owner:SetHealth( math.min( self.Owner:Health() + 10, self.Owner:GetMaxHealth() ) ) self:AddForce( -30 ) return trueend,
think [function]
The function that activates when you have this force power selected. The only argument is the weapon (self) and it is only called on the SERVER
Another simple force power that adds health if below 50% current health on cooldown. The force power is on cooldown for x seconds only when healh was added below 50% max health
think = function( self ) local owner = self.Owner if not IsValid( owner ) then return end if self.Owner:Health() >= self.Owner:GetMaxHealth()*0.5 then return end self.Owner:SetHealth( math.min( self.Owner:Health() + 30, self.Owner:GetMaxHealth() ) ) return trueend,