Conquest of Elysium 4

Conquest of Elysium 4

Event modding seemingly not working properly
As a part of my mod I am trying to have units appear in Hamlets via event modding. It's key that this square event can tell the different between the modded classes because a different unit must spawn depending on which class owns the hamlet. The stuff I have written below works, but it produces one faction's unit in all hamlets across the world. Removing the # and adding this classlimit should in theory tie this square event to one faction and all should be well, but removing the # in fact causes everything to grind to a halt; not only does it then not work as intended, but the entire event seems to stop doing anything. Having messed around with this a lot over the last hour it seems to me that the [+class -3 "(Classname)"] part of the event mod is what is causing an issue.

squareevent
+minturnnbr 1
+terrain 7
#+class -3 "(Classname)"
-hasunithere -3 "(Unit)"
newunits -3 "(Unit)"
promote 1 "(Unit)"
message -1 "Something occurred"
endevent

Have I missed something stupid or am I right in saying that this eventmodding is not working as intended at the moment?
< >
Showing 1-4 of 4 comments
Nethermind 8 Jun, 2018 @ 7:41am 
You are missing a little somthing. Events are done at the start of EVERY player's turn, so it does get slow quickly. CoE also seems to process each command line by line, so by ordering things right you can get more effieciency.

Some working event code that does roughly the same thing...

squareevent +minturnnbr 1 #Game has started +class -2 "Priest King" #Current turn's class is PK +terrain 3 #PK starting temple -hasunithere -3 "Slave" #No slaves already newunits -3 "Slave" #Make one promote 1 "Slave" #make commander message -1 "A slave was captured and somehow became a commander!" #to everyone endevent

This spawns a commander slave every PK turn at their capital providing they don't have one there already. Hopfully you can edit it to work for you.
@Nethermind this doesn't work for me, because in my instance I'm trying to make it so that hamlets will spawn player-specific village elders. Taking that example event code and replacing the PK units with the units from my mods wouldn't work, because it spawns the village elder in every hamlet across the map, because (class -2) square events check every player every turn, so it is always the turn of the PK/Mod class for square event purposes, and it simply assigns this elder to the player that owns the tile (newunits -3),

Logically the solution would be to change class -2 to class -3 so that the squareevent only looks at hamlet tiles that are owned by my modded faction, and then proceeds to spawn a unit there if there is not one already. Doing this however just breaks the entire squareevent, reducing it to absolutely no output with no error code or warning or anything, hence my original post. I wouldn't have imagined that the syntax would have been the issue here anyways and I have been messing around with that without getting any progress.
Nethermind 8 Jun, 2018 @ 9:13am 
Oh my apologies I really am an idiot and forgot the important part of thorough testing. For whatever reason the easy way you wrote just doesn't seem to work, however with actual testing this time...

squareevent +class -2 "Baron" #current player is baron +squareowner -2 #current player owns the tile, must also be baron^ +terrain -40 #hamlets and coastal hamlets -hasunithere -1 "Baron Elder" #No elders allowed newunits -2 "Baron Elder" #Owned by the current player/tile owner promote 1 "Baron Elder" #make commander message -3 "An old man was born in your hamlet!" #to the tile owner endevent

I don't know why this way works, but the other doesn't. it may have somthing to do with +class -3 not working however.
By player-specific unit do you mean for all existing classes, for just for yours?
Sorry, by player-specific I meant class-specific. So Class A gets a certain type of village elder, class B gets a different type, etc. So then different types of village elder have different rituals to fit that class. Thanks for the extra reply, I will test that when I can.
< >
Showing 1-4 of 4 comments
Per page: 1530 50