SnowCrow
New Member
- Reaction score
- 7
I'm creating a turn based combat system, like one in Final Fantasy and all other japanese RPGs.
I'll post my triggers here.
Its working fine except that when the Knight (starting) approaches the Hero, it just stops in front of him and doesn't attack or even return back. Some help would be nice.
And I started doing this trigger this morning, so it might be little sucky at places. But it will improve.
I'll post my triggers here.
Code:
Starting
Events
Unit - A unit comes within 256.00 of Knight 0002 <gen>
Conditions
(Region 004 <gen> contains (Triggering unit)) Equal to True
Actions
Trigger - Turn off Third Person Camera <gen>
Unit - Move Knight 0002 <gen> instantly to (Center of ForestCreepLoc <gen>)
Unit - Move Paladin 0004 <gen> instantly to (Center of ForestHeroLoc <gen>)
Set CreepUnit = (Random unit from (Units in ForestCreepLoc <gen>))
Set HeroUnit = (Random unit from (Units in ForestHeroLoc <gen>))
Unit Group - Pick every unit in (Units in ForestCreepLoc <gen>) and do (Unit - Make (Picked unit) face (Center of ForestHeroLoc <gen>) over 0.00 seconds)
Unit Group - Pick every unit in (Units in ForestHeroLoc <gen>) and do (Unit - Make (Picked unit) face (Center of ForestCreepLoc <gen>) over 0.00 seconds)
Unit Group - Pick every unit in (Units in ForestBattle <gen>) and do (Unit - Pause (Picked unit))
Trigger - Turn on Battle Camera <gen>
Wait 1.00 seconds
Set BattleOn = 1.00
Code:
Battle
Events
Game - BattleOn becomes Equal to 1.00
Conditions
Actions
If (HeroSpeed Greater than KnightSpeed) then do (Set HeroTurn = 1.00) else do (Do nothing)
If (KnightSpeed Greater than HeroSpeed) then do (Set CreepTurn = 1.00) else do (Do nothing)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
HeroSpeed Equal to KnightSpeed
Then - Actions
Set Random = (Random integer number between 1 and 10)
If (Random Greater than or equal to 6) then do (Set CreepTurn = 1.00) else do (Set HeroTurn = 1.00)
Else - Actions
Do nothing
Code:
CreepTurn
Events
Game - CreepTurn becomes Equal to 1.00
Conditions
Actions
Wait 3.00 seconds
Unit - Unpause CreepUnit
Unit - Order CreepUnit to Attack HeroUnit
Trigger - Turn off Battle Camera <gen>
Trigger - Turn on Creep Attack Camera <gen>
Code:
CreepTurnEnd
Events
Unit - A unit Is attacked
Conditions
(Attacked unit) Equal to HeroUnit
Actions
Game - Display to (All players) the text: Lol
Unit - Order (Attacking unit) to Move To (Center of ForestCreepLoc <gen>)
Wait 2.00 seconds
Trigger - Turn off Creep Attack Camera <gen>
Trigger - Turn on Battle Camera <gen>
Wait 2.00 seconds
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(ForestHeroLoc <gen> contains HeroUnit) Equal to True
Then - Actions
Unit - Pause CreepUnit
Set CreepTurn = 0.00
Set HeroTurn = 1.00
Else - Actions
Do nothing
Code:
HeroTurn
Events
Game - HeroTurn becomes Equal to 1.00
Conditions
Actions
Wait 2.00 seconds
Dialog - Clear BattleDialog
Dialog - Change the title of BattleDialog to Combat
Dialog - Create a dialog button for BattleDialog labelled Attack
Set BattleDialogButtons[1] = (Last created dialog Button)
Dialog - Create a dialog button for BattleDialog labelled Flee
Set BattleDialogButtons[2] = (Last created dialog Button)
Dialog - Show BattleDialog for Player 1 (Red)
Code:
DialogAttack
Events
Dialog - A dialog button is clicked for BattleDialog
Conditions
(Clicked dialog button) Equal to BattleDialogButtons[1]
Actions
Wait 1.00 seconds
Unit - Unpause HeroUnit
Unit - Order HeroUnit to Attack CreepUnit
Trigger - Turn off Battle Camera <gen>
Trigger - Turn on Hero Attack Camera <gen>
Code:
HeroTurnEnd
Events
Unit - A unit Is attacked
Conditions
(Attacked unit) Equal to CreepUnit
Actions
Game - Display to (All players) the text: Lol
Unit - Order (Attacking unit) to Move To (Center of ForestCreepLoc <gen>)
Wait 2.00 seconds
Trigger - Turn off Hero Attack Camera <gen>
Trigger - Turn on Battle Camera <gen>
Wait 2.00 seconds
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(ForestCreepLoc <gen> contains CreepUnit) Equal to True
Then - Actions
Unit - Pause HeroUnit
Set CreepTurn = 1.00
Set HeroTurn = 0.00
Else - Actions
Trigger - Turn off Battle Camera <gen>
Game - Display to (All players) the text: You win!
Trigger - Turn on Third Person Camera <gen>
And I started doing this trigger this morning, so it might be little sucky at places. But it will improve.