| 10-31-2003, 12:43 AM | #1 |
Hey guys, once again i found my self on this forum seeking some help :) Now im working on a new project but i had a problem. First some information on what i want: There are over 20 buildings, that when you build one it will spawn a specific unit per 4 seconds (like footmen wars i guess). There are specific spots where you can build these(64 spots) Once the tower is destroyed it HAS to stop spawning these units per x time. BUT! if gold will allow, the player is allowed to build another tower where one might have been destroyed, allowing him to spawn units per x seconds again. Now i know how to do this with regions... but you can imagine the work 20 towers X 64 regions X 12 players... thats alot of work for a small feature... is there any better way to pull this off? Any help or a lead in the right direction would be appreciated. |
| 10-31-2003, 12:46 AM | #2 |
Yup there is Event - Periodic Event - Every 4.00 Seconds Integer Comparaison - Number of Tower owned by Player 1 is greater than or equal to 1 Pick Every Unit of Type (Building Type Here) and do Unit - Create 1(Your Unit Here) at (Position of Picked Unit) |
| 10-31-2003, 12:58 AM | #3 |
wow! it worked except for one aspect.... once the building is destroyed they keep respawning at that certain location of where the building use to be |
| 10-31-2003, 01:01 AM | #4 |
Perhaps you could try removing all towers that die from the game? E- a unit dies C - unit type of dying unit equal to whatever A - remove dying unit from the game |
| 10-31-2003, 01:02 AM | #5 |
yeah but just b/c one tower dies, i dont want them all too example, i build 2 towers of the same type A and B... both spawning units... A goes down... B shouldnt have to as well |
| 10-31-2003, 01:29 AM | #6 |
they all won't be removed with that fuction. Just the tower that dies will be removed. This remove the tower so that your trigger to create units will no longer see it. |
| 10-31-2003, 02:44 AM | #7 | ||
Quote:
Try Number of tower in REGION owned by Player.... blah Quote:
NEVER USE REMOVE UNIT!!! It makes the map remember that unit forever! Use explode unit, it will decrease a lot of lag. Heres a trigger that is very similar to the trigger that you like you want: Buy Weps P1 Events Unit - A unit enters (Playable map area) Conditions (Owner of (Triggering unit)) Equal to Player 1 (Red) (Unit-type of (Triggering unit)) Not equal to Gyrocopter (Unit-type of (Triggering unit)) Not equal to Cannon Boat (Unit-type of (Triggering unit)) Not equal to Caster Actions If ((Unit-type of (Triggering unit)) Equal to Gyrocopter Bay) then do (Set P1_5_Gyrocopter[1] = (P1_5_Gyrocopter[1] + 1)) else do (Do nothing) If ((Unit-type of (Triggering unit)) Equal to Cannon Boat Center) then do (Set P1_10_CannonBoat[1] = (P1_10_CannonBoat[1] + 1)) else do (Do nothing) Heres the trigger for when it dies... Wep Death P1 Events Unit - A unit Dies Conditions (Owner of (Triggering unit)) Equal to Player 1 (Red) (Triggering unit) Not equal to P_Ship[1] (Unit-type of (Triggering unit)) Not equal to Gyrocopter (Unit-type of (Triggering unit)) Not equal to Concusion Raft (Unit-type of (Triggering unit)) Not equal to Caster (Unit-type of (Triggering unit)) Not equal to Cannon Boat Actions If ((Unit-type of (Triggering unit)) Equal to Gyrocopter Bay) then do (Set P1_5_Gyrocopter[1] = (P1_5_Gyrocopter[1] - 1)) else do (Do nothing) If ((Unit-type of (Triggering unit)) Equal to Cannon Boat Center) then do (Set P1_10_CannonBoat[1] = (P1_10_CannonBoat[1] - 1)) else do (Do nothing) Gyro P1 Events Time - Every 7.00 seconds of game time Conditions P1_5_Gyrocopter[1] Greater than (Number of living Gyrocopter units owned by Player 1 (Red)) Actions Unit - Create (P1_5_Gyrocopter[1] - (Number of living Gyrocopter units owned by Player 1 (Red))) Gyrocopter for Player 1 (Red) at (Position of P_Ship[1]) facing Default building facing degrees You need an integer variable with an array size of how many players are to be playing... then the rest is simple... it pretty much adds to the variable set for a player everytime they get a gyrocopter bay, or in your case the tower they are building, when it enters the map, and when it dies it subtracts from the variable. |
| 11-01-2003, 01:03 AM | #8 |
hazey ur was is too long, i got like 64 regions and 20 towers X 12 players... way too trigger heavy rest of u thank you, but i worried about this Remove thing's lag... is there any flush engine caches or anything to remove this lag?? |
| 11-01-2003, 01:12 AM | #9 |
No but instead right before you declare victory/defeat you should enable and emit black mask and select all units and explode them. then go on to declaring victory/defeat/map end. It saves the trouble of the game having to unload every single present unit on the map. But seriously only use explode, also Im not sure i mentioned it but you could set up a trigger like this if you want dying units to *look* like they are removed. Clean Up Events Unit - A unit owned by Player 11 (Dark Green) Dies Conditions Actions Wait 0.75 seconds Unit - Move (Dying unit) instantly to (Center of Dead Region <gen>) Unit - Explode (Dying unit) |
