- Joined
- Apr 17, 2009
- Messages
- 3,572
Hello Coding Experts 
At the moment I'm working on a Base Capturing System.
It works like that:
If you enter a region at a circle of power, you have to stay 10 seconds inside this region to capture this base. The seconds are shown as floating text numbers.
If you successfully stay the 10 seconds, the colour of the circle becomes your team colour and the number of captured bases of your team gets increased by 1.
So I made following triggers, which work fine, do exactly what I want.
Explanations:
CapturedBaseBelonging shows which Team owns this base.
0 = neutral, 1 = Team 1, 2 = Team 2.
CaptureTimeCounter is the time you need to stay in for capture it, here 10 seconds.
_________________________________________________________________________________________
Yes, it works fine, but now I have to copy these triggers for every single base I want, which I think could be done more efficient and easier.
But I couldn't figure it out.
I thought about making every variable with an array.
Means for base 1 all variables have array 1
For base 2 all variables have array 2. And so on.
Here I need you help.
How can I make this triggers general and fitting for multiple bases?
Thanks for you time.
+rep for every useful answer.
chilla_killa
At the moment I'm working on a Base Capturing System.
It works like that:
If you enter a region at a circle of power, you have to stay 10 seconds inside this region to capture this base. The seconds are shown as floating text numbers.
If you successfully stay the 10 seconds, the colour of the circle becomes your team colour and the number of captured bases of your team gets increased by 1.
So I made following triggers, which work fine, do exactly what I want.
-
Capture Point01
-
Events
-
Unit - A unit enters NeutralBaseTop <gen>
-
-
Conditions
-
Or - Any (Conditions) are true
-
Conditons
-
And - All (Conditions) are true
-
Conditions
-
((Owner of (Triggering unit)) is in Team1) Equal to True
-
Or - Any (Conditions) are true
-
Conditions
-
CapturedBaseBelonging[1] Equal to 0
-
CapturedBaseBelonging[1] Equal to 2
-
-
-
-
-
And - All (Conditions) are true
-
Conditons
-
((Owner of (Triggering unit)) is in Team2) Equal to True
-
Or - Any (Conditions) are true
-
Condittions
-
CapturedBaseBelonging[1] Equal to 0
-
CapturedBaseBelonging[1] Equal to 1
-
-
-
-
-
-
-
-
Actions
-
Set CaptureTimeCounter[1] = 10
-
Set CapturingUnit[1] = (Entering unit)
-
Trigger - Turn on Capture Point Loop01 <gen>
-
Trigger - Turn off (This trigger)
-
-
Explanations:
CapturedBaseBelonging shows which Team owns this base.
0 = neutral, 1 = Team 1, 2 = Team 2.
CaptureTimeCounter is the time you need to stay in for capture it, here 10 seconds.
_________________________________________________________________________________________
-
Capture Base Loop01
-
Events
-
Time - Every 1.00 seconds of game time
-
-
Condtions
-
Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
'IF'-Condtions
-
CaptureTimeCounter[1] Not Equal to -1
-
-
'THEN'-Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
'IF'-Conditons
-
(NeutralBaseTop <gen> contains CapturingUnit[1]) Equal to True
-
-
'THEN'-Actions
-
Specialeffect- Destroy (Last created special effect)
-
Set TempPointCapture[1] = (Center of NeutralBaseTop <gen>)
-
Floating Text - Destroy CaptureFloatingText[1]
-
Floating Text - Create floating text that reads (String(CaptureTimeCounter[1])) at TempPointCapture[1] with Z offset 100.00, using font size 15.00, color (100.00%, 0.00%, 0.00%), and 0.00% transparency
-
Set CaptureFloatingText[1] = (Last created floating text)
-
Floating Text - Zeigen CaptureFloatingText[1] for (All players)
-
Specialeffekt - Create a special effect at TempPointCapture[1] using Abilities\Spells\Items\AIre\AIreTarget.mdl
-
Set CaptureTimeCounter[1] = (CaptureTimeCounter[1] - 1)
-
Custom script: call RemoveLocation(udg_TempPointCapture[1])
-
-
'ELSE'-Actions
-
Set CaptureTimeCounter[1] = 10
-
Trigger - Turn off (This trigger)
-
Specialeffekt - Destroy (Last created special effect)
-
-
-
-
'ELSE'-Actions
-
Trigger - Turn off (This trigger)
-
Floating Text - Destroy CaptureFloatingText[1]
-
Unit - Change color of Circle of Power 0039 <gen> to (Color of (Owner of CapturingUnit[1]))
-
Trigger - Turn on Capture Point01 <gen>
-
-------- ///////////////////////////////////////////////////////////////// --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
'IF'-Condtions
-
((Owner of CapturingUnit[1]) is in Team1) Equal to True
-
-
'THEN'-Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
'IF'-Conditions
-
CapturedBaseBelonging[1] Equal to 2
-
-
'THEN'-Actions
-
Set CapturedBasesTeam2 = (CapturedBasesTeam2 - 1)
-
-
'ELSE'-Actions
-
-
Set CapturedBasesTeam1 = (CapturedBasesTeam1 + 1)
-
Set CapturedBaseBelonging[1] = 1
-
-
'ELSE'-Actions
-
-------- ///////////////////////////////////////////////////////////////// --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
'IF'-Conditons
-
CapturedBaseBelonging[1] Equal to 1
-
-
'THEN'-Actions
-
Set CapturedBasesTeam1 = (CapturedBasesTeam1 - 1)
-
-
'ELSE'-Actions
-
-
Set CapturedBasesTeam2 = (CapturedBasesTeam2 + 1)
-
Set CapturedBaseBelonging[1] = 2
-
-
-
-
-
-
Yes, it works fine, but now I have to copy these triggers for every single base I want, which I think could be done more efficient and easier.
But I couldn't figure it out.
I thought about making every variable with an array.
Means for base 1 all variables have array 1
For base 2 all variables have array 2. And so on.
Here I need you help.
How can I make this triggers general and fitting for multiple bases?
Thanks for you time.
+rep for every useful answer.
chilla_killa