TheOverWhelming
Site Admin

Joined: 07 Nov 2007
Posts: 130
Location: That creepy guy down the street . .
|
Posted:
Sun Dec 07, 2008 8:19 am |
  |
Feel free to comment on this. BTW, this is about TFoRP and SotDRP.
Here is Lord_Anarki AKA Narks's code for the bleeding effect in SotDRP.
| Code: |
Bleeding Detection
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Wound (Spawner Spellbook)
Actions
Set array_bleedingUnits[array_bleedingUnitsCount] = (Target unit of ability being cast)
Set array_bleedingUnitsCount = (array_bleedingUnitsCount + 1)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
array_bleedingUnitsCount Greater than 100
Then - Actions
Set array_bleedingUnitsCount = 0
Else - Actions |
| Code: |
Bleeding Upkeep
Events
Time - Every 2.00 seconds of game time
Conditions
Actions
For each (Integer A) from 1 to 100, do (Actions)
Loop - Actions
Special Effect - Create a special effect attached to the origin of array_bleedingUnits[(Integer A)] using ObjectsSpawnmodelsHumanHumanBloodHumanBloodPriest.mdl
Special Effect - Destroy (Last created special effect)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(array_bleedingUnits[(Integer A)] has buff Bleeding ) Equal to False
Then - Actions
Set array_bleedingUnits[(Integer A)] = No unit
Else - Actions |
For those of you who don't speak code, that basically adds a unit to unit group array and every second or so, picks every unit in that array and creates the bleeding effect. It's funny, this doesn't even require two triggers, and can be done with an ability. Doom, to be specific, it looks effects (to my knowledge).
Now, this is my FAVORITE.
A give trigger should be simple, a check in the map's script or a check of a player inside the trigger, string check, etc.
Here's our trigger.
| Code: |
Give Simple
Events
Player - Player 1 (Red) types a chat message containing give as A substring
Player - Player 2 (Blue) types a chat message containing give as A substring
Player - Player 3 (Teal) types a chat message containing give as A substring
Player - Player 4 (Purple) types a chat message containing give as A substring
Player - Player 5 (Yellow) types a chat message containing give as A substring
Player - Player 6 (Orange) types a chat message containing give as A substring
Player - Player 7 (Green) types a chat message containing give as A substring
Player - Player 8 (Pink) types a chat message containing give as A substring
Player - Player 9 (Gray) types a chat message containing give as A substring
Player - Player 10 (Light Blue) types a chat message containing give as A substring
Player - Player 11 (Dark Green) types a chat message containing give as A substring
Player - Player 12 (Brown) types a chat message containing give as A substring
Conditions
(Substring((Entered chat string), 1, 5)) Equal to (==) give
Actions
Set AAAString = (Substring((Entered chat string), 6, (Length of (Entered chat string))))
Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Entered chat string) Equal to (==) give me
Then - Actions
Unit Group - Pick every unit in SelectedUnits[(Player number of (Triggering player))] and do (Actions)
Loop - Actions
Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Unit-type of (Picked unit)) Not equal to (!=) Spawner
Multiple ConditionsOr - Any (Conditions) are true
Conditions
(Owner of (Picked unit)) Equal to (==) Neutral Hostile
(Owner of (Picked unit)) Equal to (==) Neutral Passive
((Owner of (Picked unit)) slot status) Not equal to (!=) Is playing
Then - Actions
Unit - Change ownership of (Picked unit) to (Triggering player) and Change color
Else - Actions
Skip remaining actions
Else - Actions
Custom script: set udg_TempInteger = S2PI(udg_AAAString)
Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
TempInteger Equal to (==) 0
Then - Actions
Skip remaining actions
Else - Actions
Unit Group - Pick every unit in SelectedUnits[(Player number of (Triggering player))] and do (Actions)
Loop - Actions
Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Unit-type of (Picked unit)) Not equal to (!=) Spawner
Multiple ConditionsOr - Any (Conditions) are true
Conditions
(Owner of (Picked unit)) Equal to (==) Neutral Hostile
(Owner of (Picked unit)) Equal to (==) Neutral Passive
(Owner of (Picked unit)) Equal to (==) (Triggering player)
((Owner of (Picked unit)) slot status) Not equal to (!=) Is playing
Then - Actions
Unit - Change ownership of (Picked unit) to (Player(TempInteger)) and Change color
Else - Actions
|
This is a simple trigger and should work fine. Well, it has anyways. Notice how much SIMPLER and SHORTER it is than Narks.
| Code: |
give
Events
Player - Player 1 (Red) types a chat message containing give as A substring
Player - Player 2 (Blue) types a chat message containing give as A substring
Player - Player 3 (Teal) types a chat message containing give as A substring
Player - Player 4 (Purple) types a chat message containing give as A substring
Player - Player 5 (Yellow) types a chat message containing give as A substring
Player - Player 6 (Orange) types a chat message containing give as A substring
Player - Player 7 (Green) types a chat message containing give as A substring
Player - Player 8 (Pink) types a chat message containing give as A substring
Player - Player 9 (Gray) types a chat message containing give as A substring
Player - Player 10 (Light Blue) types a chat message containing give as A substring
Player - Player 11 (Dark Green) types a chat message containing give as A substring
Player - Player 12 (Brown) types a chat message containing give as A substring
Conditions
(Substring((Entered chat string), 1, 4)) Equal to give
Actions
Set a_tmpUnitGroup01[(Player number of (Triggering player))] = (Units in (Entire map))
Unit Group - Pick every unit in a_tmpUnitGroup01[(Player number of (Triggering player))] and do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Unit-type of (Picked unit)) Not equal to Spawner
(Owner of (Picked unit)) Not equal to Neutral Victim
(Entered chat string) Equal to give me
((Picked unit) is selected by (Triggering player)) Equal to True
Or - Any (Conditions) are true
Conditions
((Owner of (Picked unit)) slot status) Equal to Has left the game
((Owner of (Picked unit)) slot status) Equal to Is unused
((Owner of (Picked unit)) controller) Equal to Computer
((Owner of (Picked unit)) controller) Equal to Passive
((Owner of (Picked unit)) controller) Equal to Hostile
Then - Actions
Unit - Change ownership of (Picked unit) to (Triggering player) and Retain color
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Picked unit) is selected by (Triggering player)) Equal to True
(Owner of (Picked unit)) Equal to (Triggering player)
(Unit-type of (Picked unit)) Not equal to Spawner
Then - Actions
If ((Entered chat string) Equal to give red) then do (Unit - Change ownership of (Picked unit) to Player 1 (Red) and Retain color) else do (Do nothing)
If ((Entered chat string) Equal to give blue) then do (Unit - Change ownership of (Picked unit) to Player 2 (Blue) and Retain color) else do (Do nothing)
If ((Entered chat string) Equal to give teal) then do (Unit - Change ownership of (Picked unit) to Player 3 (Teal) and Retain color) else do (Do nothing)
If ((Entered chat string) Equal to give purple) then do (Unit - Change ownership of (Picked unit) to Player 4 (Purple) and Retain color) else do (Do nothing)
If ((Entered chat string) Equal to give yellow) then do (Unit - Change ownership of (Picked unit) to Player 5 (Yellow) and Retain color) else do (Do nothing)
If ((Entered chat string) Equal to give orange) then do (Unit - Change ownership of (Picked unit) to Player 6 (Orange) and Retain color) else do (Do nothing)
If ((Entered chat string) Equal to give green) then do (Unit - Change ownership of (Picked unit) to Player 7 (Green) and Retain color) else do (Do nothing)
If ((Entered chat string) Equal to give pink) then do (Unit - Change ownership of (Picked unit) to Player 8 (Pink) and Retain color) else do (Do nothing)
If ((Entered chat string) Equal to give gray) then do (Unit - Change ownership of (Picked unit) to Player 9 (Gray) and Retain color) else do (Do nothing)
If ((Entered chat string) Equal to give light blue) then do (Unit - Change ownership of (Picked unit) to Player 10 (Light Blue) and Retain color) else do (Do nothing)
If ((Entered chat string) Equal to give dark green) then do (Unit - Change ownership of (Picked unit) to Player 11 (Dark Green) and Retain color) else do (Do nothing)
If ((Entered chat string) Equal to give brown) then do (Unit - Change ownership of (Picked unit) to Player 12 (Brown) and Retain color) else do (Do nothing)
If ((Entered chat string) Equal to give hostile) then do (Unit - Change ownership of (Picked unit) to Neutral Hostile and Retain color) else do (Do nothing)
If ((Entered chat string) Equal to give neutral) then do (Unit - Change ownership of (Picked unit) to Neutral Passive and Retain color) else do (Do nothing)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
player_isAdmin[(Player number of (Triggering player))] Equal to True
(Substring((Entered chat string), ((Length of (Entered chat string)) - 2), (Length of (Entered chat string)))) Equal to red
Then - Actions
Set a_tmpUnitGroup02 = (Units owned by Player 1 (Red))
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
player_isAdmin[(Player number of (Triggering player))] Equal to True
(Substring((Entered chat string), ((Length of (Entered chat string)) - 3), (Length of (Entered chat string)))) Equal to blue
Then - Actions
Set a_tmpUnitGroup02 = (Units owned by Player 2 (Blue))
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
player_isAdmin[(Player number of (Triggering player))] Equal to True
(Substring((Entered chat string), ((Length of (Entered chat string)) - 3), (Length of (Entered chat string)))) Equal to teal
Then - Actions
Set a_tmpUnitGroup02 = (Units owned by Player 3 (Teal))
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
player_isAdmin[(Player number of (Triggering player))] Equal to True
(Substring((Entered chat string), ((Length of (Entered chat string)) - 5), (Length of (Entered chat string)))) Equal to purple
Then - Actions
Set a_tmpUnitGroup02 = (Units owned by Player 4 (Purple))
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
player_isAdmin[(Player number of (Triggering player))] Equal to True
(Substring((Entered chat string), ((Length of (Entered chat string)) - 5), (Length of (Entered chat string)))) Equal to yellow
Then - Actions
Set a_tmpUnitGroup02 = (Units owned by Player 5 (Yellow))
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
player_isAdmin[(Player number of (Triggering player))] Equal to True
(Substring((Entered chat string), ((Length of (Entered chat string)) - 5), (Length of (Entered chat string)))) Equal to orange
Then - Actions
Set a_tmpUnitGroup02 = (Units owned by Player 6 (Orange))
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
player_isAdmin[(Player number of (Triggering player))] Equal to True
(Substring((Entered chat string), ((Length of (Entered chat string)) - 4), (Length of (Entered chat string)))) Equal to green
Then - Actions
Set a_tmpUnitGroup02 = (Units owned by Player 7 (Green))
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
player_isAdmin[(Player number of (Triggering player))] Equal to True
(Substring((Entered chat string), ((Length of (Entered chat string)) - 3), (Length of (Entered chat string)))) Equal to pink
Then - Actions
Set a_tmpUnitGroup02 = (Units owned by Player 8 (Pink))
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
player_isAdmin[(Player number of (Triggering player))] Equal to True
(Substring((Entered chat string), ((Length of (Entered chat string)) - 3), (Length of (Entered chat string)))) Equal to gray
Then - Actions
Set a_tmpUnitGroup02 = (Units owned by Player 9 (Gray))
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
player_isAdmin[(Player number of (Triggering player))] Equal to True
(Substring((Entered chat string), ((Length of (Entered chat string)) - 9), (Length of (Entered chat string)))) Equal to light blue
Then - Actions
Set a_tmpUnitGroup02 = (Units owned by Player 10 (Light Blue))
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
player_isAdmin[(Player number of (Triggering player))] Equal to True
(Substring((Entered chat string), ((Length of (Entered chat string)) - 9), (Length of (Entered chat string)))) Equal to dark green
Then - Actions
Set a_tmpUnitGroup02 = (Units owned by Player 11 (Dark Green))
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
player_isAdmin[(Player number of (Triggering player))] Equal to True
(Substring((Entered chat string), ((Length of (Entered chat string)) - 4), (Length of (Entered chat string)))) Equal to brown
Then - Actions
Set a_tmpUnitGroup02 = (Units owned by Player 12 (Brown))
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Substring((Entered chat string), ((Length of (Entered chat string)) - 1), (Length of (Entered chat string)))) Equal to me
Then - Actions
Set a_tmpUnitGroup02 = (Units owned by (Triggering player))
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
player_isAdmin[(Player number of (Triggering player))] Equal to True
(Substring((Entered chat string), ((Length of (Entered chat string)) - 6), (Length of (Entered chat string)))) Equal to neutral
Then - Actions
Set a_tmpUnitGroup02 = (Units owned by Neutral Passive)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
player_isAdmin[(Player number of (Triggering player))] Equal to True
(Substring((Entered chat string), ((Length of (Entered chat string)) - 6), (Length of (Entered chat string)))) Equal to hostile
Then - Actions
Set a_tmpUnitGroup02 = (Units owned by Neutral Hostile)
Else - Actions
Unit Group - Pick every unit in a_tmpUnitGroup02 and do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Unit-type of (Picked unit)) Not equal to Spawner
Then - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Substring((Entered chat string), 6, 8)) Equal to red
Then - Actions
Unit - Change ownership of (Picked unit) to Player 1 (Red) and Retain color
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Substring((Entered chat string), 6, 9)) Equal to blue
Then - Actions
Unit - Change ownership of (Picked unit) to Player 2 (Blue) and Retain color
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Substring((Entered chat string), 6, 9)) Equal to teal
Then - Actions
Unit - Change ownership of (Picked unit) to Player 3 (Teal) and Retain color
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Substring((Entered chat string), 6, 11)) Equal to purple
Then - Actions
Unit - Change ownership of (Picked unit) to Player 4 (Purple) and Retain color
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Substring((Entered chat string), 6, 11)) Equal to yellow
Then - Actions
Unit - Change ownership of (Picked unit) to Player 5 (Yellow) and Retain color
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Substring((Entered chat string), 6, 11)) Equal to orange
Then - Actions
Unit - Change ownership of (Picked unit) to Player 6 (Orange) and Retain color
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Substring((Entered chat string), 6, 10)) Equal to green
Then - Actions
Unit - Change ownership of (Picked unit) to Player 7 (Green) and Retain color
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Substring((Entered chat string), 6, 9)) Equal to pink
Then - Actions
Unit - Change ownership of (Picked unit) to Player 8 (Pink) and Retain color
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Substring((Entered chat string), 6, 9)) Equal to gray
Then - Actions
Unit - Change ownership of (Picked unit) to Player 9 (Gray) and Retain color
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Substring((Entered chat string), 6, 15)) Equal to light blue
Then - Actions
Unit - Change ownership of (Picked unit) to Player 10 (Light Blue) and Retain color
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Substring((Entered chat string), 6, 15)) Equal to dark green
Then - Actions
Unit - Change ownership of (Picked unit) to Player 11 (Dark Green) and Retain color
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Substring((Entered chat string), 6, 10)) Equal to brown
Then - Actions
Unit - Change ownership of (Picked unit) to Player 12 (Brown) and Retain color
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Substring((Entered chat string), 6, 12)) Equal to neutral
Then - Actions
Unit - Change ownership of (Picked unit) to Neutral Passive and Retain color
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Substring((Entered chat string), 6, 12)) Equal to hostile
Then - Actions
Unit - Change ownership of (Picked unit) to Neutral Hostile and Retain color
Else - Actions
Else - Actions
Unit Group - Destroy unit group a_tmpUnitGroup01[(Player number of (Triggering player))]
Unit Group - Destroy unit group a_tmpUnitGroup02 |
How did he even keep all that in his head? I can't even read it. |
_________________
 |
|