HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Trigger with random spots

01-23-2006, 11:48 AM#1
Nirual
Ok, this is a bit complex and while I think its a great idea, making it goes way beyond my triggering skills, so I thought I'd ask around here.

The concept is some sort of treasure hunting. If you build a building on the right spot, you get a reward (item, gold, etc).
Now, to keep this interesting, the spots where the treasures are should be random and change every game. The system should work both with placing visible signs and without.

So bascially, I'd need a basic trigger system for a zone which defines those spots every game. I should be able to trigger the rest, eg what happens if someone builds on that spot without having to change terribly much in that basic system.

As for the size of these spots, it should be as big as the basic tower model (2x2). As for placing, the building just needs one square placed on the spot, else it would be a bit hard. The event should only occur once per spot.
01-23-2006, 12:04 PM#2
qwertyui
There are functions to get random point in region. You can always apply them to the whole map.

Now the tricky part begins where it selects an unpathable point :/

What you can do is try putting a tower anywhere on the map - the computer will autoselect pathable spot - then store the location of this tower and remove it.

This will cover all unpathable/unbuildable areas, but will still leave u with other problems. Still, its a good start :)
01-24-2006, 06:42 AM#3
PerfectlyInsane
First of all place in the game a number of flying units that are nuetral passive and invunerable. These units are invisible to the players. Then when the game starts move these units instantly to a random point on the playable map.



Now as above spawn a tower. Move of of these Flying units instanly to the point of last created unit. and kill the tower. Of course if you want a larger buildable area then you jut have to spawn a larger buidling that uses up more tiles

Since these units existed on the map they are tagged and detecting when a unit-type comes into range will be easy.



and you can create an item for them.

and deactivate the trigger.
01-24-2006, 10:31 AM#4
qwertyui
What's the point of flying unit then?
Why not just create a region?
01-24-2006, 05:57 PM#5
Vexorian
Map initialization
- Add a random number of points to an array. The points should be random positions in the map using the named function.

You can first divide the map in zones and pick the points for each zone to help distributing it better

You can have a 25% chance to add a sign or something to the point once it is picked and saved in the array.

You need an integer variable that says the number of points you added let's call it N

When a building is built
Loop for 1 to N check the distance between each point and the building's origin. Find the minimum distance AND the index of the point that had that distance

Check if minimum distance is small enough.

Add the bonus to the Owner of the bulding.

Remove the point from the array: Assing array[N] to array[index] then decrement N


Eventually N will be 0 and the loop will do nothing.