- Joined
- Jul 26, 2008
- Messages
- 1,009
I'm working on a map to compete with SotDRP, and have made heavy, heavy progress. I'm now in need of a much better 'skilladd system, as my own causes far too heavy of lag and has numerous issues.
This is the trigger I'm using:
I know it can be improved greatly. Right now it's over 8000 lines long alone, far too many for a playable map. It ties into a chat system, just as a fair warning.
I'll give you any additional info you need and talk to you one on one about it. You'll be heavily credited, and your name will be well known in the RP community.
As well, if you wish to jump on the project, which I'll link at the end here, I'd greatly appreciate it. I'm in need of one or two other systems as well.
http://www.hiveworkshop.com/forums/f256/vuens-d-d-te-huge-improvement-97224/
This is the trigger I'm using:
JASS:
//This is where it actually adds the skill, levels it, etc.
function AddDefend takes nothing returns nothing
if IsUnitSelected(GetEnumUnit(), udg_TEMP_Player) then
call UnitAddAbilityBJ( 'Adef', GetEnumUnit() )
endif
endfunction
function RemoveDefend takes nothing returns nothing
if IsUnitSelected(GetEnumUnit(), udg_TEMP_Player) then
call UnitRemoveAbilityBJ( 'Adef', GetEnumUnit() )
endif
endfunction
function LevelDefend takes nothing returns nothing
if IsUnitSelected(GetEnumUnit(), udg_TEMP_Player) then
call IncUnitAbilityLevelSwapped( 'Adef', GetEnumUnit() )
endif
endfunction
function DelevelDefend takes nothing returns nothing
if IsUnitSelected(GetEnumUnit(), udg_TEMP_Player) then
call DecUnitAbilityLevelSwapped( 'Adef', GetEnumUnit() )
endif
endfunction
//This recognizes the string you entered and decides what desired result you want done.
function DoSkillAddHU takes integer id returns boolean
local group grp
local player pl
local force fp
local string str
local string text
local integer utype
local integer i1
local integer i2
local integer array ratios
set pl = ConvertedPlayer(id)
if not(IsPlayerInForce(pl, udg_Force[2])) then
//********************RETURN
return false //not a command
endif
set fp = bj_FORCE_PLAYER[id-1]
set str = StringCase(GetEventPlayerChatString(), false)
if (str == "adddefend" or str == "'defend") then
set udg_TEMP_Player = pl
set grp = GetUnitsInRectAll(GetPlayableMapRect())
call ForGroupBJ( grp, function AddDefend )
call DestroyGroup(grp)
call DebugCommand(str,id)
elseif (str == "@defend" or str == "removedefend") then
set udg_TEMP_Player = pl
set grp = GetUnitsInRectAll(GetPlayableMapRect())
call ForGroupBJ( grp, function RemoveDefend )
call DestroyGroup(grp)
call DebugCommand(str,id)
elseif (str == "+defend" or str == "lvldefend") then
set udg_TEMP_Player = pl
set grp = GetUnitsInRectAll(GetPlayableMapRect())
call ForGroupBJ( grp, function LevelDefend )
call DestroyGroup(grp)
call DebugCommand(str,id)
elseif (str == "=defend" or str == "deleveldefend") then
set udg_TEMP_Player = pl
set grp = GetUnitsInRectAll(GetPlayableMapRect())
call ForGroupBJ( grp, function DelevelDefend )
call DestroyGroup(grp)
call DebugCommand(str,id)
endif
//********************RETURN
return true //is a command
function ChatEntered takes nothing returns nothing
local integer id
set id = GetConvertedPlayerId(GetTriggerPlayer())
//call DisplayTextToForce( GetPlayersAll(), I2S(id) )
call DoChatSystem(id)
endfunction
endfunction
function DoChatSystem takes integer id returns nothing
local group grp
local player pl
local force fp
local integer chatnum
local string text
local string str
local integer i
set pl = ConvertedPlayer(id)
set fp = bj_FORCE_PLAYER[id-1]
set str = GetEventPlayerChatString()
//There are several elseifs inbetween that utelize the local Xs and set Xs you see above.
//Hides the string from DM chat
elseif GetBooleanAnd(SubStringBJ(str,1,1) == "'" or SubStringBJ(str,1,1) == "+"or SubStringBJ(str,1,1) == "@"or SubStringBJ(str,1,1) == "=", IsPlayerInForce(pl, udg_Force[2])) then
//Get rid of that pesky space people like to add
if (SubStringBJ(str,2,2) == " ") then
set text = SubStringBJ(str,3,StringLength(str))
else
set text = SubStringBJ(str,2,StringLength(str))
endif
if DoSkillAddHU(id) then
endif
I'll give you any additional info you need and talk to you one on one about it. You'll be heavily credited, and your name will be well known in the RP community.
As well, if you wish to jump on the project, which I'll link at the end here, I'd greatly appreciate it. I'm in need of one or two other systems as well.
http://www.hiveworkshop.com/forums/f256/vuens-d-d-te-huge-improvement-97224/
Last edited: