You must be logged in to post messages.
Please login or register

Scenario Design Discussions
Moderated by GoSailing

Hop to:    
loginhomeregisterhelprules
Bottom
Topic Subject: When I saw this trick, I was amazed.
posted 05-21-04 06:17 PM EDT (US)   
While working in the editor, I was racking my brain trying to come up with a way to have a trigger fire when a group of units had any 2 units next to eachother.

Of course when multiple units near multiple units object condition is used, it causes a great amount of lag. Here's what I discovered.

Say u have 30 units on the map, select all units in select on map object, naming it "group 1". Then in a new object select the same 30 objects on select on map, and call it group 2. Put on group 2 object specification; "near group 1".

Then when group 2 "exists" is made as the condition, any time any 2 or more of the 30 grouped are near any of the other 29, the condition fires!

This can hardly make sense, since each of the 30 units is chosen twice, and is in contact with itself. But it still works.

Although it seems like an insignificant discovery it has a some great uses..for example;

You want to lay some towers on the map, but u don't want the towers to overlap the line of sight of any of the other towers....

Before testing the scenario select all the towers on the map and select them all again for a second object, making the second tower group have "los of group 1"....

trigger
condition; object group 2 in los of group 1 "exists"
effect; send chat player 1; "Tower too close"

When u start the scenario, if any of the towers are overlapping los, u get the chat message.

Many other great uses too.

BTW. This condition causes no lag at all!!
I tested the trigger with 50 units and a frame-per-second program. I enabled and disabled the trigger during the game and in some cases there was microly less lag with the trigger on.


.....................................
...............(\ /)................
..............(^.^)...............
.............<( < )...............
...............(/ (/................
...All American Bunny.....

[This message has been edited by _o0XxX0o_ (edited 05-21-2004 @ 06:24 PM).]

Replies:
posted 05-21-04 08:53 PM EDT (US)     1 / 11  
Tell me all your secrets! Must know...
Good catch by the way...

I think I wet myself...
posted 05-21-04 09:06 PM EDT (US)     2 / 11  
SWEEEEEEEET!!! do you suppose that it would work for a scenario of Omaha beach where if your "near" object-tank obsticale, then it changes the stance of the enemy up the beach to ally so its like ur taking cover? ive been looking for a way to do it without a ton of lag.

.::|Empires|::.
.::| The Battle for Berlin|4.6|Trench Warfare|4.4|::.

"I fear we have awakened a sleeping giant and filled him with a terrible resolve."-Admiral Yamamoto, Commander of the Japanese Fleet attacking Pearl Harbor.
posted 05-22-04 02:30 AM EDT (US)     3 / 11  
Select on map all the tank barriers, then make player 1 units in area on the beach, near tank barriers.

Trigger;
condition; object player 1 anyunit, near tank barriers "exists".
effect; object enemy unit stance/ally player 1


.....................................
...............(\ /)................
..............(^.^)...............
.............<( < )...............
...............(/ (/................
...All American Bunny.....
posted 05-22-04 09:20 AM EDT (US)     4 / 11  
THANK YOU!!! you area genoius!!!

.::|Empires|::.
.::| The Battle for Berlin|4.6|Trench Warfare|4.4|::.

"I fear we have awakened a sleeping giant and filled him with a terrible resolve."-Admiral Yamamoto, Commander of the Japanese Fleet attacking Pearl Harbor.
posted 05-23-04 03:49 AM EDT (US)     5 / 11  

Quote:

While working in the editor, I was racking my brain trying to come up with a way to have a trigger fire when a group of units had any 2 units next to each other.

Quote:

This can hardly make sense, since each of the 30 units is chosen twice, and is in contact with itself.

I'm close to doing this, not. No, I gave P2 sharpshooters two commands when P1 was in Area X. The way I thought I made it was P1 in Area X, P2 Sharpshooters Stance/Xplore and as P1 got closer to the Objective Area, P1 would trip Area Y giving P2 Objectives and Sharpshooters a new stance which the sharpshooters would come in from behind P1 at times. But, it still wasn't working, ended up giving the P2 Sharpshooters and Objectives Stance/Gaurd, unknowingly the whole time sharpshooters had two commands at the same time, for both Areas were X. In all, mine crashed every time P1 hit Area X(RR Crossing...Ding Ding Ding Ding Ding).



Matthew 5:11
posted 06-02-04 08:48 PM EDT (US)     6 / 11  
How about a lag-free way to fire a trigger when any 1 P1 unit is Near any 1 P2 unit (Object Specification, not Select On Map). I've implemented a hand-to-hand combat trigger for my campaign, but I'm afraid the lag may eventually force me to take it out.
posted 06-02-04 09:10 PM EDT (US)     7 / 11  
Let me ask;

1.Are all P1, and P2 units on the map before the game starts?
2.Are there any allies of either P1 or P2?

If u have a trigger tag all P1 units, that are visible by P2, and tag all P2 units, that are visible by P1...1 unit at a time, and untag the same units not visible by other player, in quick succession, that should work. There are additional triggers added to that, that would help further.

condition; P1 unit taggged, near P2 unit tagged "exists"
effect; whatever

Make tagging of units is certain areas that are not in areas that have building los that would help see the other units, so they would more likely only be tagged when near another player unit. The fewer units that triggers have to sift through, the less lag.


.....................................
...............(\ /)................
..............(^.^)...............
.............<( < )...............
...............(/ (/................
...All American Bunny.....

[This message has been edited by _o0XxX0o_ (edited 06-02-2004 @ 09:20 PM).]

posted 06-02-04 09:14 PM EDT (US)     8 / 11  
I thought thats what you meant, but wasn't totally sure.


Matthew 5:11

[This message has been edited by YaRiTe (edited 06-02-2004 @ 09:32 PM).]

posted 06-02-04 09:19 PM EDT (US)     9 / 11  
P1, sorry. I corrected it.

.....................................
...............(\ /)................
..............(^.^)...............
.............<( < )...............
...............(/ (/................
...All American Bunny.....

[This message has been edited by _o0XxX0o_ (edited 06-02-2004 @ 09:19 PM).]

posted 06-03-04 00:46 AM EDT (US)     10 / 11  
Yes, I was thinking of tagging units with a variable, but that would still mean using a trigger to check whether a unit is near a unit. You're right though, it would mean less units to sift through.

The units involved in the trigger can be any P1 or P2 infantry units, whether they were on map from the start or appear later in the scenario.

posted 06-03-04 01:35 AM EDT (US)     11 / 11  
Question 1 only refered to that if no additional units that were compared to, were spawned or created during the scenario, u could select on map all the units of P1 and then on a seperate object select all of P2 units and just use all P1 units near the all P2 units, using no lag.

As for question 2, if ther are no shared visibility allies, then that would reduce the tagged units even more.


.....................................
...............(\ /)................
..............(^.^)...............
.............<( < )...............
...............(/ (/................
...All American Bunny.....

[This message has been edited by _o0XxX0o_ (edited 06-03-2004 @ 01:35 AM).]

Empires Heaven » Forums » Scenario Design Discussions » When I saw this trick, I was amazed.
Top
You must be logged in to post messages.
Please login or register
Hop to:    
Empires Heaven | HeavenGames