I never had to make a trigger like this so I am not sure if I am even on the right track. In the Multi-player RPG I am developing, I decided to make it so no selections are allowed, everything has to be triggered to select a unit.
The bellow trigger sort of works. It finds all units in view of the character and randomly selects one for the player.
PROBLEM:
For some reason, when I hit escape, it finds a unit and adds it (working as it should) but when I click on it from my available selections, it right away removes the unit from selections leaving only my hero selected.
or
It adds it for a fraction of a second and then right away removes it leaving only my hero selected. This is what usually happens the first time I hit escape but if I hit escape 3, 4, 5 times, the trigger works just fine. What do I need to change in the trigger? IS it also possible that part of the problem is a unit / vision / acquisition range issue?
HOW I WANT IT TO WORK BECAUSE I THINK I NEED TO START OVER:
-
Actions
-
Game - Disable selection and deselection functionality (Disable selection circles)
-
Game - Disable pre-selection functionality (Disable pre-selection circles, life bars, and object info)
-
The bellow trigger sort of works. It finds all units in view of the character and randomly selects one for the player.
-
Red Selection
-
Events
-
Player - Player 1 (Red) skips a cinematic sequence
-
-
Conditions
-
Actions
-
Set Selection_Hero_Position = (Position of Chosen_Hero[1])
-
Set Selection_Player_Hero = Chosen_Hero[1]
-
Set Selection_Enemy_Units = (Units within 1400.00 of Selection_Hero_Position matching (((Matching unit) belongs to an enemy of Player 1 (Red)) Equal to True))
-
If ((Selection_Enemy_Units is empty) Equal to True) then do (Game - Display to Player Group - Player 1 (Red) the text: No targets are in t...) else do (Do nothing)
-
Unit Group - Pick every unit in Selection_Enemy_Units and do (Actions)
-
Loop - Actions
-
Selection - Add (Random unit from Selection_Enemy_Units) to selection
-
Set Selection_Target = (Picked unit)
-
Set Selection_Targets_Position = (Position of Selection_Target)
-
Set Range_1 = (Cos(((Angle from Selection_Hero_Position to Selection_Targets_Position) - (Facing of Selection_Player_Hero))))
-
Set Range_2 = (Cos(30.00))
-
Custom script: set udg_Range_2 = Cos(80 * bj_DEGTORAD)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Range_1 Greater than Range_2
-
-
Then - Actions
-
Selection - Add (Picked unit) to selection for Player 1 (Red)
-
Set Selection_RED_Target = (Picked unit)
-
Trigger - Turn on Red Target <gen>
-
Game - Display to Player Group - Player 1 (Red) for 0.50 seconds the text: Found A Target
-
-
Else - Actions
-
-
-
-
-
PROBLEM:
For some reason, when I hit escape, it finds a unit and adds it (working as it should) but when I click on it from my available selections, it right away removes the unit from selections leaving only my hero selected.
or
It adds it for a fraction of a second and then right away removes it leaving only my hero selected. This is what usually happens the first time I hit escape but if I hit escape 3, 4, 5 times, the trigger works just fine. What do I need to change in the trigger? IS it also possible that part of the problem is a unit / vision / acquisition range issue?
HOW I WANT IT TO WORK BECAUSE I THINK I NEED TO START OVER:
First/3rd person RPG game loads... Hero is always selected... he runs around and finds a unit he wants to kill (unit is literally visible on screen)... player hits escape and with hero still selected, it cycles through visible units and adds one to his selections, hero can then click on the unit in his selection window and do whatever... or hit escape and keep cycling through until he gets the particular unit he wants.
How can I rewrite this so that it works as I would like it to. I made this Frankenstein trigger using different system I found here on hive so I know its far from perfect.
How can I rewrite this so that it works as I would like it to. I made this Frankenstein trigger using different system I found here on hive so I know its far from perfect.
Last edited: