Conquest of Elysium 4

Conquest of Elysium 4

 This topic has been pinned, so it's probably important
johan  [developer] 30 Dec, 2015 @ 3:39am
Event Modding
Here is a list of the event modding commands. Note that triggers can be inverted by writing - instead of +.

------------------------- --- Event start/end --- ------------------------- playerevent (once for each player every turn, occurs in home citadel by default) squareevent (for each player and each square in the world every turn) endevent ----------------------- --- Triggers -------- ----------------------- +squareowner <player> (true if target square is owned or occupied by this player) +armyowner <player> (true if square is occupied by this player) +turnnbr <turn nbr> +minturnnbr <turn nbr> +chance <percent> +player <player> (true if current player has this player number) +class <player> "class name" (true if this player is this class) +hascom <player> "commander's name" (also sets target unit) +hascomhere <player> "commander's name" (also sets target unit) +ownsloc <player> <terr nbr> (true if player owns this terrain anywhere in the world) +terrain <terr nbr> (true if target square is of this terrain) +season <0-3> (0=summer, 1=autumn, 2=winter, 3=spring) +seasondelay <1-3> (3=early (guaranteed to only happen once per season), 2=mid, 1=late) +varequal <var> <value> (var = 0-999, true if variable equals value) +varlesser <var> <value> (true if the variable is less than value) +hasunit <player> "monster name" (also sets target unit) (player -1 = any player) +hasunithere <player> "monster name" (also sets target unit) (player -1 = any player) ----------------------- --- Event actions --- ----------------------- addresources <player> <type> <amount> message <to player> "text" affect target location ------- newunits <player> "monsters" (also sets target unit) promoteunits <player> <max amount> "from monster" "to monster" (also sets target unit) alterterrain <terr nbr> (changes the terrain of the current location) killsquare (kills everyone in target square) change where the target location is ----------------------------------- setloc <x> <y> (move target location to a fixed location) scatterloc <radius> (makes target location deviate a bit, can result in the same square. Cannot be used on squareevents) affect target unit ------- comname "commander's name" newitem "item name" randitem <rare chance> randmisc <rare chance> killunit <dmg> promote <commanderize> "monster" (commanderize 0 = do not alter commander status, 1 = turns a non commander into a commander) makestationary (makes target unit stationary on world map) affect variables ---------------- (all variables are set to zero when the game begins) setvar <var> <value> (var = 0-999, sets a variable to a value) addvar <var> <value> (var = 0-999, adds a value to a variable) ------------------------- --- player numbers ------ ------------------------- Where a "player" number is required one of these numbers can be used. 0-15 = player number 16 = independends 17 = special monsters 18 = Horrors 19 = Hades 20 = Inferno -1 = everyone (only for messages and a few triggers) -2 = event player (current player) -3 = square owner -4 = army owner
Last edited by johan; 17 Aug, 2018 @ 2:56am
< >
Showing 1-15 of 38 comments
carn112004 30 Dec, 2015 @ 4:53am 
Great!


If i understand correctly, there is no event command to have an event recurring at certain intervals or seasons? (e.g. for creating conscription event each early summer)
johan  [developer] 30 Dec, 2015 @ 5:12am 
Not at regular intervals, I'll have to add that next time. But +chance can be used for a random chance each month.
Marlin 30 Dec, 2015 @ 8:16pm 
Yup, this really is a vast improvement over CoE3 event modding in most ways, it seems. Now possible to require multiple triggers for an event! Yay! And the default is now to allow triggering every turn, unless there is a trigger to tie the event to a specific turn. Clearer syntax indeed, and it seems things can be combined basically any which way we want.

Still, for me to be able to recreate my CoE3 What Era? mod for CoE4, I find there is something missing – namely a way to count stuff.

What I would want is support for numerical variables. (In my CoE3 mod – which counts and compares weighted numbers of squares of different terrain types – I employed the hack of adding and counting monsters of a "chalk mark" type, specifically defined for this purpose, on the map. I was using ownsterrevent and hasmonevent. But plain numerical variables would be much better.)

I would imagine I could use approximately the following:
  • Triggers for a variable having at least or at most a certain value (or being equal to it).

  • Event actions to add or subtract a given number to a variable.

  • An event action effecting some kind of division of one variable by another – this for comparison purposes. The neatest way to do this (sticking with integer arithmetics) might be to assign a percentage (which could be greater than 100 if the dividend is greater than the divisor) to a third variable.

    (Alternatively, triggers that compare a percentage number to the quotient of two variables.)

    Don't know if this seems over the top, but I really could use it. In my What Era? mod, I try to compare primarily the number of farms to the number of ancient forests, in order to distinguish the dark ages from the agricultural period. And mere subtraction obviously doesn't scale well with varying map sizes.

  • Preferably an event action also to invalidate a variable, causing all further references to it in triggers to fail, and in event actions to be treated as no action.

  • Some command to define a variable.
Obviously, if the only use of this would be for my little What Era? mod, it won't be worth the trouble. I would imagine, though, that an ability to count (and even compare) stuff could come in handy elsewhere too.
Last edited by Marlin; 31 Dec, 2015 @ 3:37am
johan  [developer] 31 Dec, 2015 @ 5:12am 
There will be some simple variables to manipulate in the next version. It can be useful to make events that can only appear a limitied amount of times as well.
johan  [developer] 12 Jan, 2016 @ 7:32am 
First post updated to version 4.10
Marlin 16 Jan, 2016 @ 4:04pm 
It seems a warning could be in place regarding the variables. As far as I can tell, the one thousand variables available are global, or common to all mods, so use of one and the same variable by two different mods can lead to all kinds of unpredictable and almost certainly undesirable effects.

One thousand variables is a fairly large amount, of course, but still finite, so modders need to watch out about this. Unless I have misunderstood something.
johan  [developer] 17 Jan, 2016 @ 10:04am 
Originally posted by Marlin:
It seems a warning could be in place regarding the variables. As far as I can tell, the one thousand variables available are global, or common to all mods, so use of one and the same variable by two different mods can lead to all kinds of unpredictable and almost certainly undesirable effects.

One thousand variables is a fairly large amount, of course, but still finite, so modders need to watch out about this. Unless I have misunderstood something.

That's correct.
johan  [developer] 26 Jan, 2016 @ 3:35am 
First post updated to version 4.11
Marlin 13 Mar, 2016 @ 5:05pm 
Things not possible in CoE4 event modding that were in CoE3

When about to answer a question as to how one can set up players as well as add independents to a map, I couldn’t find as complete an answer as I would have liked to. While setloc does seem to allow adding units to specific locations on the map, I cannot find anything corresponding to the Kill square event in CoE3, with which the square could first be cleared, before new units were created there. I also can’t find a counterpart to the CoE3 Assimilate Square event, which could (among other things) be used to give fixed players control over certain sites at game start.

Which made me investigate what further things might be missing from CoE4 event modding, compared to CoE3.

Here is my current (possibly incomplete and/or erroneous) list:
  • A location trigger (with map X and Y for parameters) seems to be missing from CoE4. The setloc event action is nice, but it could be useful to also have a trigger for it. (A number of CoE3 triggers took map X and Y for parameters.)

  • Also, a home citadel trigger, for a given player, is missing. Perhaps also a corresponding event action. (If it isn’t implemented as part of the setloc event action, and above location trigger, the way it was in CoE3 – where a home citadel could be given as "-4,player number".)

  • A trigger for a named item (held by a given player) is missing. (In CoE3 there was the itemlocevent trigger.)

  • An event action to kill everybody in a square seems to be missing. (Corresponding to the CoE3 Kill Square event.) The new killunit event action is very nice (I wished for it in CoE3), but sometimes you are in a more murderous mood and just want to kill everything.

    There is a killsquare event action. (Added already in 4.13, in February, before I made this post, embarrassingly, though not included in the list of event action commands above.)

  • An event action to pass control over a square to a given player is missing. (Corresponding to the CoE3 Assimilate Square event.)

  • Similarly, an event action to change control over units is not there either. (Corresponding to the CoE3 Defection event.)
In addition to these clearly missing things, I also don’t think it’s possible in CoE4 to have events count the number of monsters (under a player’s control), the way the CoE3 event hasmonevent could (thanks to having min and max parameters). Though I’m not entirely sure how such a feature would be efficiently and conveniently implemented in the CoE4 system.

Also, while counting terrain (similar to how it could be done with CoE3 ownsterrevent) may be possible in CoE4 event modding, I think counting and evaluation could be neater. (I do think a percentage trigger, comparing a percentage number to the quotient of two variables might have been nice ☺.)

The CoE3 ritualevent trigger is of course not possible to emulate in CoE4, but presumably it won’t be needed with the vastly expanded ritual modding in CoE4. The CoE3 map flags also seem to be gone, but I never used those myself and I can’t recall seeing anybody else doing it either.
________________________________________

Edit: A killsquare event action exists. That part is covered.
Last edited by Marlin; 12 May, 2016 @ 12:01pm
+seasondelay crashes the game on starting a match, with the error message: "No event trigger called: seasondelay"

Marlin found that the actual command is +seasonleft. A documentation fix to reflect this would be helpful.

Thanks!

Edit: I happened upon another last night. +minturn crashes the game in the same way as +seasondelay and with a similar message.

I took a look in the executable with a hex editor as Marlin did before and found that the actual command is +minturnnbr.
Last edited by Colonel Dracula joins the Navy; 22 Apr, 2016 @ 10:52am
carn112004 25 Apr, 2016 @ 4:12am 
This is not documented?

I just tested and it seems - instead of + means conditioned must not be fulfilled for event to happen.

E.g.:
squareevent
+terrain 127
-class -3 "Sylvan Queen"
alterterrain 4
endevent

seems to cause each turn to change each elven forest (127) to turn into ancient forest (4) unless its owned by class "Sylvan Queen".
Marlin 25 Apr, 2016 @ 7:43am 
Wow! It does seem that event triggers can be logically negated with a minus instead of a plus! Who would have guessed that? Well, obviously you did, Carn, and it only took you four months after event modding for CoE4 was introduced to do it. While nobody else was able to. Well done! :steamhappy:

This certainly makes the event triggers quite a bit more powerful than I previously realized.
That is an incredibly valuable discovery, carn! Thank you so much!
Drithyl 8 May, 2016 @ 7:47am 
I wonder if there is any way to check or select neighbouring terrains to a given location. For example, assume we want an climate event, strong rains that make rivers overflow, and so we trigger the event in all river squares, and target their adjacent tiles to become river as well, thus widening the rivers due to the rain.

How would you go about this? Is it even possible with the current commands? I've looked through the list, but I can't figure it out.
Marlin 12 May, 2016 @ 12:04pm 
I also think some kind of event ranges could be very useful. Though, to be honest, I’m not entirely sure how to implement it in a good and efficient way.
< >
Showing 1-15 of 38 comments
Per page: 1530 50

Date Posted: 30 Dec, 2015 @ 3:39am
Posts: 38