eleazar wrote:
Currently i don't see a way to make [monsters] randomly appear in the middle of the game.
A special in planet_specials.txt would be randomly placed around the galaxy. Such a special could have a Turn condition in one of its effectsgroups, which would prevent something from happening until a certain number of turns has passed. After that condition is met, the special could start randomly spawning monsters.
Or, a tech or building could have an effectsgroup that creates monsters, and this would start happening as soon as the tech or building is researched or produced by an empire.
Quote:
1) there are planet type X in the system
You should be able to do this with something like
Code:
And [
System
Contains Planet type = Terran
]
Quote:
2) there are imperial (non-monster) ships in the system
Code:
And [
System
Contains And [
Ship
OwnedBy AnyEmpire
]
]
Quote:
3) there are specific monster hulls in system.
Code:
And [
System
Contains DesignHasHull name = "SH_EXAMPLE"
]
Those are all untested, but should give you the right idea.
Quote:
Usually there is also a random probability.
Code:
Random probability = 0.5
Quote:
I'm not clear on what goes in "scope =" and what goes in "activation =".
The scope condition determines what are the target objects for an effect. The target objects are the objects on which the effect acts. If the effect is setting a meter or destroying an object, then the target objects have their meter set or are destroyed. If the effect is creating a monster, it would create a monster at every target object.
The activation condition can be left out if not needed or not understood, and things should work as expected. It is used to enable / disable the effectsgroup by running a test only on the source object, unlike the scope condition which is tested on every object (ship, fleet, planet, building, and system) in the universe. Evaluating a condition on just the source is a lot faster than doing so on everything in the universe, so it's useful to have the activation condition for things like turning on or off an effect depending on whether the empire that owns a building has a particular tech.
There are some misuses of activation in the current content files. The imperial palace has an activation that tries to test how many of a particular building an empire has, but this won't work, as only the source building for the effectsgroup will be tested, so at most 1 such building will be found by that condition.
Quote:
Also, say for instance that i wanted 2 krill swarms to merge into a bigger krill swarm.
If krill swarm looks out for the presence of another krill swarm in the same system, produces bigger krill swarm, then deletes itself... will the order things are executed give me 2 bigger krill swarms or 1?
I expect you'd get 2 bigger krill swarms. The destroy effect doesn't actually delete objects until all other effects have executed. "Executing" the destroy effect just marks an object as to be destroyed, and the actual deleting takes place afterwards.
So, you'll need to be a bit fancier with the effectsgroup for things to work as you want with two objects being destroyed and just one being created. The MaximumNumberOf conditions might work, as you can ask it to match just one object, and then you could have a stacking group label in the effectsgroup as well, so even if both krill swarms have a CreateShip effect, only one will actually be executed (as the second attempt would see the stacking group label has already been applied to the target object, so it would be skipped). I don't seem to have documented MaximumNumberOf, MinimumNumberOf, or ModeNumberOf though...
Edit: It would probably work to just use the NumberOf condition, which is documented on the wiki.
Or, instead of having a single effectsgroup that creates a new monster and destroys the old ones, you could have two effects groups: one would match a type of monsters when there are two of the monster in the same system, and would destroy the matched monsters. The other would test for systems that contain two of the monster, and would create a new monster in those systems, and would have a stacking group. This effectsgroup would be tested for every moster of the relevant type every turn, which might be a bit slow, but it would only act at most once per system per turn due to the stacking group, and would probably be easier to understand than using the SortedNumberOf condition. /Edit
Quote:
Also: what does "location=" do in a ship hull?
It is used by the production system to determine where a ship with that hull can be produced. For example, it could require a particular building to be present on a planet for a ship to be built there.