Nureru
New Member
- Reaction score
- 1
Okay, couple things going on here. I'm making a turn based game, and at the start of the battle it assigns turn order based on agility. That's here:
EDIT: Fixed my first problem.
Next issue is with my enemy AI. I'm using point value to dictate which AI they have. Point value of 1 means they should just run up to whoever's closest and whack at them until someone dies. Point value of 2 means they should run up, attack, and then run away. The issue is enemies with a point value of 1 are doing the routine for enemies with a point value of 2.
I realize I'm asking a lot, but I have no idea what to do anymore. I can't find anything wrong. Any help would be absolutely wonderful.
EDIT: Fixed my first problem.
Next issue is with my enemy AI. I'm using point value to dictate which AI they have. Point value of 1 means they should just run up to whoever's closest and whack at them until someone dies. Point value of 2 means they should run up, attack, and then run away. The issue is enemies with a point value of 1 are doing the routine for enemies with a point value of 2.
Trigger:
- AI Director
- Events
- Conditions
- Actions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- Or - Any (Conditions) are true
- Conditions
- (Point-value of unit_list[1]) Equal to 1
- (Point-value of unit_list[1]) Equal to 2
- Conditions
- Or - Any (Conditions) are true
- Then - Actions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- debug Equal to True
- Then - Actions
- Game - Display to (All players) the text: Executing AI routin...
- Wait 1.00 seconds
- Else - Actions
- If - Conditions
- Trigger - Run Approach to attack Enemy <gen> (checking conditions)
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Else - Actions
- If - Conditions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Trigger:
- Approach to attack Enemy
- Events
- Conditions
- Actions
- Set temp_point = (Position of unit_list[1])
- Set temp_real = 2000.00
- Set temp_group = (Units within temp_real of temp_point matching ((((Matching unit) belongs to an enemy of (Owner of unit_list[1])) Equal to True) and (((Matching unit) is alive) Equal to True)))
- Unit Group - Pick every unit in temp_group and do (Actions)
- Loop - Actions
- Set temp_point_2 = (Position of (Picked unit))
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Distance between temp_point and temp_point_2) Less than temp_real
- Then - Actions
- Set temp_unit = (Picked unit)
- Set temp_real = (Distance between temp_point and temp_point_2)
- Else - Actions
- If - Conditions
- Loop - Actions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Point-value of unit_list[1]) Equal to 2
- Then - Actions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- debug Equal to True
- Then - Actions
- Game - Display to (All players) the text: Executing AI routin...
- Else - Actions
- If - Conditions
- Trigger - Turn on Flee Enemy <gen>
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Else - Actions
- If - Conditions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Number of units in temp_group) Greater than 0
- Then - Actions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- debug Equal to True
- Then - Actions
- Game - Display to (All players) the text: (Approaching target: + (Proper name of temp_unit))
- Else - Actions
- If - Conditions
- Unit - Order unit_list[1] to Attack temp_unit
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Else - Actions
- Trigger - Run End Turn <gen> (ignoring conditions)
- If - Conditions
- Custom script: call DestroyGroup( udg_temp_group )
Trigger:
- Flee Enemy
- Events
- Unit - A unit Is attacked
- Conditions
- ((Owner of (Attacking unit)) controller) Not equal to User
- (Issued order) Not equal to (Order(move))
- (Ability being cast) Not equal to End Turn
- Actions
- Wait 1.00 seconds
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- debug Equal to True
- Then - Actions
- Game - Display to (All players) the text: Executing AI routin...
- Else - Actions
- If - Conditions
- Set temp_point = (Position of (Attacked unit))
- Set temp_point_2 = (Position of (Attacking unit))
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Facing of (Attacking unit)) Greater than or equal to 180.00
- Then - Actions
- Set temp_point_3 = (temp_point_2 offset by 800.00 towards (((Facing of (Attacking unit)) - 180.00) + (Random real number between -10.00 and 10.00)) degrees)
- Else - Actions
- Set temp_point_3 = (temp_point_2 offset by 800.00 towards (((Facing of (Attacking unit)) + 180.00) + (Random real number between -10.00 and 10.00)) degrees)
- If - Conditions
- Unit - Order (Attacking unit) to Move To temp_point_3
- Custom script: call RemoveLocation( udg_temp_point )
- Custom script: call RemoveLocation( udg_temp_point_2 )
- Custom script: call RemoveLocation( udg_temp_point_3 )
- Trigger - Turn off (This trigger)
- Events
I realize I'm asking a lot, but I have no idea what to do anymore. I can't find anything wrong. Any help would be absolutely wonderful.