| General | Hosted Sites | Civ5 | CivRev | Civ4Col | Civ4 | Civ3 | Civ2 | Civ1 | Misc | Marketplace |
![]() |
|
|
Welcome to Civilization Fanatics' Center. You are currently viewing our site as a guest which gives you limited access to our site features. By joining our free community, you will be able to participate in the discussions, search the forum, send private messages, vote in polls, upload your own screenshots to the gallery, and access many other special features. Registration is fast, simple and absolutely free, so sign up today! If you have any problems with the registration process or your account login, please contact support. |
|
|||||||
![]() |
|
|
Thread Tools |
|
|
#1 | |
|
Prince
Join Date: Sep 2010
Location: Poland
Posts: 386
|
Trigger function before city capture
Task description:
I want to create new civ with UA that will let to save cultural building in captured city. Problem description: I want to create list of cultural building in the city before capturing. In this why I will be able to add it later. The problem is how to trigger function just before capturing. I think that I can monitor all move or attack of this civ units but maybe there is some better solution. Question: 1) How to trigger function before city capturing? 2) Do you know other method to save building in the city captured by given civ? 3) What is name of function that decide to destroy or not to destroy building in captured city? I think that it is core game function but I could be mistaken. 4) Do you have any example of use RunCombatSim event? EDIT: I just have found this info: Quote:
Last edited by Nefliqus; Jun 15, 2012 at 11:28 PM. |
|
|
|
|
|
|
#2 |
|
Deity
Join Date: Jun 2008
Posts: 2,054
|
Please report back what you learn. I always want to know which of these Events work when not seen by human (no way to know unless someone tests it) and timing issues.
One issue about timing: Results are not always consistent for specific Events. I think this is because they are supposed to be for animations/graphics (which could be delayed by some other running animation) and not really game rule effects (even though we modders use them this way). The GameEvent should not have this problem, although I'd guess that it is too late for your need. SciprtData is maybe another possibility: you could store all buildings there each turn. Strangely, the wiki lists SetScriptData under city object but not GetScriptData (I have not tested to see if these exist and work). But plot:SetScriptData and plot:GetScriptData work fine and there is only one unique plot for each city. |
|
|
|
|
|
#3 |
|
Moderator
![]() Join Date: Oct 2004
Location: France
Posts: 3,639
|
Yes, please report your results.
I used RunCombatSim event in conjunction with unit:GetLastMissionPlot() to check if a city was about to be captured but it doesn't work anymore since the last patch my guess is that with the new animation system, the result of the combat is calculated and applied before the actual animation start and RunCombatSim is called and unit:GetLastMissionPlot() does non longer return the plot the unit is going to attack, but the one it's on. |
|
|
|
|
|
#4 | |
|
Prince
Join Date: Sep 2010
Location: Poland
Posts: 386
|
Quote:
The easiest solution for me is to add building list to city scriptdata or cityplot and check it after GameEvents.CityCaptureComplete. I can also build table with such information but it will need to run all cities loop every turn. It could add some additional turn time and I don't want to do it. I plan to wait for GAK with all test. Last edited by Nefliqus; Jun 16, 2012 at 12:15 AM. |
|
|
|
|
|
|
#5 |
|
Moderator
![]() Join Date: Oct 2004
Location: France
Posts: 3,639
|
Events.SerialEventCityCaptured is called after the city has been captured. I need an event before.
|
|
|
|
|
|
#6 |
|
Prince
Join Date: Sep 2010
Location: Poland
Posts: 386
|
does anybody know what is happening between Events.SerialEventCityCaptured and GameEvents.CityCaptureComplete?
|
|
|
|
|
|
#7 |
|
Prince
Join Date: Sep 2010
Location: Poland
Posts: 386
|
Austria UA save all building in the city.
so I need just find relevant part of the code.
|
|
|
|
![]() |
| Bookmarks |
|
| Thread Tools | |
|
|