System Twilight Path RPG's Battle System!

Vestras

Retired
Reaction score
249
Twilight Path RPG's Battle System!

Documentation:
JASS:
//************************************************************************************************
// Battle System by Vestras.                                                                     *
//                                                                                               *
// This system is my best system ever. It's my darling. In my eyes, it's a masterpiece.          *
//                                                                                               *
// How to use:                                                                                   *
// When you use it, you ALWAYS need to call InitBattle() and then call AttackBoard(...). If you  *
// do not call InitBattle() or call AttackBoard(...), nothing will happen.                       *
//                                                                                               *
// Ingame using:                                                                                 *
// Use the arrow keys to go up and down between the options in the multiboard. Press the right   *
// arrow key to select the current option. Press F1 to make spells available.                    *
//                                                                                               *
// Pros:                                                                                         *
// Exciting battling in single player RPGs instead of the boring, old Warcraft battle system.    *
// Easy use.                                                                                     *
// Fleeing.                                                                                      *
// A correct Final Fantasy-feeling.                                                              *
//                                                                                               *
// Cons:                                                                                         *
// If you press the arrow keys too fast, the system will start to bug much. (Blizzard'a fault)   *
//                                                                                               *
// Leaks:                                                                                        *
// None as far as I know, but if you spot some, please report.                                   *
//                                                                                               *
// Credit Vestras when using.                                                                    *
// Thanks for using.                                                                             *
//                                                                                               *
// Visit <a href="http://www.mapcrafting.com" target="_blank" class="link link--external" rel="nofollow ugc noopener">http://www.mapcrafting.com</a>, it&#039;s a great Warcraft III mapping site.                     *
//************************************************************************************************


Code:
JASS:
//************************************************************************************************
// Battle System by Vestras.                                                                     *
//                                                                                               *
// This system is my best system ever. It&#039;s my darling. In my eyes, it&#039;s a masterpiece.          *
//                                                                                               *
// How to use:                                                                                   *
// When you use it, you ALWAYS need to call InitBattle() and then call AttackBoard(...). If you  *
// do not call InitBattle() or call AttackBoard(...), nothing will happen.                       *
//                                                                                               *
// Ingame using:                                                                                 *
// Use the arrow keys to go up and down between the options in the multiboard. Press the right   *
// arrow key to select the current option. Press F1 to make spells available.                    *
//                                                                                               *
// Pros:                                                                                         *
// Exciting battling in single player RPGs instead of the boring, old Warcraft battle system.    *
// Easy use.                                                                                     *
// Fleeing.                                                                                      *
// A correct Final Fantasy-feeling.                                                              *
//                                                                                               *
// Cons:                                                                                         *
// If you press the arrow keys too fast, the system will start to bug much. (Blizzard&#039;a fault)   *
//                                                                                               *
// Leaks:                                                                                        *
// None as far as I know, but if you spot some, please report.                                   *
//                                                                                               *
// Credit Vestras when using.                                                                    *
// Thanks for using.                                                                             *
//                                                                                               *
// Visit <a href="http://www.mapcrafting.com" target="_blank" class="link link--external" rel="nofollow ugc noopener">http://www.mapcrafting.com</a>, it&#039;s a great Warcraft III mapping site.                     *
//************************************************************************************************

library BS

globals
 private real ATBgaugemin = 100 // The minimum before you can attack again.
 private constant integer LockID = &#039;h001&#039; // The raw code of the &quot;Lock&quot; dummy unit. 
 private constant integer SpellUser = &#039;H000&#039; // The raw code of the &quot;Use A Spell&quot; unit.
 private constant real CHeight = 200 // Camera height.    
 private constant real CAngle = 345 // Camera angle.
 private constant real CDistance = 800 // Camera distance to target.
 private constant real Period = 0.15 // The period between camera shifts.
 private constant boolean allowai = true // Allow the AI? If your map is a single player RPG, I suggest that.
 private constant real maximumlife = 25. // The maximum life the cpu can have before the chance of fleeing is there.
 private constant real fleechance = 25. // The fleeing chance.
 private constant string defendpath = &quot;ReplaceableTextures\\CommandButtons\\BTNDefend.blp&quot; // Path of the defend icon. (For Flee)
 private constant string attackpath = &quot;ReplaceableTextures\\CommandButtons\\BTNAttack.blp&quot; // Path of the attack icon. (For Attack)
 private constant string teleportfx = &quot;Abilities\\Spells\\Items\\TomeOfRetraining\\TomeOfRetrainingCaster.mdl&quot; // Path of the model for teleporting.
endglobals

// Don&#039;t touch below

globals
 private timer CamTimer
 private timer SlctTimer
 private timer ReTimer
 private timer AITimer
 private multiboard M
 private integer N
 private integer T
 private integer D
 private integer C
 private group attackers
 private unit atked
 private unit atker
 private unit Lock
 private unit turnunit
 private unit dummy
 private real Rotate
 private real Distance
 private real Angle
 private real R = 0
 private real array ATBgauges[1000] = 0
 private trigger PressUp
 private trigger PressDown
 private trigger PressRight
 private trigger AttackB
 private trigger AddG
 private trigger WhenDies
 private trigger Select
 private trigger Spell
 private real firstx
 private real firsty
 private location cfirst
 private boolean CPUIsDone = false
 private boolean EndBattleb = false
 private boolean b = false
endglobals

private function CleanUp takes nothing returns nothing
 call SetUnitInvulnerable(GetEnumUnit(), false)
 call PauseUnit(GetEnumUnit(), false)
endfunction

private function EndBattle takes nothing returns nothing
debug call BJDebugMsg(&quot;Cleaning Up&quot;)
  call RemoveUnit(dummy)
  call RemoveUnit(Lock)
  call ForGroup(attackers, function CleanUp)
  call ResetToGameCamera(Period)
  call DestroyTimer(CamTimer)
  call DestroyTimer(SlctTimer)
  call DestroyTimer(ReTimer)
  call DestroyTimer(AITimer)
  call ResetToGameCamera(Period)
  call SetUnitInvulnerable(atked, false)
  call SetUnitInvulnerable(atker, false)
  call PauseUnit(atked, false)
  call PauseUnit(atker, false)
  call DestroyTrigger(PressUp)
  call DestroyTrigger(PressDown)
  call DestroyTrigger(PressRight)
  call DestroyTrigger(AttackB)
  call DestroyTrigger(AddG)
  call DestroyTrigger(WhenDies)
  call DestroyTrigger(Select)
  call DestroyTrigger(Spell)
  call DestroyGroup(attackers)
  call MultiboardDisplay(M, false)
  call DestroyMultiboard(M)
  call RemoveLocation(cfirst)
  set cfirst = null
  set attackers = null
  set CamTimer = null
  set SlctTimer = null
  set ReTimer = null
  set AITimer = null
  set PressUp = null
  set PressDown = null
  set PressRight = null
  set AttackB = null
  set AddG = null
  set WhenDies = null
  set Select = null
  set Spell = null
  set atked = null
  set atker = null
  set dummy = null
  set M = null
  set Lock = null
endfunction

private function Camera takes nothing returns nothing
  local location tl = GetUnitLoc(atked)
  local location atkl = GetUnitLoc(atker)
  local real dx = GetLocationX(atkl) - GetLocationX(tl)
  local real dy = GetLocationY(atkl) - GetLocationY(tl)
  local real dist = SquareRoot(dx * dx + dy * dy) / 2
  local location l = PolarProjectionBJ(tl, dist, GetUnitFacing(atked)) // Yes, I know it&#039;s slow, but I don&#039;t think I can use Z cordinates with the &quot;real method&quot;.
    set Lock = CreateUnit(GetOwningPlayer(atked), LockID, GetLocationX(l), GetLocationY(l), 0)
    call PanCameraToTimed(GetLocationX(l), GetLocationY(l), Period)
    call SetCameraTargetController(Lock, 0., 0., false)
    call SetCameraField(CAMERA_FIELD_ROTATION, GetUnitFacing(atked) - 90, Period)
    call SetCameraField(CAMERA_FIELD_ZOFFSET, GetCameraField(CAMERA_FIELD_ZOFFSET) + GetLocationZ(l) + CHeight - GetCameraEyePositionZ(), Period)
    call SetCameraField(CAMERA_FIELD_ANGLE_OF_ATTACK, Angle, Period)
    call SetCameraField(CAMERA_FIELD_TARGET_DISTANCE, Distance, Period)
    call SetUnitFacingToFaceUnitTimed(atker, atked, Period)
  call RemoveLocation(l)
  call RemoveLocation(atkl)
  call RemoveLocation(tl)
  set R = R + 0.15
   if R &gt;= 1. then
    call DestroyTimer(GetExpiredTimer())
   endif
  set tl = null
  set atkl = null
  set l = null
endfunction

private function PressesUp takes nothing returns boolean
 debug call BJDebugMsg(&quot;You have pressed the up arrow key&quot;)
  if N == 1 then
      call MultiboardSetItemValueBJ(M, 1, 1, &quot;Attack&quot;)
      call MultiboardSetItemValueBJ(M, 1, 2, &quot;&gt;&gt; Flee&quot;)
    set N = 2
  elseif N == 2 then
      call MultiboardSetItemValueBJ(M, 1, 1, &quot;&gt;&gt; Attack&quot;)
      call MultiboardSetItemValueBJ(M, 1, 2, &quot;Flee&quot;)
    set N = 1
  endif
 return false // Safety
endfunction

private function PressesDown takes nothing returns boolean
 debug call BJDebugMsg(&quot;You have pressed the down arrow key&quot;)
  if N == 2 then
      call MultiboardSetItemValueBJ(M, 1, 1, &quot;&gt;&gt; Attack&quot;)
      call MultiboardSetItemValueBJ(M, 1, 2, &quot;Flee&quot;)
    set N = 1
  elseif N == 1 then
      call MultiboardSetItemValueBJ(M, 1, 1, &quot;Attack&quot;)
      call MultiboardSetItemValueBJ(M, 1, 2, &quot;&gt;&gt; Flee&quot;)
    set N = 2
  endif
 return false // Safety
endfunction

private function Enable takes nothing returns nothing
 if ATBgauges[1] &gt;= ATBgaugemin then
  if GetLocalPlayer() == Player(0) then
    call MultiboardDisplay(M, true)
  endif
  call EnableTrigger(PressUp)
  call EnableTrigger(PressDown)
  call EnableTrigger(PressRight)
  call EnableTrigger(AttackB)
  set atker = FirstOfGroup(attackers)
  call SetPlayerAlliance(GetOwningPlayer(atked), GetOwningPlayer(atker), ALLIANCE_SHARED_VISION, false)
  call SetPlayerAlliance(GetOwningPlayer(atker), GetOwningPlayer(atked), ALLIANCE_SHARED_VISION, false)
  call DestroyTimer(GetExpiredTimer())
  set ATBgauges[1] = 0
 endif
endfunction

private function Disable takes nothing returns nothing
 if ATBgauges[1] &lt;= ATBgaugemin then
  if GetLocalPlayer() == Player(0) then
    call MultiboardDisplay(M, false)
  endif
  call DisableTrigger(PressUp)
  call DisableTrigger(PressDown)
  call DisableTrigger(PressRight)
  call DisableTrigger(AttackB)
  call DestroyTimer(GetExpiredTimer())
 endif
endfunction

private function facing takes nothing returns nothing
local location locA = GetUnitLoc(atked)
local location locB = GetUnitLoc(atker)
local real angle = AngleBetweenPoints(locA, locB)
call SelectUnit(atked, true)
debug call BJDebugMsg(&quot;Facing&quot;)
 if T == 1 then
  call SetUnitFacing(atked, angle)
  call PauseUnit(atked, true)
  call DestroyTimer(GetExpiredTimer())
 endif
 call TimerStart(CreateTimer(), 0.01, true, function Enable)
call RemoveLocation(locA)
call RemoveLocation(locB)
set locA = null
set locB = null
call DisableTrigger(PressRight)
endfunction

private function AIfacing takes nothing returns nothing
local location locA = GetUnitLoc(atker)
local location locB = GetUnitLoc(atked)
local real angle = AngleBetweenPoints(locA, locB)
debug call BJDebugMsg(&quot;Facing&quot;)
 if T == 1 then
  call SetUnitFacing(atker, angle)
  call PauseUnit(atker, true)
  call DestroyTimer(GetExpiredTimer())
 endif
call RemoveLocation(locA)
call RemoveLocation(locB)
set locA = null
set locB = null
set CPUIsDone = true
call PauseUnit(dummy, false)
endfunction

private function AITimer1 takes nothing returns nothing
         call SetUnitInvulnerable(atker, true)
         call SetUnitInvulnerable(atked, true)
         call DestroyEffect(AddSpecialEffect(teleportfx, GetUnitX(atker), GetUnitY(atker)))
         call SetUnitPositionLoc(atker, cfirst)
         call DestroyEffect(AddSpecialEffect(teleportfx, GetUnitX(atker), GetUnitY(atker)))
        call TimerStart(CreateTimer(), 3.5, false, function AIfacing)
        call DestroyTimer(GetExpiredTimer())
endfunction

private function AI takes nothing returns nothing
 local real i = GetRandomReal(0, 100)
 debug call BJDebugMsg(&quot;AI&quot;)

  if GetUnitState(atker, UNIT_STATE_LIFE) &lt;= maximumlife then
   if i &lt;= fleechance then
     if GetLocalPlayer() == Player(0) then
       call MultiboardDisplay(M, false)
     endif
     debug call BJDebugMsg(&quot;Fleeing..&quot;)
     call DisplayTextToPlayer(Player(0), 0., 0.5, &quot;Your opponent has fled!&quot;)
    set EndBattleb = true
    call TimerStart(CreateTimer(), 0.01, false, function Enable)
    call RemoveUnit(atker)
   endif
  else
  debug call BJDebugMsg(&quot;Attacking..&quot;)
    call PauseUnit(atker, false)
    call SetUnitInvulnerable(atked, false)
   call IssueTargetOrder(atker, &quot;attack&quot;, atked)
   call TimerStart(CreateTimer(), 2.1, false, function AITimer1)
   set ATBgauges[2] = 0
   call DestroyTimer(GetExpiredTimer())
 endif
endfunction

private function AISetATBHigher takes nothing returns nothing
  set ATBgauges[2] = ATBgauges[2] + GetUnitState(atker, UNIT_STATE_LIFE) / 100
   if ATBgauges[2] &gt;= ATBgaugemin then
    call TimerStart(CreateTimer(), .01, true, function AI)
   endif
endfunction

private function RemoveBuffGroup takes nothing returns nothing
 call UnitRemoveBuffBJ(&#039;BPSE&#039;, GetEnumUnit())
endfunction

private function SetATBHigher takes nothing returns nothing
  set ATBgauges[1] = ATBgauges[1] + GetUnitState(atked, UNIT_STATE_LIFE) / 100
   if ATBgauges[1] &gt;= ATBgaugemin then
    call DestroyTimer(GetExpiredTimer())
   endif
   call ClearTextMessages()
   call DisplayTextToPlayer(Player(0), 0., 0., &quot;|cff7777aaATB Gauge:|r &quot; + R2S(ATBgauges[1]) + &quot; percent filled.&quot;)
endfunction

private function WhenAttacked takes nothing returns boolean
 if UnitHasBuffBJ(atker, &#039;BPSE&#039;) then
   set CPUIsDone = true
   call Enable()
   call ForGroup(attackers, function RemoveBuffGroup)
  return false
 endif
  if T == 1 then
         call DestroyEffect(AddSpecialEffect(teleportfx, GetUnitX(atked), GetUnitY(atked)))
         call SetUnitPosition(atked, firstx, firsty)
         call DestroyEffect(AddSpecialEffect(teleportfx, GetUnitX(atked), GetUnitY(atked)))
         call SetUnitInvulnerable(atker, true)
         call SetUnitInvulnerable(atked, true)
        call TimerStart(CreateTimer(), 1.5, false, function facing)
        call TimerStart(AITimer, 0.15, true, function AISetATBHigher)
        call DestroyTimer(GetExpiredTimer())
  endif
  call TimerStart(CreateTimer(), 0.15, true, function SetATBHigher)
  call TimerStart(CreateTimer(), 0.01, false, function Disable)
 return false // Safety
endfunction

private function Selection takes nothing returns nothing
if b == false then
 set Select = GetTriggeringTrigger()
 set b = true
endif
 call ClearSelection()
 if EndBattleb == true then
  call DestroyTimer(GetExpiredTimer())
  call EndBattle()
 endif
 if CPUIsDone == true then
  call DestroyTimer(GetExpiredTimer())
 endif
endfunction

private function UnInvul takes nothing returns nothing
 call SetUnitInvulnerable(GetEnumUnit(), false)
endfunction

private function Invul takes nothing returns nothing
 call SetUnitInvulnerable(GetEnumUnit(), true)
endfunction

private function OnSpellRest takes nothing returns nothing
 call ForGroup(attackers, function Invul)
 call PauseUnit(dummy, true)
    if GetLocalPlayer() == Player(0) then
      call MultiboardDisplay(M, false)
    endif
    call TimerStart(CreateTimer(), .0, true, function Selection)
    call TimerStart(CreateTimer(), 1.9, false, function WhenAttacked)
    call DestroyTimer(GetExpiredTimer())
endfunction

private function OnSpell takes nothing returns boolean
 call ForGroup(attackers, function UnInvul)
 call TimerStart(CreateTimer(), 0.50, false, function OnSpellRest)
return false
endfunction

private function PressesRight takes nothing returns boolean
  local real fx
  local real fy
  call PauseUnit(dummy, false)
  call SetUnitState(dummy, UNIT_STATE_MANA, GetUnitState(atked, UNIT_STATE_MANA))
  call DisableTrigger(AttackB)
  debug call BJDebugMsg(I2S(N))
  if N == 2 then
    debug call BJDebugMsg(&quot;You have pressed the right arrow key&quot;)
     if GetLocalPlayer() == Player(0) then
        call MultiboardDisplay(M, false)
     endif
     call PauseUnit(dummy, true)
     set EndBattleb = true
     call EndBattle()
  endif
  
  if N == 1 then
   if T == 1 then
    set turnunit = atked
   elseif T == 2 then
    set turnunit = atker
   endif
  set fx = GetUnitX(turnunit)
  set fy = GetUnitY(turnunit)
  set firstx = fx
  set firsty = fy
   debug call BJDebugMsg(&quot;You have pressed the right arrow key&quot;)
   
     if T == 1 then
         call PauseUnit(atked, false)
         call SetUnitInvulnerable(atker, false)
         call IssueTargetOrder(turnunit, &quot;attack&quot;, atker)
         if GetLocalPlayer() == Player(0) then
            call MultiboardDisplay(M, false)
         endif
         call PauseUnit(dummy, true)
         debug call BJDebugMsg(&quot;Is it here?&quot;)
        call TimerStart(CreateTimer(), .0, true, function Selection)
        call TimerStart(CreateTimer(), 1.9, false, function WhenAttacked)
     endif
     debug call BJDebugMsg(&quot;Is it here?&quot;)
    endif
 return false // Safety
endfunction

private function Filtr takes nothing returns boolean
 return IsUnitAlly(GetFilterUnit(), GetOwningPlayer(atked)) != true
endfunction

private function SetUnitXY takes unit whichUnit, real X, real Y returns nothing
  call SetUnitX(whichUnit, X)
  call SetUnitY(whichUnit, Y)
endfunction

private function MoveSpellUserTo takes nothing returns nothing
 local real x = GetUnitX(atked)
 local real y = GetUnitY(atked)
  call SetUnitXY(dummy, x, y)
endfunction

private function RemoveGroup takes nothing returns boolean
local unit u = GetDyingUnit()
local unit s = FirstOfGroup(attackers)
 call GroupRemoveUnit(attackers, u)
set u = null
return false
endfunction

private function Register takes nothing returns nothing
local unit u = FirstOfGroup(attackers)
   call TriggerRegisterUnitEvent(WhenDies, u, EVENT_UNIT_DEATH)
   call TriggerAddCondition(WhenDies, Condition(function RemoveGroup))
 set u = null
endfunction

private function SetTimer takes nothing returns nothing
local unit s = FirstOfGroup(attackers)
 if GetWidgetLife(s) &lt; .405 then
  call GroupRemoveUnit(attackers, s)
  set s = FirstOfGroup(attackers)
  set atker = s
  set cfirst = GetUnitLoc(atker)
  call TimerStart(CreateTimer(), Period, true, function Camera)
 endif
  if s == null then 
  if GetLocalPlayer() == Player(0) then
    call MultiboardDisplay(M, false)
  endif
  set EndBattleb = true
  call EndBattle()
  set s = null
  call DestroyTimer(GetExpiredTimer())
  return
 endif
set s = null
endfunction

private function AddGroup takes nothing returns boolean
 call GroupAddUnit(attackers, GetTriggerUnit())
 debug call BJDebugMsg(I2S(CountUnitsInGroup(attackers)))
 call ForGroup(attackers, function Register)
 call PauseUnit(GetTriggerUnit(), true)
 call SetUnitInvulnerable(GetTriggerUnit(), true)
 call TimerStart(CreateTimer(), 0.01, true, function SetTimer)
 return false
endfunction

function AttackBoard takes unit attacked, unit attacker returns nothing
local unit d
set CamTimer = CreateTimer()
set SlctTimer = CreateTimer()
set ReTimer = CreateTimer()
set AITimer = CreateTimer()
set attackers = CreateGroup()
set AttackB = GetTriggeringTrigger()
set AddG = CreateTrigger()
set Spell = CreateTrigger()
set cfirst = GetUnitLoc(attacker)

  set Rotate = 0
  set Angle = CAngle
  set Distance = CDistance
  set atked = attacked
  set atker = attacker

  call TimerStart(CamTimer, Period, true, function Camera) 
  call TimerStart(ReTimer, 1., true, function Register)
    
    set d = CreateUnit(GetOwningPlayer(attacked), SpellUser, GetUnitX(attacked), GetUnitY(attacked), GetUnitFacing(attacked))
    set dummy = CreateUnit(GetOwningPlayer(attacked), SpellUser, GetUnitX(attacked), GetUnitY(attacked), GetUnitFacing(attacked))
    call RemoveUnit(d)
    call TimerStart(CreateTimer(), 0.01, true, function MoveSpellUserTo)
    call SetUnitState(dummy, UNIT_STATE_MANA, GetUnitState(atked, UNIT_STATE_MANA))
    call SetUnitInvulnerable(attacked, true)
    call SetUnitInvulnerable(attacker, true)
    call PauseUnit(attacked, true)
    call PauseUnit(attacker, true)
    call GroupAddUnit(attackers, attacker)
    call SetUnitFacingToFaceUnitTimed(attacked, attacker, 0.10)
    call SetUnitFacingToFaceUnitTimed(attacker, attacked, 0.10)
    call TriggerRegisterUnitInRange(AddG, attacked, 325., Filter(function Filtr))
    call TriggerRegisterUnitEvent(Spell, dummy, EVENT_UNIT_SPELL_EFFECT)
    call TriggerAddCondition(AddG, Condition(function AddGroup))
    call TriggerAddCondition(Spell, Condition(function OnSpell))
    set d = null
endfunction

function InitBattle takes nothing returns nothing
    local multiboarditem mbitem = null
    set M = CreateMultiboard()
    set PressUp = CreateTrigger()
    set PressDown = CreateTrigger()
    set PressRight = CreateTrigger()
    set T = 1
    set N = 1
    set EndBattleb = false
   
        call MultiboardSetTitleText(M, &quot;Choose Your Action&quot;)
        call MultiboardSetItemsWidth(M, 5.)
        call MultiboardSetRowCount(M, 2)
        call MultiboardSetColumnCount(M, 1)
        
        call MultiboardSetItemValueBJ(M, 1, 1, &quot;&gt;&gt; Attack&quot;)
        call MultiboardSetItemValueBJ(M, 1, 2, &quot;Flee&quot;)
        call MultiboardSetItemIconBJ(M, 1, 1, attackpath)
        call MultiboardSetItemIconBJ(M, 1, 2, defendpath)
        set N = 1
        set D = 2
        set C = 1
        set attackers = CreateGroup()
        
          set mbitem = null
          call MultiboardDisplay(M, true)
          call MultiboardMinimize(M, false)
          
            call TriggerRegisterPlayerKeyEventBJ(PressUp, Player(0), bj_KEYEVENTTYPE_DEPRESS, bj_KEYEVENTKEY_UP)
            call TriggerRegisterPlayerKeyEventBJ(PressDown, Player(0), bj_KEYEVENTTYPE_DEPRESS, bj_KEYEVENTKEY_DOWN)
            call TriggerRegisterPlayerKeyEventBJ(PressRight, Player(0), bj_KEYEVENTTYPE_DEPRESS, bj_KEYEVENTKEY_RIGHT)
            call TriggerAddCondition(PressUp, Condition(function PressesUp))
            call TriggerAddCondition(PressDown, Condition(function PressesDown))
            call TriggerAddCondition(PressRight, Condition(function PressesRight))
endfunction

endlibrary


Screenshot:


Enjoy.
 

Flare

Stops copies me!
Reaction score
662
Just tried it out

Was pretty fun, but a few things I noticed
1) It looks very ugly to have player units walk back to their origin, and computer players teleport. Both should have the same action. And, the player unit return combined with the camera is frigging horrible. If you're gonna keep the camera, zoom it out a bit, and either:
(a) Keep it locked so that it's always facing the target, from your unit's original position, or
(b) Locked at the side, so your unit is at one side of the screen, and the opponent at the other side

2) Spells should really count as a turn

3) You seem to lose selection of unit/spellcaster after casting and attacking, and can't reselect for a while - is that intended?

4)
// A correct Final Fantasy-feeling.
If it was true to FF, you would have the ATB gauges above the unit's heads (since in FF battles, you can get multiple turns before your opponent if your ATB gauge can fill fast enough :)) and, perhaps, the addition of an 'arena' to battle in (like in most FF games, where you're transported to an area with the same terrain-base as where you fought the unit), would be sweet, especially for boss battles (since you could have a fancy little arena dedicated to the boss)
 

Vestras

Retired
Reaction score
249
1) Yeah, the teleport were actually for making the opponent's turn mroe swift, but great ideas! I'll add it!

2) They do, it's just because the opponent gets stunned. And when the opponent in the system gets stunned, the turn automaticly turn back to the player.

3) Yes, that is because it's the opponent's turn.

FF Stuff) I wrote that because I'm thinking of adding those. It would be too boring to have a gigantic RPG filled with those battles.

And remember; This system is for Single Player RPGs only. It only works for player 1.
 

Vestras

Retired
Reaction score
249
Updated! The system is now with new camera and ATB gauges!
Arenas may follow...

(It may seem a bit chaotic now, but it isn't, because they won't attack eachother twice.)
 

Vestras

Retired
Reaction score
249
I miss feedback and rep for the things I do!!! (Wants signature duds)
I haven't got rep from the last 5 resources!! DUH!!!

*Runs around in my room, screaming in pain and knocking my head into the wall.*
 

UndeadDragon

Super Moderator
Reaction score
447
(Wants signature duds)

Signature's are not given for an amount of rep. For 100 rep you can get a custom user title and import animated avatars though. Sorry, that was off-topic :p
 

Vestras

Retired
Reaction score
249
Signature's are not given for an amount of rep. For 100 rep you can get a custom user title and import animated avatars though. Sorry, that was off-topic :p

And for 500 rep you can have a signature.

*Screams: "So hurry up!!11 zomg i giv cokys"*
 

UndeadDragon

Super Moderator
Reaction score
447
No, each person is dealt with seperately. You can have 700 rep without a sig. Look at Flare ^^

Let's stop going off-topic now though.
 

UndeadDragon

Super Moderator
Reaction score
447
You might want to read this
 

UndeadDragon

Super Moderator
Reaction score
447
That's not a way to get a sig...
 

Rommel

New Member
Reaction score
13
Hi Vestras, remember me? im here, your friend.
Well..I am so glad to see that yoy've just finishing a cool system...I will try it..but i've just taken a look at the code...Im new to Jass so that long code is just a hard problem to me :D
Any way +rep
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • WildTurkey WildTurkey:
    is there a stephen green in the house?
    +1
  • The Helper The Helper:
    What is up WildTurkey?
  • The Helper The Helper:
    Looks like Google fixed whatever mistake that made the recipes on the site go crazy and we are no longer trending towards a recipe site lol - I don't care though because it motivated me to spend alot of time on the site improving it and at least now the content people are looking at is not stupid and embarrassing like it was when I first got back into this like 5 years ago.
  • The Helper The Helper:
    Plus - I have a pretty bad ass recipe collection now! That section of the site is 10 thousand times better than it was before
  • The Helper The Helper:
    We now have a web designer at my job. A legit talented professional! I am going to get him to redesign the site theme. It is time.
  • Varine Varine:
    I got one more day of community service and then I'm free from this nonsense! I polished a cop car today for a funeral or something I guess
  • Varine Varine:
    They also were digging threw old shit at the sheriff's office and I tried to get them to give me the old electronic stuff, but they said no. They can't give it to people because they might use it to impersonate a cop or break into their network or some shit? idk but it was a shame to see them take a whole bunch of radios and shit to get shredded and landfilled
  • The Helper The Helper:
    whatever at least you are free
  • Monovertex Monovertex:
    How are you all? :D
    +1
  • Ghan Ghan:
    Howdy
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top