| 08-24-2003, 05:06 PM | #1 |
Hello, I was sitting with WE, and made a map with a lot of telepors currently 48x2 regions named t1, t2, t3... and d1, d2, d3... . Anyway i tried to create a trigger that every 10:th second looped folowing action teleport every unit in region t(integerA) to d(integerA). WE didnt have regionname convesion to string anyone know how to do? plz help me Id be impressed if anyone solved the problem (don't come and say that i should create 48 triggers and then a new trigger for every new teleport added) |
| 08-24-2003, 05:27 PM | #2 |
Sounds like a neat idea, if I understand it correctly. Here's what I would do: Instead of naming your regions with letters, use numbers. 11, 12,13, 21,22,23 etc. Then, increment numeric variables and/or use some simple arithemtic to calculate the next correct region. Will be easier if your attacks go in straight lines...if I understand what you're trying to do. |
| 08-24-2003, 06:12 PM | #3 |
here is my incomplete trigger: teleport Events Time - Every 10.00 seconds of game time Conditions Actions Custom script: function Trig_teleport_test_Func002Func001A takes nothing returns nothing Custom script: call SetUnitPositionLoc( GetEnumUnit(), GetRectCenter(gg_rct_d(I2S(GetForLoopAIndex()))) ) Custom script: call PanCameraToTimedLocForPlayer( GetOwningPlayer(GetEnumUnit()), GetRectCenter(gg_rct_d(I2S(GetForLoopAIndex()))), 0 ) Custom script: Custom script: endfunction For each (Integer A) from 1 to 48, do (Actions) Loop - Actions Custom script: call ForGroupBJ( GetUnitsInRectAll(gg_rct_t(I2S(GetForLoopAIndex()))), function Trig_teleport_Func002Func001A ) it doesnt work i get compile error. but it feels like im close |
| 08-24-2003, 07:17 PM | #4 |
i did it the hard way... Code:
apply C and T
Events
Map initialization
Conditions
Actions
Set D[1] = d1 <gen>
Set D[2] = d2 <gen>
Set D[3] = d3 <gen>
Set D[4] = d4 <gen>
Set D[5] = d5 <gen>
Set D[6] = d6 <gen>
Set D[7] = d7 <gen>
Set D[8] = d8 <gen>
Set D[9] = d9 <gen>
Set D[10] = d10 <gen>
Set D[11] = d11 <gen>
Set D[12] = d12 <gen>
Set D[13] = d13 <gen>
Set D[14] = d14 <gen>
Set D[15] = d15 <gen>
Set D[16] = d16 <gen>
Set D[17] = d17 <gen>
Set D[18] = d18 <gen>
Set D[19] = d19 <gen>
Set D[20] = d20 <gen>
Set D[21] = d21 <gen>
Set D[22] = d22 <gen>
Set D[23] = d23 <gen>
Set D[24] = d24 <gen>
Set D[25] = d25 <gen>
Set D[26] = d26 <gen>
Set D[27] = d27 <gen>
Set D[28] = d28 <gen>
Set D[29] = d29 <gen>
Set D[30] = d30 <gen>
Set D[31] = d31 <gen>
Set D[32] = d32 <gen>
Set D[33] = d33 <gen>
Set D[34] = d34 <gen>
Set D[35] = d35 <gen>
Set D[36] = d36 <gen>
Set D[37] = d37 <gen>
Set D[38] = d38 <gen>
Set D[39] = d39 <gen>
Set D[40] = d40 <gen>
Set D[41] = d41 <gen>
Set D[42] = d42 <gen>
Set D[43] = d43 <gen>
Set D[44] = d44 <gen>
Set D[45] = d45 <gen>
Set D[46] = d46 <gen>
Set T[1] = t1 <gen>
Set T[2] = t2 <gen>
Set T[3] = t3 <gen>
Set T[4] = t4 <gen>
Set T[5] = t5 <gen>
Set T[6] = t6 <gen>
Set T[7] = t7 <gen>
Set T[8] = t8 <gen>
Set T[9] = t9 <gen>
Set T[10] = t10 <gen>
Set T[11] = t11 <gen>
Set T[12] = t12 <gen>
Set T[13] = t13 <gen>
Set T[14] = t14 <gen>
Set T[15] = t15 <gen>
Set T[16] = t16 <gen>
Set T[17] = t17 <gen>
Set T[18] = t18 <gen>
Set T[19] = t19 <gen>
Set T[20] = t20 <gen>
Set T[21] = t21 <gen>
Set T[22] = t22 <gen>
Set T[23] = t23 <gen>
Set T[24] = t24 <gen>
Set T[25] = t25 <gen>
Set T[26] = t26 <gen>
Set T[27] = t27 <gen>
Set T[28] = t28 <gen>
Set T[29] = t29 <gen>
Set T[30] = t30 <gen>
Set T[31] = t31 <gen>
Set T[32] = t32 <gen>
Set T[33] = t33 <gen>
Set T[34] = t34 <gen>
Set T[35] = t35 <gen>
Set T[36] = t36 <gen>
Set T[37] = t37 <gen>
Set T[38] = t38 <gen>
Set T[39] = t39 <gen>
Set T[40] = t40 <gen>
Set T[41] = t41 <gen>
Set T[42] = t42 <gen>
Set T[43] = t43 <gen>
Set T[44] = t44 <gen>
Set T[45] = t45 <gen>
Set T[46] = t46 <gen>Code:
teleport
Events
Time - Every 3.00 seconds of game time
Conditions
Actions
For each (Integer A) from 1 to 46, do (Actions)
Loop - Actions
Unit Group - Pick every unit in (Units in T[(Integer A)]) and do (Actions)
Loop - Actions
Unit - Move (Picked unit) instantly to (Center of D[(Integer A)])
Camera - Pan camera for (Owner of (Picked unit)) to (Center of D[(Integer A)]) over 0.10 seconds |
| 08-25-2003, 03:29 PM | #5 |
I'm interested in seeing the finished map 8) |
